diff --git a/app/Filament/Resources/ChannelResource.php b/app/Filament/Resources/ChannelResource.php new file mode 100644 index 00000000..8cf56117 --- /dev/null +++ b/app/Filament/Resources/ChannelResource.php @@ -0,0 +1,104 @@ +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('/'), + ]; + } +} diff --git a/app/Filament/Resources/ChannelResource/Pages/ListChannels.php b/app/Filament/Resources/ChannelResource/Pages/ListChannels.php new file mode 100644 index 00000000..077d704b --- /dev/null +++ b/app/Filament/Resources/ChannelResource/Pages/ListChannels.php @@ -0,0 +1,24 @@ +slideOver() + ->modalWidth(MaxWidth::Large), + ]; + } +} diff --git a/composer.json b/composer.json index e984ef41..9fa5592a 100644 --- a/composer.json +++ b/composer.json @@ -41,7 +41,7 @@ "spatie/laravel-feed": "^4.2.1", "spatie/laravel-google-fonts": "^1.2.3", "spatie/laravel-medialibrary": "^10.10.0", - "spatie/laravel-permission": "^5.10.1", + "spatie/laravel-permission": "^6.10.0", "spatie/laravel-sitemap": "^7.2.1", "spatie/laravel-translatable": "^6.8", "stevebauman/location": "^6.6.2", diff --git a/composer.lock b/composer.lock index ebba4005..6bc164b4 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": "676bfee6284c52a07b36c680e3d569d5", + "content-hash": "d98f3b5e6ff77c53df36fc4ed451bf4c", "packages": [ { "name": "abraham/twitteroauth", @@ -10575,35 +10575,36 @@ }, { "name": "spatie/laravel-permission", - "version": "5.11.1", + "version": "6.10.0", "source": { "type": "git", "url": "https://github.com/spatie/laravel-permission.git", - "reference": "7090824cca57e693b880ce3aaf7ef78362e28bbd" + "reference": "2444bb914a52c570c00ae8c94e096a58e01b2317" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/laravel-permission/zipball/7090824cca57e693b880ce3aaf7ef78362e28bbd", - "reference": "7090824cca57e693b880ce3aaf7ef78362e28bbd", + "url": "https://api.github.com/repos/spatie/laravel-permission/zipball/2444bb914a52c570c00ae8c94e096a58e01b2317", + "reference": "2444bb914a52c570c00ae8c94e096a58e01b2317", "shasum": "" }, "require": { - "illuminate/auth": "^7.0|^8.0|^9.0|^10.0", - "illuminate/container": "^7.0|^8.0|^9.0|^10.0", - "illuminate/contracts": "^7.0|^8.0|^9.0|^10.0", - "illuminate/database": "^7.0|^8.0|^9.0|^10.0", - "php": "^7.3|^8.0" + "illuminate/auth": "^8.12|^9.0|^10.0|^11.0", + "illuminate/container": "^8.12|^9.0|^10.0|^11.0", + "illuminate/contracts": "^8.12|^9.0|^10.0|^11.0", + "illuminate/database": "^8.12|^9.0|^10.0|^11.0", + "php": "^8.0" }, "require-dev": { - "orchestra/testbench": "^5.0|^6.0|^7.0|^8.0", - "phpunit/phpunit": "^9.4", - "predis/predis": "^1.1" + "larastan/larastan": "^1.0|^2.0", + "laravel/passport": "^11.0|^12.0", + "orchestra/testbench": "^6.23|^7.0|^8.0|^9.0", + "phpunit/phpunit": "^9.4|^10.1" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "5.x-dev", - "dev-master": "5.x-dev" + "dev-main": "6.x-dev", + "dev-master": "6.x-dev" }, "laravel": { "providers": [ @@ -10631,7 +10632,7 @@ "role": "Developer" } ], - "description": "Permission handling for Laravel 6.0 and up", + "description": "Permission handling for Laravel 8.0 and up", "homepage": "https://github.com/spatie/laravel-permission", "keywords": [ "acl", @@ -10645,7 +10646,7 @@ ], "support": { "issues": "https://github.com/spatie/laravel-permission/issues", - "source": "https://github.com/spatie/laravel-permission/tree/5.11.1" + "source": "https://github.com/spatie/laravel-permission/tree/6.10.0" }, "funding": [ { @@ -10653,7 +10654,7 @@ "type": "github" } ], - "time": "2023-10-25T05:12:01+00:00" + "time": "2024-11-05T17:30:49+00:00" }, { "name": "spatie/laravel-sitemap", diff --git a/package.json b/package.json index 444a7db3..8a9cb2ad 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "devDependencies": { "@alpinejs/intersect": "^3.6.1", "@awcodes/alpine-floating-ui": "^3.5.0", - "@ryangjchandler/alpine-tooltip": "^1.2.0", + "@ryangjchandler/alpine-tooltip": "^2.0.1", "@tailwindcss/aspect-ratio": "^0.4.2", "@tailwindcss/forms": "^0.5.7", "@tailwindcss/typography": "^0.5.10", @@ -17,10 +17,10 @@ "autoprefixer": "^10.4.16", "highlight.js": "^11.7.0", "intl-tel-input": "^17.0.13", - "laravel-vite-plugin": "^0.7.8", + "laravel-vite-plugin": "^1.0.5", "lodash": "^4.17.19", "postcss": "^8.4.32", - "postcss-loader": "^6.2.1", + "postcss-loader": "^8.1.1", "postcss-preset-env": "^7.0.1", "prettier": "^3.2.5", "prettier-plugin-tailwindcss": "^0.5.14", diff --git a/resources/views/components/user/stats.blade.php b/resources/views/components/user/stats.blade.php index 898b784f..c963e792 100644 --- a/resources/views/components/user/stats.blade.php +++ b/resources/views/components/user/stats.blade.php @@ -44,7 +44,7 @@ {{ __('pages/account.dashboard.stats.experience') }}