Usage
Filament
Form Field
to use Lara Zeus Mark in your forms:
1use LaraZeus\Mark\Forms\Components\Mark;2use App\Models\Like;3 4Mark::make('like')
and you can chain any other method as in filament default components:
1Mark::make('like')2 ->label('Like it')3 ->columnFullSpan()4 // ...
Mark Type:
to set the marker type:
1Mark::make('like')2 ->like() 3 ->bookmark() 4 ->rating()
custom mark
1Mark::make('like')2 ->icons([ 3 true => 'heroicon-o-hand-thumb-up', 4 false => 'heroicon-o-hand-thumb-down', 5 ]) 6 ->selectedIcons([ 7 true => 'heroicon-s-hand-thumb-up', 8 false => 'heroicon-s-hand-thumb-down', 9 ])
Set The Relationships
1Mark::make('like')2 // default uses component name3 ->relationship() 4 // or custom relation name5 ->relationship(name: 'like')
Set Custom Metadata
1Mark::make('like')2 ->relationship(metadata: fn($record) => ['name' => $record->name])