added feaured image to entry
edit form now has image upload for featured image table view for entries shows featured image view entry shows featured image
This commit is contained in:
parent
d24b9b0732
commit
9f01d44c9d
3 changed files with 11 additions and 1 deletions
|
|
@ -6,6 +6,7 @@ use Filament\Actions\Action;
|
|||
use Filament\Forms\Components\DatePicker;
|
||||
use Filament\Forms\Components\RichEditor;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\SpatieMediaLibraryFileUpload;
|
||||
use Filament\Forms\Components\Textarea;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Forms\Components\Toggle;
|
||||
|
|
@ -31,6 +32,11 @@ class EntryForm
|
|||
->readOnly(),
|
||||
Textarea::make('description')
|
||||
->columnSpanFull(),
|
||||
SpatieMediaLibraryFileUpload::make('featured_image')
|
||||
->collection('featured-image')
|
||||
->image()
|
||||
->imageEditor()
|
||||
->columnSpanFull(),
|
||||
Toggle::make('is_published')
|
||||
->required(),
|
||||
Toggle::make('is_featured')
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
namespace App\Filament\Resources\Entries\Schemas;
|
||||
|
||||
use Filament\Infolists\Components\IconEntry;
|
||||
use Filament\Infolists\Components\SpatieMediaLibraryImageEntry;
|
||||
use Filament\Infolists\Components\TextEntry;
|
||||
use Filament\Schemas\Schema;
|
||||
|
||||
|
|
@ -17,6 +18,9 @@ class EntryInfolist
|
|||
TextEntry::make('description')
|
||||
->placeholder('-')
|
||||
->columnSpanFull(),
|
||||
SpatieMediaLibraryImageEntry::make('featured_image')
|
||||
->collection('featured-image')
|
||||
->columnSpanFull(),
|
||||
IconEntry::make('is_published')
|
||||
->boolean(),
|
||||
IconEntry::make('is_featured')
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ class EntriesTable
|
|||
return $table
|
||||
->columns([
|
||||
SpatieMediaLibraryImageColumn::make('featured_image')
|
||||
->collection('featured')
|
||||
->collection('featured-image')
|
||||
->circular()
|
||||
->stacked()
|
||||
->limit(3),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue