diff --git a/app/Casts/Ip.php b/app/Casts/Ip.php new file mode 100644 index 0000000..bef7629 --- /dev/null +++ b/app/Casts/Ip.php @@ -0,0 +1,61 @@ + $attributes + * @return \TGet|null + * @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInImplementedInterfaceBeforeLastUsed + * @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInImplementedInterfaceAfterLastUsed + */ + public function get(Model $model, string $key, mixed $value, array $attributes) + { + // phpcs:enable + return \IPLib\Factory::parseAddressString($value); + } + + /** + * Transform the attribute to its underlying model values. + * + * @param \Illuminate\Database\Eloquent\Model $model + * @param string $key + * @param \TSet|null $value + * @param array $attributes + * @return mixed + * @throws \RuntimeException If value is not or instance of \IPLib\Address\AddressInterface. + * @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInImplementedInterfaceAfterLastUsed + * @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInImplementedInterfaceBeforeLastUsed + */ + public function set(Model $model, string $key, mixed $value, array $attributes) + { + // phpcs:enable + if (is_null($value)) { + return null; + } + if (is_string($value)) { + $value = \IPLib\Factory::parseAddressString($value); + } + if (!is_object($value) or !($value instanceof \IPLib\Address\AddressInterface)) { + throw new \RuntimeException( + "{$key} has to be instance of " . + \IPLib\Address\AddressInterface::class + ); + } + $value->getAddressType(); + return $value; + } +} diff --git a/app/Http/Controllers/Bo/BannedIpController.php b/app/Http/Controllers/Bo/BannedIpController.php index 864dfff..64ee68b 100644 --- a/app/Http/Controllers/Bo/BannedIpController.php +++ b/app/Http/Controllers/Bo/BannedIpController.php @@ -47,13 +47,13 @@ class BannedIpController extends Controller /** * Show the form for creating a new resource. * - * @param \App\Models\BannedIp $bannedip + * @param \App\Models\BannedIp $banned_ip * @return \Illuminate\Contracts\View\View */ - public function create(BannedIp $bannedip): \Illuminate\Contracts\View\View + public function create(BannedIp $banned_ip): \Illuminate\Contracts\View\View { return view('back::pages.banned-ips.create', [ - 'bannedipModel' => $bannedip, + 'bannedipModel' => $banned_ip, ]); } @@ -66,21 +66,21 @@ class BannedIpController extends Controller public function store(StoreBannedIpRequest $request): \Illuminate\Http\RedirectResponse { return DB::transaction(function () use ($request) { - $bannedip = new BannedIp(); - $bannedip->fill($request->validated()); - if ($bannedip->saveOrFail()) { + $banned_ip = new BannedIp(); + $banned_ip->fill($request->validated()); + if ($banned_ip->saveOrFail()) { return redirect() - ->route('bo.bannedips.edit', $bannedip) + ->route('bo.banned_ips.edit', $banned_ip) ->with('success', trans( 'crud.messages.has_been_created', - ['model' => Str::singular(trans('models.classes.bannedips'))] + ['model' => Str::singular(trans('models.classes.banned_ips'))] )); } return redirect() ->back() ->with('error', trans( 'crud.messages.cannot_be_created', - ['model' => Str::singular(trans('models.classes.bannedips'))] + ['model' => Str::singular(trans('models.classes.banned_ips'))] )); }); } @@ -88,13 +88,13 @@ class BannedIpController extends Controller /** * Show the form for editing the specified resource. * - * @param \App\Models\BannedIp $bannedip + * @param \App\Models\BannedIp $banned_ip * @return \Illuminate\Contracts\View\View */ - public function edit(BannedIp $bannedip): \Illuminate\Contracts\View\View + public function edit(BannedIp $banned_ip): \Illuminate\Contracts\View\View { return view('back::pages.banned-ips.edit', [ - 'bannedipModel' => $bannedip, + 'bannedipModel' => $banned_ip, ]); } @@ -102,26 +102,26 @@ class BannedIpController extends Controller * Update the specified resource in storage. * * @param \App\Http\Requests\Bo\BannedIps\UpdateBannedIpRequest $request - * @param \App\Models\BannedIp $bannedip + * @param \App\Models\BannedIp $banned_ip * @return \Illuminate\Http\RedirectResponse */ - public function update(UpdateBannedIpRequest $request, BannedIp $bannedip): \Illuminate\Http\RedirectResponse + public function update(UpdateBannedIpRequest $request, BannedIp $banned_ip): \Illuminate\Http\RedirectResponse { - return DB::transaction(function () use ($request, $bannedip) { - $bannedip->fill($request->validated()); - if ($bannedip->saveOrFail()) { + return DB::transaction(function () use ($request, $banned_ip) { + $banned_ip->fill($request->validated()); + if ($banned_ip->saveOrFail()) { return redirect() - ->route('bo.bannedips.edit', $bannedip) + ->route('bo.banned_ips.edit', $banned_ip) ->with('success', trans( 'crud.messages.has_been_updated', - ['model' => Str::singular(trans('models.classes.bannedips'))] + ['model' => Str::singular(trans('models.classes.banned_ips'))] )); } return redirect() ->back() ->with('error', trans( 'crud.messages.cannot_be_updated', - ['model' => Str::singular(trans('models.classes.bannedips'))] + ['model' => Str::singular(trans('models.classes.banned_ips'))] )); }); } @@ -129,25 +129,25 @@ class BannedIpController extends Controller /** * Remove the specified resource from storage. * - * @param \App\Models\BannedIp $bannedip + * @param \App\Models\BannedIp $banned_ip * @return \Illuminate\Http\RedirectResponse */ - public function destroy(BannedIp $bannedip): \Illuminate\Http\RedirectResponse + public function destroy(BannedIp $banned_ip): \Illuminate\Http\RedirectResponse { - return DB::transaction(function () use ($bannedip) { - if ($bannedip->deleteOrFail()) { + return DB::transaction(function () use ($banned_ip) { + if ($banned_ip->deleteOrFail()) { return redirect() - ->route('bo.bannedips.index') + ->route('bo.banned_ips.index') ->with('success', __( 'crud.messages.has_been_deleted', - ['model' => Str::singular(trans('models.classes.bannedips'))] + ['model' => Str::singular(trans('models.classes.banned_ips'))] )); } return redirect() ->back() ->with('error', __( ':crud.messages.cannot_be_deleted', - ['model' => Str::singular(trans('models.classes.bannedips'))] + ['model' => Str::singular(trans('models.classes.banned_ips'))] )); }); } diff --git a/app/Http/Controllers/Bo/PrizeController.php b/app/Http/Controllers/Bo/PrizeController.php index 2320f53..47d4544 100644 --- a/app/Http/Controllers/Bo/PrizeController.php +++ b/app/Http/Controllers/Bo/PrizeController.php @@ -5,7 +5,6 @@ namespace App\Http\Controllers\Bo; use App\Http\Controllers\Controller; use App\Http\Requests\Bo\Prizes\StorePrizeRequest; use App\Http\Requests\Bo\Prizes\UpdatePrizeRequest; -use App\Models\GainView; use App\Models\Prize; use Illuminate\Http\Request; use Illuminate\Support\Facades\DB; @@ -58,10 +57,8 @@ class PrizeController extends Controller */ public function create(Prize $prize): \Illuminate\Contracts\View\View { - $gainViewModels = GainView::all(); return view('back::pages.prizes.create', [ - 'prizeModel' => $prize, - 'gainViewModels' => $gainViewModels + 'prizeModel' => $prize ]); } @@ -101,10 +98,8 @@ class PrizeController extends Controller */ public function edit(Prize $prize): \Illuminate\Contracts\View\View { - $gainViewModels = GainView::all(); return view('back::pages.prizes.edit', [ - 'prizeModel' => $prize, - 'gainViewModels' => $gainViewModels + 'prizeModel' => $prize ]); } diff --git a/app/Http/Controllers/Fo/EnterCodeController.php b/app/Http/Controllers/Fo/EnterCodeController.php index 3b3c664..203c5f6 100644 --- a/app/Http/Controllers/Fo/EnterCodeController.php +++ b/app/Http/Controllers/Fo/EnterCodeController.php @@ -63,8 +63,7 @@ class EnterCodeController extends Controller $settings = app(Settings::class); // * Cas IP bannie. - $ipBanned = BannedIp::where('ip', app('clientIp'))->first() === null ? 0 : 1; - if ($ipBanned) { + if (BannedIp::query()->where('ip', app('clientIp'))->exists()) { return view('theme::participation-exhausted', compact('settings')); } diff --git a/app/Http/Requests/Bo/BannedIps/StoreBannedIpRequest.php b/app/Http/Requests/Bo/BannedIps/StoreBannedIpRequest.php index 85c526e..e374709 100644 --- a/app/Http/Requests/Bo/BannedIps/StoreBannedIpRequest.php +++ b/app/Http/Requests/Bo/BannedIps/StoreBannedIpRequest.php @@ -24,11 +24,7 @@ class StoreBannedIpRequest extends FormRequest public function rules() { return [ - 'ip' => [ - 'required', - 'string', - 'regex:/^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)\.?\b){4}$/' - ], + 'ip' => 'required|ip|unique:banned_ips,ip', ]; } diff --git a/app/Http/Requests/Bo/BannedIps/UpdateBannedIpRequest.php b/app/Http/Requests/Bo/BannedIps/UpdateBannedIpRequest.php index e3cdf55..a9cf2b6 100644 --- a/app/Http/Requests/Bo/BannedIps/UpdateBannedIpRequest.php +++ b/app/Http/Requests/Bo/BannedIps/UpdateBannedIpRequest.php @@ -2,6 +2,23 @@ namespace App\Http\Requests\Bo\BannedIps; +use Illuminate\Validation\Rule; + class UpdateBannedIpRequest extends StoreBannedIpRequest { + /** + * Get the validation rules that apply to the request. + * + * @return array + */ + public function rules() + { + return [ + 'ip' => [ + 'required', 'ip', + Rule::unique('banned_ips', 'ip') + ->ignore($this->route('banned_ip')->ip, 'ip') + ], + ]; + } } diff --git a/app/Models/BannedIp.php b/app/Models/BannedIp.php index 7bf6e05..20ac5d3 100644 --- a/app/Models/BannedIp.php +++ b/app/Models/BannedIp.php @@ -2,6 +2,8 @@ namespace App\Models; +use App\Casts\Ip; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; /** @@ -11,6 +13,15 @@ use Illuminate\Database\Eloquent\Model; */ class BannedIp extends Model { + use HasFactory; + + /** + * Indicates if the model should be timestamped. + * + * @var boolean + */ + public $timestamps = false; + /** * The attributes that are mass assignable. * @@ -19,9 +30,11 @@ class BannedIp extends Model protected $fillable = ['ip']; /** - * Indicates if the model should be timestamped. + * The attributes that should be cast. * - * @var boolean + * @var array */ - public $timestamps = false; + protected $casts = [ + 'ip' => Ip::class + ]; } diff --git a/app/Models/GainView.php b/app/Models/GainView.php deleted file mode 100644 index 31e5fae..0000000 --- a/app/Models/GainView.php +++ /dev/null @@ -1,39 +0,0 @@ -hasMany(Prize::class, 'gain_view_id'); - } -} diff --git a/app/Models/Prize.php b/app/Models/Prize.php index c432264..93ab604 100644 --- a/app/Models/Prize.php +++ b/app/Models/Prize.php @@ -24,7 +24,6 @@ use Illuminate\Database\Eloquent\Model; * @method protected static function booted() The "booted" method of the model. * @method private static function manageFields($model) Manage model fields. * - * @property-read \App\Models\GainView[] $gainView Associated gainViews. * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\InstantWin[] $instantWins * Associated instantWins. */ @@ -45,8 +44,7 @@ class Prize extends Model 'arg_content', 'quantity', 'pdf_winning_proof', - 'need_proof', - 'gain_view_id', + 'need_proof' ]; /** @@ -88,16 +86,6 @@ class Prize extends Model $model->pdf_winning_proof = FileStorageHelper::storeFile($model, $model->pdf_winning_proof, true); } - /** - * BelongsTo GainView relation - * - * @return \Illuminate\Database\Eloquent\Relations\BelongsTo - */ - public function gainView() - { - return $this->belongsTo(GainView::class, 'gain_view_id'); - } - /** * HasMany InstantWin relation * diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 8bfc071..020d23a 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -36,10 +36,12 @@ class AppServiceProvider extends ServiceProvider // * HA PROXY FIX. App::singleton('clientIp', function () { if (config('app.env') === 'local') { - return request()->getClientIp(); + return \IPLib\Factory::parseAddressString(request()->getClientIp()); } else { - return request()->server('HTTP_X_FORWARDED_FOR') ?? - request()->getClientIp(); + return \IPLib\Factory::parseAddressString( + request()->server('HTTP_X_FORWARDED_FOR') ?? + request()->getClientIp() + ); } }); diff --git a/composer.json b/composer.json index 33fe0cb..39cf02c 100644 --- a/composer.json +++ b/composer.json @@ -22,6 +22,7 @@ "laravel/ui": "^4.2", "ldc/ldccrmv2client": "^3.0", "mews/purifier": "^3.4", + "mlocati/ip-lib": "^1.18", "propaganistas/laravel-phone": "^5.0", "sentry/sentry-laravel": "*" }, diff --git a/composer.lock b/composer.lock index 110525f..610bc29 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": "b0a748e0c61e125e557fc6fc650b511f", + "content-hash": "5abaeeb6a418b44840fbe2581492f5d8", "packages": [ { "name": "axlon/laravel-postal-code-validation", @@ -2487,6 +2487,77 @@ }, "time": "2023-03-14T08:28:28+00:00" }, + { + "name": "mlocati/ip-lib", + "version": "1.18.0", + "source": { + "type": "git", + "url": "https://github.com/mlocati/ip-lib.git", + "reference": "c77bd0b1f3e3956c7e9661e75cb1f54ed67d95d2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mlocati/ip-lib/zipball/c77bd0b1f3e3956c7e9661e75cb1f54ed67d95d2", + "reference": "c77bd0b1f3e3956c7e9661e75cb1f54ed67d95d2", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "ext-pdo_sqlite": "*", + "phpunit/phpunit": "^4.8 || ^5.7 || ^6.5 || ^7.5 || ^8.5 || ^9.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "IPLib\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michele Locati", + "email": "mlocati@gmail.com", + "homepage": "https://github.com/mlocati", + "role": "Author" + } + ], + "description": "Handle IPv4, IPv6 addresses and ranges", + "homepage": "https://github.com/mlocati/ip-lib", + "keywords": [ + "IP", + "address", + "addresses", + "ipv4", + "ipv6", + "manage", + "managing", + "matching", + "network", + "networking", + "range", + "subnet" + ], + "support": { + "issues": "https://github.com/mlocati/ip-lib/issues", + "source": "https://github.com/mlocati/ip-lib/tree/1.18.0" + }, + "funding": [ + { + "url": "https://github.com/sponsors/mlocati", + "type": "github" + }, + { + "url": "https://paypal.me/mlocati", + "type": "other" + } + ], + "time": "2022-01-13T18:05:33+00:00" + }, { "name": "monolog/monolog", "version": "3.5.0", diff --git a/database/factories/BannedIpFactory.php b/database/factories/BannedIpFactory.php new file mode 100644 index 0000000..06d80c0 --- /dev/null +++ b/database/factories/BannedIpFactory.php @@ -0,0 +1,23 @@ + + */ +class BannedIpFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'ip' => \IPLib\Factory::parseAddressString(fake()->boolean() ? fake()->ipv6() : fake()->ipv4()) + ]; + } +} diff --git a/database/migrations/2020_10_23_094235_create_banned_ips.php b/database/migrations/2020_10_23_094235_create_banned_ips.php index 152e2aa..935293a 100644 --- a/database/migrations/2020_10_23_094235_create_banned_ips.php +++ b/database/migrations/2020_10_23_094235_create_banned_ips.php @@ -15,8 +15,8 @@ class CreateBannedIps extends Migration { Schema::create('banned_ips', function (Blueprint $table) { $table->id(); - $table->string('ip'); - $table->unique('ip'); + $table->string('ip', 50)->unique()->comment('IPv4 ou IPv6 Bannie (textual representation)'); + $table->string('raison')->nullable()->comment('Raison du ban ?'); }); } diff --git a/database/migrations/2020_10_29_091811_create_prizes.php b/database/migrations/2020_10_29_091811_create_prizes.php index 35bf721..3f350d8 100644 --- a/database/migrations/2020_10_29_091811_create_prizes.php +++ b/database/migrations/2020_10_29_091811_create_prizes.php @@ -23,7 +23,6 @@ class CreatePrizes extends Migration $table->integer("quantity"); $table->string("pdf_winning_proof")->nullable(); $table->boolean("need_proof")->default(false); - $table->foreignId("gain_view_id")->constrained("gain_views"); $table->timestamps(); }); } diff --git a/database/migrations/2023_10_19_094711_create_static_pages.php b/database/migrations/2023_10_19_094711_create_static_pages.php index a28d0c0..65f5146 100644 --- a/database/migrations/2023_10_19_094711_create_static_pages.php +++ b/database/migrations/2023_10_19_094711_create_static_pages.php @@ -1,5 +1,6 @@ timestamps(); }); Artisan::call('db:seed', [ - 'class' => 'StaticPageSeeder' + 'class' => StaticPageSeeder::class ]); } diff --git a/database/seeders/Development/BannedIpSeeder.php b/database/seeders/Development/BannedIpSeeder.php new file mode 100644 index 0000000..b9ada1c --- /dev/null +++ b/database/seeders/Development/BannedIpSeeder.php @@ -0,0 +1,24 @@ +truncate(); + BannedIp::factory(fake()->numberBetween(15, 45))->create(); + } +} diff --git a/database/seeders/Development/PrizeSeeder.php b/database/seeders/Development/PrizeSeeder.php index f2bea82..bd7f1bc 100644 --- a/database/seeders/Development/PrizeSeeder.php +++ b/database/seeders/Development/PrizeSeeder.php @@ -2,7 +2,6 @@ namespace Database\Seeders\Development; -use App\Models\GainView; use App\Models\Prize; use Illuminate\Database\Seeder; use Illuminate\Support\Facades\DB; @@ -19,17 +18,11 @@ class PrizeSeeder extends Seeder public function run() { Schema::disableForeignKeyConstraints(); - DB::table('gain_views')->truncate(); DB::table('prizes')->truncate(); Schema::enableForeignKeyConstraints(); File::deleteDirectory(\storage_path('app/public/modelfiles/prizes')); - $gainview = new GainView(); - $gainview->name = "page_lot1"; - $gainview->file_name = "gain1"; - $gainview->save(); - $prize = new Prize(); $prize->label_one = 'Lot 1'; $prize->label_many = 'Lots 1'; @@ -37,14 +30,8 @@ class PrizeSeeder extends Seeder $prize->arg_subtitle = 'Sous-titre Lot 1'; $prize->arg_content = 'Argumentaire du lot 1'; $prize->quantity = 1; - $prize->gain_view_id = $gainview->id; $prize->save(); - $gainview = new GainView(); - $gainview->name = "page_lot2"; - $gainview->file_name = "gain2"; - $gainview->save(); - $prize = new Prize(); $prize->label_one = 'Lot 2'; $prize->label_many = 'Lots 2'; @@ -52,7 +39,6 @@ class PrizeSeeder extends Seeder $prize->arg_subtitle = 'Sous-titre Lot 2'; $prize->arg_content = 'Argumentaire du lot 2'; $prize->quantity = 2; - $prize->gain_view_id = $gainview->id; $prize->save(); } } diff --git a/database/seeders/DevelopmentSeeder.php b/database/seeders/DevelopmentSeeder.php index 2757485..faaf20e 100644 --- a/database/seeders/DevelopmentSeeder.php +++ b/database/seeders/DevelopmentSeeder.php @@ -2,6 +2,7 @@ namespace Database\Seeders; +use Database\Seeders\Development\BannedIpSeeder; use Database\Seeders\Development\PrizeSeeder; use Database\Seeders\Development\ProductSeeder; use Database\Seeders\Development\QuestionSeeder; @@ -18,6 +19,7 @@ class DevelopmentSeeder extends Seeder { // * Developpement Seeders $this->call([ + BannedIpSeeder::class, ProductSeeder::class, QuestionSeeder::class, PrizeSeeder::class diff --git a/resources/lang/fr/models.php b/resources/lang/fr/models.php index 9ef2eea..0a409c0 100644 --- a/resources/lang/fr/models.php +++ b/resources/lang/fr/models.php @@ -5,7 +5,7 @@ return [ 'user' => 'utilisateur', 'activity_log' => 'journal d\'activité|journaux d\'activité', 'static_page' => 'page statique|pages statiques', - 'bannedips' => 'IP bannies', + 'banned_ips' => 'IP bannies', 'faq-questions' => 'Question pour la FAQ|Questions pour la FAQ', 'faq-themes' => 'Thème pour la FAQ|Thèmes pour la FAQ', 'prizes' => 'Lot', diff --git a/resources/views/layouts/nav-list.blade.php b/resources/views/layouts/nav-list.blade.php index 37b928b..ab012d3 100644 --- a/resources/views/layouts/nav-list.blade.php +++ b/resources/views/layouts/nav-list.blade.php @@ -11,7 +11,7 @@
  • - {{ __('IP Bannies') }} + {{ __('IP Bannies') }}
  • $bannedipModel]) -@section('title', __('Création d\'une :model', ['model' => Str::singular(__('models.classes.bannedips'))])) -@section('description', __('Création d\'une toute nouvelle :model', ['model' => Str::singular(__('models.classes.bannedips'))])) +@section('title', __('Création d\'une :model', ['model' => Str::singular(__('models.classes.banned_ips'))])) +@section('description', __('Création d\'une toute nouvelle :model', ['model' => Str::singular(__('models.classes.banned_ips'))])) @section('breadcrumb', request()->route()->getName()) @@ -9,25 +9,25 @@
    -
    + @csrf @include('back::pages.banned-ips.form-inputs')
    diff --git a/resources/views/pages/banned-ips/edit.blade.php b/resources/views/pages/banned-ips/edit.blade.php index d126441..ce09e35 100644 --- a/resources/views/pages/banned-ips/edit.blade.php +++ b/resources/views/pages/banned-ips/edit.blade.php @@ -1,7 +1,7 @@ @extends('back::layout', ['brParam' => $bannedipModel]) -@section('title', __('Édition d\'une :model', ['model' => Str::singular(__('models.classes.bannedips'))])) -@section('description', __('Édition d\'une :model déjà existante', ['model' => Str::singular(__('models.classes.bannedips'))])) +@section('title', __('Édition d\'une :model', ['model' => Str::singular(__('models.classes.banned_ips'))])) +@section('description', __('Édition d\'une :model déjà existante', ['model' => Str::singular(__('models.classes.banned_ips'))])) @section('breadcrumb', request()->route()->getName()) @@ -9,36 +9,36 @@
    - + @csrf @method('DELETE')
    -
    + @csrf @method('PUT') @include('back::pages.banned-ips.form-inputs')
    diff --git a/resources/views/pages/banned-ips/index.blade.php b/resources/views/pages/banned-ips/index.blade.php index 30f6ed7..6781c90 100644 --- a/resources/views/pages/banned-ips/index.blade.php +++ b/resources/views/pages/banned-ips/index.blade.php @@ -1,13 +1,13 @@ @extends('back::layout') -@section('title', __('models.classes.bannedips')) -@section('description', __('Liste de toutes les :model', ['model' => __('models.classes.bannedips')])) +@section('title', __('models.classes.banned_ips')) +@section('description', __('Liste de toutes les :model', ['model' => __('models.classes.banned_ips')])) @section('content')
    @include('modules.breadcrumbs.breadcrumb-body') - +
    @@ -26,10 +26,10 @@ {{ $bannedipModel->ip }} - @@ -47,9 +47,9 @@ @else - {{ __('crud.other.no_model_found', ['model' => Str::singular(__('models.classes.bannedips'))]) }} + {{ __('crud.other.no_model_found', ['model' => Str::singular(__('models.classes.banned_ips'))]) }} @endif - {!! $bannedipModels->links() !!} + {{ $bannedipModels->links() }} @endsection diff --git a/resources/views/pages/faq-questions/index.blade.php b/resources/views/pages/faq-questions/index.blade.php index 9633488..288ff8b 100644 --- a/resources/views/pages/faq-questions/index.blade.php +++ b/resources/views/pages/faq-questions/index.blade.php @@ -54,5 +54,5 @@ @endif - {!! $faqQuestionModels->links() !!} + {{ $faqQuestionModels->links() }} @endsection diff --git a/resources/views/pages/faq-themes/index.blade.php b/resources/views/pages/faq-themes/index.blade.php index 9ea841b..6c18652 100644 --- a/resources/views/pages/faq-themes/index.blade.php +++ b/resources/views/pages/faq-themes/index.blade.php @@ -50,5 +50,5 @@ @endif - {!! $faqThemeModels->links() !!} + {{ $faqThemeModels->links() }} @endsection diff --git a/resources/views/pages/prizes/index.blade.php b/resources/views/pages/prizes/index.blade.php index 0bfad27..002dc33 100644 --- a/resources/views/pages/prizes/index.blade.php +++ b/resources/views/pages/prizes/index.blade.php @@ -60,5 +60,5 @@ @endif - {!! $prizeModels->links() !!} + {{ $prizeModels->links() }} @endsection diff --git a/resources/views/pages/products/index.blade.php b/resources/views/pages/products/index.blade.php index 4fe26ce..ce995f5 100644 --- a/resources/views/pages/products/index.blade.php +++ b/resources/views/pages/products/index.blade.php @@ -54,5 +54,5 @@ @endif - {!! $productModels->links() !!} + {{ $productModels->links() }} @endsection diff --git a/resources/views/pages/ranges/index.blade.php b/resources/views/pages/ranges/index.blade.php index c1f0e2a..7e23031 100644 --- a/resources/views/pages/ranges/index.blade.php +++ b/resources/views/pages/ranges/index.blade.php @@ -50,5 +50,5 @@ @endif - {!! $rangeModels->links() !!} + {{ $rangeModels->links() }} @endsection diff --git a/resources/views/pages/winners-list/index.blade.php b/resources/views/pages/winners-list/index.blade.php index 425a463..82d99b1 100644 --- a/resources/views/pages/winners-list/index.blade.php +++ b/resources/views/pages/winners-list/index.blade.php @@ -76,5 +76,5 @@ @endif - {!! $participationModels->links() !!} + {{ $participationModels->links() }} @endsection diff --git a/routes/breadcrumbs-bo.php b/routes/breadcrumbs-bo.php index 9f9063a..8001824 100644 --- a/routes/breadcrumbs-bo.php +++ b/routes/breadcrumbs-bo.php @@ -3,7 +3,6 @@ use App\Models\BannedIp; use App\Models\FaqQuestion; use App\Models\FaqTheme; -use App\Models\GainView; use App\Models\Prize; use App\Models\Product; use App\Models\Range; @@ -13,16 +12,16 @@ use Diglactic\Breadcrumbs\Generator; use Illuminate\Support\Str; // * BANNED IPS -Breadcrumbs::for('bo.bannedips.index', function (Generator $trail) { - $trail->push(__('models.classes.bannedips'), route('bo.bannedips.index')); +Breadcrumbs::for('bo.banned_ips.index', function (Generator $trail) { + $trail->push(__('models.classes.banned_ips'), route('bo.banned_ips.index')); }); -Breadcrumbs::for('bo.bannedips.create', function (Generator $trail) { - $trail->parent('bo.bannedips.index'); - $trail->push(__('crud.actions.create'), route('bo.bannedips.create')); +Breadcrumbs::for('bo.banned_ips.create', function (Generator $trail) { + $trail->parent('bo.banned_ips.index'); + $trail->push(__('crud.actions.create'), route('bo.banned_ips.create')); }); -Breadcrumbs::for('bo.bannedips.edit', function (Generator $trail, BannedIp $bannedip) { - $trail->parent('bo.bannedips.index'); - $trail->push(__('crud.actions.edit'), route('bo.bannedips.edit', $bannedip->id)); +Breadcrumbs::for('bo.banned_ips.edit', function (Generator $trail, BannedIp $bannedip) { + $trail->parent('bo.banned_ips.index'); + $trail->push(__('crud.actions.edit'), route('bo.banned_ips.edit', $bannedip->id)); }); // * CONTENTS diff --git a/routes/web-bo.php b/routes/web-bo.php index 63b6a35..790868c 100644 --- a/routes/web-bo.php +++ b/routes/web-bo.php @@ -6,7 +6,6 @@ use App\Http\Controllers\Bo\CodeController; use App\Http\Controllers\Bo\DashboardController; use App\Http\Controllers\Bo\FaqQuestionController; use App\Http\Controllers\Bo\FaqThemeController; -use App\Http\Controllers\Bo\GainViewController; use App\Http\Controllers\Bo\InstantWinController; use App\Http\Controllers\Bo\PrizeController; use App\Http\Controllers\Bo\ProductController; @@ -94,7 +93,7 @@ Route::prefix('bo')->name('bo.')->group(function () { Route::post('codes/export', [CodeController::class, 'export'])->name('export-codes'); // * BANNED IPS - Route::resource('bannedips', BannedIpController::class)->except('show'); + Route::resource('banned_ips', BannedIpController::class)->except('show'); }); }); // * Others routes