diff --git a/app/Filament/Resources/PresentationResource.php b/app/Filament/Resources/PresentationResource.php index 60f54ee..7294b6a 100644 --- a/app/Filament/Resources/PresentationResource.php +++ b/app/Filament/Resources/PresentationResource.php @@ -18,6 +18,7 @@ use Filament\Tables\Table; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\SoftDeletingScope; +use Illuminate\Support\HtmlString; use Illuminate\Support\Str; use Illuminate\Validation\Rules\Unique; @@ -38,7 +39,13 @@ public static function form(Form $form): Form ->schema([ Forms\Components\MarkdownEditor::make('content') ->required() - ->columnSpan([ + ->hint(new HtmlString( + 'Tip: ' + .'Slides are separated by 2 newlines.' + ))->helperText(new HtmlString( + 'Want an example? See the site\'s ' + .'instructions.' + ))->columnSpan([ 'md' => 2, ])->disableToolbarButtons([ 'attachFiles', @@ -51,7 +58,6 @@ public static function form(Form $form): Form return null; }), Section::make('Details') - ->description('All the metadata related to your presentation.') ->columnSpan(1) ->schema([ Forms\Components\TextInput::make('title') @@ -61,7 +67,7 @@ public static function form(Form $form): Form ->maxLength(255), Forms\Components\TextInput::make('slug') ->required() - ->hintIcon('heroicon-o-information-circle', tooltip: 'Autogenerated') + ->hintIcon('heroicon-o-information-circle', tooltip: 'The slug is autogenerated from the title, but you can still change it.') ->unique( ignoreRecord: true, modifyRuleUsing: fn (Unique $rule, Get $get) => $rule->where('user_id', $get('user_id')), @@ -79,7 +85,7 @@ public static function form(Form $form): Form ->helperText('You can always view your own presentations, but if they aren\'t published, then no one else can.'), Forms\Components\Textarea::make('description') ->helperText( - 'A short abstract of your presentation. ' + 'A short summary of your presentation. ' .'This will be only be seen when sharing via social media. ' .'Limit is 160 characters.' )->placeholder('i.e. In this talk by Abraham Lincoln, we explore yada yada...') @@ -103,10 +109,12 @@ function () { }; }, ]) - ->helperText( + ->helperText(new HtmlString( 'Image Size: 1200 x 630. This will be only be seen when sharing via social media. ' - .'If omitted, the default Simple Slides thumbnail will be used.' - ), + .'If omitted, the ' + .'default Simple Slides thumbnail ' + .'will be used.' + )), ]), ]), ]); diff --git a/app/Filament/Resources/PresentationResource/Pages/EditPresentation.php b/app/Filament/Resources/PresentationResource/Pages/EditPresentation.php index 7b1fbd2..984718b 100644 --- a/app/Filament/Resources/PresentationResource/Pages/EditPresentation.php +++ b/app/Filament/Resources/PresentationResource/Pages/EditPresentation.php @@ -9,6 +9,7 @@ use Filament\Resources\Pages\EditRecord; use Illuminate\Support\HtmlString; use Spatie\Browsershot\Browsershot; +use Webbingbrasil\FilamentCopyActions\Pages\Actions\CopyAction; class EditPresentation extends EditRecord { @@ -17,7 +18,15 @@ class EditPresentation extends EditRecord protected function getHeaderActions(): array { return [ + CopyAction::make('Copy Share URL') + ->label('Copy Share URL') + ->color('gray') + ->copyable(fn (Presentation $record) => route('presentations.show', [ + 'user' => $record->user->username, + 'slug' => $record->slug, + ])), Actions\Action::make('View') + ->color('gray') ->url(fn (Presentation $record): string => route('presentations.show', [ 'user' => $record->user->username, 'slug' => $record->slug, @@ -26,6 +35,7 @@ protected function getHeaderActions(): array ->openUrlInNewTab(), Actions\Action::make('Generate Thumbnail') ->icon('heroicon-o-camera') + ->color('info') ->requiresConfirmation() ->modalHeading('Generate a thumbnail of your first slide') ->modalIcon('heroicon-o-camera') @@ -70,6 +80,9 @@ protected function getHeaderActions(): array ->success() ->send(); }), + Actions\Action::make('save') + ->label('Save changes') + ->action('save'), Actions\DeleteAction::make(), Actions\ForceDeleteAction::make(), Actions\RestoreAction::make(), diff --git a/composer.json b/composer.json index 1349716..d592b7f 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,6 @@ "php": "^8.1", "filament/filament": "^3.2", "filament/spatie-laravel-media-library-plugin": "^3.2", - "spatie/laravel-medialibrary": "^11.4", "guzzlehttp/guzzle": "^7.2", "inertiajs/inertia-laravel": "^0.6.8", "jeffgreco13/filament-breezy": "^2.2", @@ -20,8 +19,10 @@ "laravel/tinker": "^2.8", "league/flysystem-aws-s3-v3": "^3.0", "spatie/browsershot": "^4.0", + "spatie/laravel-medialibrary": "^11.4", "spatie/laravel-sluggable": "^3.5", - "tightenco/ziggy": "^1.0" + "tightenco/ziggy": "^1.0", + "webbingbrasil/filament-copyactions": "^3.0" }, "require-dev": { "fakerphp/faker": "^1.9.1", diff --git a/composer.lock b/composer.lock index e76da14..e1b0128 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "c4f8bfc356f403efb1f45c91c25fc501", + "content-hash": "7d897be7433af42a869bbe7949a98b0f", "packages": [ { "name": "anourvalar/eloquent-serialize", @@ -8914,6 +8914,60 @@ ], "time": "2022-03-08T17:03:00+00:00" }, + { + "name": "webbingbrasil/filament-copyactions", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/webbingbrasil/filament-copyactions.git", + "reference": "363215d222de4127d81ea295c8a2163cd5c5a3f8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webbingbrasil/filament-copyactions/zipball/363215d222de4127d81ea295c8a2163cd5c5a3f8", + "reference": "363215d222de4127d81ea295c8a2163cd5c5a3f8", + "shasum": "" + }, + "require": { + "filament/filament": "^3.0", + "php": "^8.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Webbingbrasil\\FilamentCopyActions\\FilamentCopyActionsProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Webbingbrasil\\FilamentCopyActions\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Danilo Andrade", + "email": "danilo@webbingbrasil.com.br", + "role": "Developer" + } + ], + "description": "A easy-to-use copy actions for Filament Admin.", + "homepage": "https://github.com/webbingbrasil/filament-copyactions", + "keywords": [ + "filament", + "laravel" + ], + "support": { + "issues": "https://github.com/webbingbrasil/filament-copyactions/issues", + "source": "https://github.com/webbingbrasil/filament-copyactions/tree/3.0.0" + }, + "time": "2024-01-17T18:17:00+00:00" + }, { "name": "webmozart/assert", "version": "1.11.0", @@ -12601,5 +12655,5 @@ "php": "^8.1" }, "platform-dev": [], - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.6.0" }