-
-
Notifications
You must be signed in to change notification settings - Fork 15
feat:[LAR-34] Add filament tags crud in cpanel with feature test #203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
cybersoldattech
merged 16 commits into
develop
from
feature/lar-34-admin-filament-listing-des-tags
Nov 9, 2024
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
4453f98
feat:[LAR-34] Add filament tags crud in cpanel with feature test
cybersoldattech ead8285
feat: (LAR-20) add xp to dashboard user (#202)
StevyMarlino 43ce8d2
chore(deps): bump spatie/laravel-permission from 5.11.1 to 6.10.0 (#199)
dependabot[bot] 9abcbe4
chore(deps-dev): bump laravel-vite-plugin from 0.7.8 to 1.0.5 (#194)
dependabot[bot] c11e019
chore(deps-dev): bump postcss-loader from 6.2.1 to 8.1.1 (#195)
dependabot[bot] 7f02596
chore(deps-dev): bump @ryangjchandler/alpine-tooltip from 1.3.1 to 2.…
dependabot[bot] 3950138
feat: (LAR-107) modification du formulaire de register (#206)
Stephen2304 73892a7
feat:[LAR-33] Add filament channel crud in cpanel with feature test (…
cybersoldattech 2891914
chore(deps): bump symfony/mailgun-mailer from 6.4.13 to 7.1.6 (#198)
dependabot[bot] d993ba8
feat: [LAR-34] Remove blank space , add slive over and delete create …
cybersoldattech eddb78a
feat: [LAR-34] add unique condition to input name with message and re…
cybersoldattech f990652
chore :[LAR-34] remove space in TestFIle
cybersoldattech 94b9b48
chore(deps): bump actions/checkout from 3 to 4 (#190)
dependabot[bot] edf0449
fix: (LAR-21) resolve sharing article into twitter (#208)
StevyMarlino 89ac0e6
chore(deps): bump the php-dependencies group across 1 directory with …
dependabot[bot] d76617d
chore(deps-dev): bump prettier-plugin-tailwindcss
dependabot[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ | |
npm-debug.log | ||
yarn-error.log | ||
yarn.lock | ||
|
||
/vendor | ||
composer.phar | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Filament\Resources; | ||
|
||
use App\Filament\Resources\ChannelResource\Pages; | ||
use App\Models\Channel; | ||
use Filament\Forms; | ||
use Filament\Forms\Form; | ||
use Filament\Resources\Resource; | ||
use Filament\Support\Enums\MaxWidth; | ||
use Filament\Tables; | ||
use Filament\Tables\Actions\ActionGroup; | ||
use Filament\Tables\Table; | ||
use Illuminate\Database\Eloquent\Builder; | ||
use Illuminate\Support\Str; | ||
|
||
final class ChannelResource extends Resource | ||
{ | ||
protected static ?string $model = Channel::class; | ||
|
||
protected static ?string $navigationIcon = 'heroicon-o-queue-list'; | ||
|
||
public static function getLabel(): string | ||
{ | ||
return __('Channels'); | ||
} | ||
|
||
public static function form(Form $form): Form | ||
{ | ||
return $form | ||
->schema([ | ||
Forms\Components\Section::make() | ||
->schema([ | ||
Forms\Components\TextInput::make('name') | ||
->required() | ||
->live(onBlur: true) | ||
->afterStateUpdated(function (string $operation, $state, Forms\Set $set): void { | ||
$set('slug', Str::slug($state)); | ||
}), | ||
Forms\Components\TextInput::make('slug') | ||
->readOnly() | ||
->helperText(__('Cette valeur est générée dynamiquement en fonction du Name.')), | ||
Forms\Components\Select::make('parent_id') | ||
->relationship('parent', 'name', fn (Builder $query) => $query->whereNull('parent_id')) | ||
->default(null), | ||
Forms\Components\TextInput::make('color') | ||
->maxLength(255) | ||
->type('color'), | ||
Forms\Components\Textarea::make('description.fr') | ||
->label('Description') | ||
->columnSpanFull(), | ||
]) | ||
->columnSpan(['lg' => 2]), | ||
]); | ||
} | ||
|
||
public static function table(Table $table): Table | ||
{ | ||
return $table | ||
->columns([ | ||
Tables\Columns\TextColumn::make('name') | ||
->searchable(), | ||
Tables\Columns\TextColumn::make('slug') | ||
->searchable(), | ||
Tables\Columns\TextColumn::make('parent.name') | ||
->numeric() | ||
->sortable(), | ||
Tables\Columns\TextColumn::make('thread_number') | ||
->label('Nombre de thead') | ||
->getStateUsing(fn ($record) => $record->threads()->count()), | ||
Tables\Columns\TextColumn::make('color') | ||
->searchable(), | ||
Tables\Columns\TextColumn::make('created_at') | ||
->dateTime() | ||
->sortable() | ||
->toggleable(isToggledHiddenByDefault: true), | ||
]) | ||
->filters([ | ||
|
||
]) | ||
->actions([ | ||
ActionGroup::make([ | ||
Tables\Actions\DeleteAction::make(), | ||
Tables\Actions\EditAction::make() | ||
->slideOver() | ||
->modalWidth(MaxWidth::Large), | ||
]), | ||
]) | ||
->bulkActions([ | ||
Tables\Actions\BulkActionGroup::make([ | ||
Tables\Actions\DeleteBulkAction::make(), | ||
]), | ||
]); | ||
} | ||
|
||
public static function getPages(): array | ||
{ | ||
return [ | ||
'index' => Pages\ListChannels::route('/'), | ||
]; | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
app/Filament/Resources/ChannelResource/Pages/ListChannels.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Filament\Resources\ChannelResource\Pages; | ||
|
||
use App\Filament\Resources\ChannelResource; | ||
use Filament\Actions; | ||
use Filament\Resources\Pages\ListRecords; | ||
use Filament\Support\Enums\MaxWidth; | ||
|
||
final class ListChannels extends ListRecords | ||
{ | ||
protected static string $resource = ChannelResource::class; | ||
|
||
protected function getHeaderActions(): array | ||
{ | ||
return [ | ||
Actions\CreateAction::make() | ||
->slideOver() | ||
->modalWidth(MaxWidth::Large), | ||
]; | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Filament\Resources; | ||
|
||
use App\Filament\Resources\TagResource\Pages; | ||
use App\Models\Tag; | ||
use Filament\Forms; | ||
use Filament\Forms\Components\Select; | ||
use Filament\Forms\Form; | ||
use Filament\Resources\Resource; | ||
use Filament\Support\Enums\MaxWidth; | ||
use Filament\Tables; | ||
use Filament\Tables\Table; | ||
use Illuminate\Support\Str; | ||
|
||
final class TagResource extends Resource | ||
{ | ||
protected static ?string $model = Tag::class; | ||
|
||
protected static ?string $navigationIcon = 'heroicon-o-tag'; | ||
|
||
public static function form(Form $form): Form | ||
{ | ||
return $form | ||
->schema([ | ||
Forms\Components\TextInput::make('name') | ||
->live(onBlur: true) | ||
->required() | ||
->unique() | ||
->validationMessages([ | ||
'unique' => 'Cette valeur existe déjà', | ||
]) | ||
->afterStateUpdated(function (string $operation, $state, Forms\Set $set): void { | ||
$set('slug', Str::slug($state)); | ||
}) | ||
->columnSpanFull(), | ||
Forms\Components\TextInput::make('slug') | ||
->readOnly() | ||
->required() | ||
->helperText(__('Cette valeur est générée dynamiquement en fonction du Name.')) | ||
->columnSpanFull(), | ||
Select::make('concerns') | ||
->multiple() | ||
->options([ | ||
'post' => 'Post', | ||
cybersoldattech marked this conversation as resolved.
Show resolved
Hide resolved
|
||
'tutorial' => 'Tutoriel', | ||
'discussion' => 'Discussion', | ||
]) | ||
->required() | ||
->columnSpanFull(), | ||
Forms\Components\Textarea::make('description') | ||
->columnSpanFull(), | ||
]); | ||
} | ||
|
||
public static function table(Table $table): Table | ||
{ | ||
return $table | ||
->columns([ | ||
Tables\Columns\TextColumn::make('name') | ||
->searchable(), | ||
Tables\Columns\TextColumn::make('slug') | ||
->searchable(), | ||
Tables\Columns\TextColumn::make(name: 'concerns'), | ||
]) | ||
->filters([ | ||
// | ||
]) | ||
->actions([ | ||
\Filament\Tables\Actions\ActionGroup::make([ | ||
Tables\Actions\DeleteAction::make(), | ||
Tables\Actions\EditAction::make() | ||
cybersoldattech marked this conversation as resolved.
Show resolved
Hide resolved
|
||
->slideOver() | ||
->modalWidth(MaxWidth::Large), | ||
]), | ||
]) | ||
->bulkActions([ | ||
Tables\Actions\BulkActionGroup::make([ | ||
Tables\Actions\DeleteBulkAction::make(), | ||
]), | ||
]); | ||
} | ||
|
||
public static function getPages(): array | ||
{ | ||
return [ | ||
'index' => Pages\ListTags::route('/'), | ||
]; | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Filament\Resources\TagResource\Pages; | ||
|
||
use App\Filament\Resources\TagResource; | ||
use Filament\Actions; | ||
use Filament\Resources\Pages\ListRecords; | ||
use Filament\Support\Enums\MaxWidth; | ||
|
||
final class ListTags extends ListRecords | ||
{ | ||
protected static string $resource = TagResource::class; | ||
|
||
protected function getHeaderActions(): array | ||
{ | ||
return [ | ||
Actions\CreateAction::make() | ||
->slideOver() | ||
->modalWidth(MaxWidth::Large), | ||
]; | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.