Skip to content

Commit

Permalink
fix icon picker
Browse files Browse the repository at this point in the history
  • Loading branch information
3x1io committed May 9, 2024
1 parent febc422 commit 0d5eb96
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 5 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"require": {
"php": "^8.1|^8.2",
"tomatophp/console-helpers": "^1.1",
"filament/filament": "^3.0.0"
"filament/filament": "^3.0.0",
"tomatophp/tomato-icons": "^1.0"
}
}
31 changes: 30 additions & 1 deletion config/filament-types.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
<?php

return [
/**
* Types For
*
* You can set the types for selected tables or models
*/
"for" => [
"posts" => "posts",
"accounts" => "accounts",
],

/**
* Types
*
* Category of types like if you use posts it can be Category/Tags
*/
"types" => [
"posts" => [
"category" => "category",
Expand All @@ -16,7 +27,25 @@
]
],

/**
* Type API Middelware
*
* Set the middleware for the API of Types it can be empty if you need it public
*/
"middleware" => ['auth:sanctum'],
"categories_resource" => null,


/**
* Types API Resource
*
* If you need to use a resource for the API of Types you can set it here
*/
"types_resource" => null,

/**
* Show Navigation Menu
*
* If you need to show the navigation menu for the types
*/
"show_navigation" => true,
];
8 changes: 5 additions & 3 deletions src/Resources/TypeResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace TomatoPHP\FilamentTypes\Resources;

use TomatoPHP\FilamentIcons\Components\IconPicker;
use TomatoPHP\FilamentIcons\Components\IconColumn;
use Filament\Resources\Concerns\Translatable;
use Guava\FilamentIconPicker\Forms\IconPicker;
use Guava\FilamentIconPicker\Tables\IconColumn;
use Illuminate\Database\Eloquent\Builder;
use TomatoPHP\FilamentTypes\Facades\FilamentTypes;
use TomatoPHP\FilamentTypes\Resources\TypeResource\Pages;
Expand Down Expand Up @@ -143,7 +143,8 @@ public static function table(Table $table): Table
Tables\Columns\ColorColumn::make('color')
->label(trans('filament-types::messages.form.color'))
->searchable(),
IconColumn::make('icon')->label(trans('filament-types::messages.form.icon'))
IconColumn::make('icon')
->label(trans('filament-types::messages.form.icon'))
->searchable(),
Tables\Columns\IconColumn::make('is_activated')
->label(trans('filament-types::messages.form.is_activated'))
Expand All @@ -159,6 +160,7 @@ public static function table(Table $table): Table
->sortable()
->toggleable(isToggledHiddenByDefault: true),
])
->defaultGroup('for')
->filters([
Tables\Filters\Filter::make('created_at')
->form([
Expand Down

0 comments on commit 0d5eb96

Please sign in to comment.