MoisesSegura
MoisesSegura
FFilament
Created by MoisesSegura on 3/5/2024 in #❓┊help
Searchable translatable column
I ended up making a filter to solve the issue: SelectFilter::make('id')->label('Titulo') ->options(LaboralDocument::all()->pluck('title', 'id')) ->searchable() ->preload()
6 replies
FFilament
Created by MoisesSegura on 3/5/2024 in #❓┊help
Searchable translatable column
No description
6 replies
FFilament
Created by MoisesSegura on 11/6/2023 in #❓┊help
Default route filament login
thanks that was what I needed!
4 replies
FFilament
Created by MoisesSegura on 11/1/2023 in #❓┊help
modifyQueryUsing with a role
I found a solution: ->modifyQueryUsing(fn (Builder $query): Builder => $query->when(auth()->user()->hasRole('Admin') === false, function ($query) { return $query->where('country_id', auth()->user()->country_id); }))
3 replies
FFilament
Created by MoisesSegura on 11/1/2023 in #❓┊help
I can't login into filament with a new user
I got it, it was the hash I just added hash function in the resource: TextInput::make('password') ->password() ->dehydrateStateUsing(fn (string $state): string => Hash::make($state))
19 replies
FFilament
Created by MoisesSegura on 11/1/2023 in #❓┊help
I can't login into filament with a new user
No description
19 replies
FFilament
Created by MoisesSegura on 11/1/2023 in #❓┊help
I can't login into filament with a new user
yes, but only the admin can access to all resources
19 replies
FFilament
Created by MoisesSegura on 11/1/2023 in #❓┊help
I can't login into filament with a new user
yeah ->schema([ TextInput::make('name') ->required(), TextInput::make('email') ->email() ->required(), TextInput::make('password') ->password() ->hiddenOn('edit', true) ->required(), Select::make('roles')->multiple()->relationship('roles','name') ]);
19 replies
FFilament
Created by MoisesSegura on 11/1/2023 in #❓┊help
I can't login into filament with a new user
oh I have a suspicion it could be because of the hash
19 replies
FFilament
Created by MoisesSegura on 10/24/2023 in #❓┊help
modal doesn't save
so it's not psychic but it's magical xD
35 replies
FFilament
Created by MoisesSegura on 10/24/2023 in #❓┊help
modal doesn't save
thanks man!
35 replies
FFilament
Created by MoisesSegura on 10/24/2023 in #❓┊help
modal doesn't save
OMG it worked!
35 replies
FFilament
Created by MoisesSegura on 10/24/2023 in #❓┊help
modal doesn't save
yes that is
35 replies
FFilament
Created by MoisesSegura on 10/24/2023 in #❓┊help
modal doesn't save
trait Translatable { // This override get translations fields protected function fillForm(): void { $this->callHook('beforeFill'); $data = $this->getRecord()->attributesToArray(); foreach (static::getRecord()->getTranslationsArray() as $key => $value) { $data[$key] = $value; } $data = $this->mutateFormDataBeforeFill($data); $this->form->fill($data); $this->callHook('afterFill'); } // This override get SQL optimization and get all translations protected function getTableQuery(): Builder { return static::getResource()::getEloquentQuery()->with('translations'); } }
35 replies
FFilament
Created by MoisesSegura on 10/24/2023 in #❓┊help
modal doesn't save
class Bibliography extends Model implements TranslatableContract { use HasFactory; use Translatable; protected $table = 'bibliography'; protected $guarded = []; public $translatedAttributes = ['text']; public $timestamps = false; }
35 replies
FFilament
Created by MoisesSegura on 10/24/2023 in #❓┊help
modal doesn't save
it doesn't have one tha package (astrotomic) handles it
35 replies
FFilament
Created by MoisesSegura on 10/24/2023 in #❓┊help
modal doesn't save
only text but its associated with a translation table CREATE TABLE bibliography ( id int(11) NOT NULL AUTO_INCREMENT, hide_locale varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (id) ) ENGINE=InnoDB AUTO_INCREMENT=347 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; CREATE TABLE bibliography_translation ( id int(11) NOT NULL AUTO_INCREMENT, translatable_id int(11) NOT NULL, text longtext COLLATE utf8_unicode_ci NOT NULL, locale varchar(255) COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (id), UNIQUE KEY bibliography_translation_uniq_trans (translatable_id,locale), KEY IDX_CDE13E762C2AC5D3 (translatable_id), CONSTRAINT FK_CDE13E762C2AC5D3 FOREIGN KEY (translatable_id) REFERENCES bibliography (id) ON DELETE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=539 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
35 replies
FFilament
Created by MoisesSegura on 10/24/2023 in #❓┊help
modal doesn't save
public function bibliography() { return $this->belongsTo(Bibliography::class); } oh yes, but where do I paste it?
35 replies
FFilament
Created by MoisesSegura on 10/24/2023 in #❓┊help
modal doesn't save
sorry i dont get it
35 replies
FFilament
Created by MoisesSegura on 10/24/2023 in #❓┊help
modal doesn't save
No description
35 replies