Tons of Bo fixes related to product and ranges,
add picture alt and titles + seeders + correct config picture sizes
This commit is contained in:
parent
3e326ba3ca
commit
232bc2f459
45 changed files with 471 additions and 242 deletions
|
|
@ -13,7 +13,7 @@ use App\Models\Settings;
|
|||
use Illuminate\Support\Facades\Queue;
|
||||
use Kwaadpepper\Serial\Exceptions\SerialCasterException;
|
||||
|
||||
class CodesController extends Controller
|
||||
class CodeController extends Controller
|
||||
{
|
||||
/**
|
||||
* Show code form to generate and export
|
||||
|
|
@ -11,7 +11,7 @@ use Illuminate\Http\Request;
|
|||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class FaqQuestionsController extends Controller
|
||||
class FaqQuestionController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
|
|
@ -10,7 +10,7 @@ use Illuminate\Http\Request;
|
|||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class FaqThemesController extends Controller
|
||||
class FaqThemeController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
|
|
@ -11,7 +11,7 @@ use Illuminate\Http\Request;
|
|||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class PrizesController extends Controller
|
||||
class PrizeController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
|
|
@ -81,14 +81,14 @@ class PrizesController extends Controller
|
|||
->route('bo.prizes.edit', $prize)
|
||||
->with('success', trans(
|
||||
'crud.messages.has_been_created',
|
||||
['model' => Str::singular(__('models.classes.prizes'))]
|
||||
['model' => Str::singular(__('models.classes.prize'))]
|
||||
));
|
||||
}
|
||||
return redirect()
|
||||
->back()
|
||||
->with('error', trans(
|
||||
'crud.messages.cannot_be_created',
|
||||
['model' => Str::singular(__('models.classes.prizes'))]
|
||||
['model' => Str::singular(__('models.classes.prize'))]
|
||||
));
|
||||
});
|
||||
}
|
||||
|
|
@ -124,14 +124,14 @@ class PrizesController extends Controller
|
|||
->route('bo.prizes.edit', $prize)
|
||||
->with('success', trans(
|
||||
'crud.messages.has_been_updated',
|
||||
['model' => Str::singular(__('models.classes.prizes'))]
|
||||
['model' => Str::singular(__('models.classes.prize'))]
|
||||
));
|
||||
}
|
||||
return redirect()
|
||||
->back()
|
||||
->with('error', trans(
|
||||
'crud.messages.cannot_be_updated',
|
||||
['model' => Str::singular(__('models.classes.prizes'))]
|
||||
['model' => Str::singular(__('models.classes.prize'))]
|
||||
));
|
||||
});
|
||||
}
|
||||
|
|
@ -150,14 +150,14 @@ class PrizesController extends Controller
|
|||
->route('bo.prizes.index')
|
||||
->with('success', __(
|
||||
'crud.messages.has_been_deleted',
|
||||
['model' => Str::singular(__('models.classes.prizes'))]
|
||||
['model' => Str::singular(__('models.classes.prize'))]
|
||||
));
|
||||
}
|
||||
return redirect()
|
||||
->back()
|
||||
->with('error', __(
|
||||
':crud.messages.cannot_be_deleted',
|
||||
['model' => Str::singular(__('models.classes.prizes'))]
|
||||
['model' => Str::singular(__('models.classes.prize'))]
|
||||
));
|
||||
});
|
||||
}
|
||||
|
|
@ -11,7 +11,7 @@ use Illuminate\Http\Request;
|
|||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class ProductsController extends Controller
|
||||
class ProductController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
|
|
@ -22,7 +22,7 @@ class ProductsController extends Controller
|
|||
public function index(Request $request): \Illuminate\Contracts\View\View
|
||||
{
|
||||
/** @var \Illuminate\Database\Eloquent\Builder $productModels */
|
||||
$productModels = Product::query();
|
||||
$productModels = Product::query()->with('range');
|
||||
|
||||
/** @var string $search Search field */
|
||||
$search = $request->search;
|
||||
|
|
@ -32,14 +32,12 @@ class ProductsController extends Controller
|
|||
$search,
|
||||
null,
|
||||
'name',
|
||||
'no_art',
|
||||
'code_ean',
|
||||
);
|
||||
}
|
||||
$searchFields = \sprintf(
|
||||
'%s, %s, %s ...',
|
||||
'%s, %s ...',
|
||||
Str::ucfirst(__('validation.attributes.name')),
|
||||
__('validation.custom.no_art'),
|
||||
__('validation.custom.ean_code'),
|
||||
);
|
||||
|
||||
|
|
@ -90,14 +88,14 @@ class ProductsController extends Controller
|
|||
->route('bo.products.edit', $product)
|
||||
->with('success', trans(
|
||||
'crud.messages.has_been_created',
|
||||
['model' => Str::singular(__('models.classes.products'))]
|
||||
['model' => Str::singular(__('models.classes.product'))]
|
||||
));
|
||||
}
|
||||
return redirect()
|
||||
->back()
|
||||
->with('error', trans(
|
||||
'crud.messages.cannot_be_created',
|
||||
['model' => Str::singular(__('models.classes.products'))]
|
||||
['model' => Str::singular(__('models.classes.product'))]
|
||||
));
|
||||
});
|
||||
}
|
||||
|
|
@ -133,14 +131,14 @@ class ProductsController extends Controller
|
|||
->route('bo.products.edit', $product)
|
||||
->with('success', trans(
|
||||
'crud.messages.has_been_updated',
|
||||
['model' => Str::singular(__('models.classes.products'))]
|
||||
['model' => Str::singular(__('models.classes.product'))]
|
||||
));
|
||||
}
|
||||
return redirect()
|
||||
->back()
|
||||
->with('error', trans(
|
||||
'crud.messages.cannot_be_updated',
|
||||
['model' => Str::singular(__('models.classes.products'))]
|
||||
['model' => Str::singular(__('models.classes.product'))]
|
||||
));
|
||||
});
|
||||
}
|
||||
|
|
@ -159,14 +157,14 @@ class ProductsController extends Controller
|
|||
->route('bo.products.index')
|
||||
->with('success', __(
|
||||
'crud.messages.has_been_deleted',
|
||||
['model' => Str::singular(__('models.classes.products'))]
|
||||
['model' => Str::singular(__('models.classes.product'))]
|
||||
));
|
||||
}
|
||||
return redirect()
|
||||
->back()
|
||||
->with('error', __(
|
||||
':crud.messages.cannot_be_deleted',
|
||||
['model' => Str::singular(__('models.classes.products'))]
|
||||
['model' => Str::singular(__('models.classes.product'))]
|
||||
));
|
||||
});
|
||||
}
|
||||
|
|
@ -73,14 +73,14 @@ class RangeController extends Controller
|
|||
->route('bo.ranges.edit', $range)
|
||||
->with('success', trans(
|
||||
'crud.messages.has_been_created',
|
||||
['model' => Str::singular(__('models.classes.ranges'))]
|
||||
['model' => Str::singular(__('models.classes.range'))]
|
||||
));
|
||||
}
|
||||
return redirect()
|
||||
->back()
|
||||
->with('error', trans(
|
||||
'crud.messages.cannot_be_created',
|
||||
['model' => Str::singular(__('models.classes.ranges'))]
|
||||
['model' => Str::singular(__('models.classes.range'))]
|
||||
));
|
||||
});
|
||||
}
|
||||
|
|
@ -114,14 +114,14 @@ class RangeController extends Controller
|
|||
->route('bo.ranges.edit', $range)
|
||||
->with('success', trans(
|
||||
'crud.messages.has_been_updated',
|
||||
['model' => Str::singular(__('models.classes.ranges'))]
|
||||
['model' => Str::singular(__('models.classes.range'))]
|
||||
));
|
||||
}
|
||||
return redirect()
|
||||
->back()
|
||||
->with('error', trans(
|
||||
'crud.messages.cannot_be_updated',
|
||||
['model' => Str::singular(__('models.classes.ranges'))]
|
||||
['model' => Str::singular(__('models.classes.range'))]
|
||||
));
|
||||
});
|
||||
}
|
||||
|
|
@ -145,14 +145,14 @@ class RangeController extends Controller
|
|||
->route('bo.ranges.index')
|
||||
->with('success', __(
|
||||
'crud.messages.has_been_deleted',
|
||||
['model' => Str::singular(__('models.classes.ranges'))]
|
||||
['model' => Str::singular(__('models.classes.range'))]
|
||||
));
|
||||
}
|
||||
return redirect()
|
||||
->back()
|
||||
->with('error', __(
|
||||
':crud.messages.cannot_be_deleted',
|
||||
['model' => Str::singular(__('models.classes.ranges'))]
|
||||
['model' => Str::singular(__('models.classes.range'))]
|
||||
));
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ use App\Models\Participation;
|
|||
use App\Models\Settings;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class WinnersListController extends Controller
|
||||
class WinnerListController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
|
|
@ -3,16 +3,36 @@
|
|||
namespace App\Http\Controllers\Fo;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Range;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
|
||||
class HomeController extends Controller
|
||||
{
|
||||
/**
|
||||
* home
|
||||
* Display home page
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
* @return \Illuminate\Contracts\View\View
|
||||
*/
|
||||
public function home()
|
||||
public function home(): View
|
||||
{
|
||||
return view('theme::pages.home');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display products with game stickers
|
||||
*
|
||||
* @return \Illuminate\Contracts\View\View
|
||||
* @phpcs:ignore Squiz.Commenting.FunctionComment.EmptyThrows
|
||||
* @throws \Illuminate\Http\Exceptions\HttpResponseException
|
||||
*/
|
||||
public function showProducts(): View
|
||||
{
|
||||
if (!Gate::allows('fo.showProducts')) {
|
||||
\response()->redirectToRoute('fo.homepage')->throwResponse();
|
||||
}
|
||||
|
||||
$rangeModelList = Range::query()->with('products')->orderBy('id')->get();
|
||||
return view('theme::pages.products', compact('rangeModelList'));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,23 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Fo;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Range;
|
||||
|
||||
class ProduitsController extends Controller
|
||||
{
|
||||
/**
|
||||
* index
|
||||
*
|
||||
* @return \Illuminate\View\View|Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$ranges = Range::with('products')->orderBy('id')->get();
|
||||
if (view()->exists('theme::produits-porteurs')) {
|
||||
return view('theme::produits-porteurs', compact('ranges'));
|
||||
}
|
||||
return redirect()->route('home');
|
||||
}
|
||||
}
|
||||
|
|
@ -53,7 +53,7 @@ class SecureHeaders
|
|||
"default-src 'none';",
|
||||
"manifest-src 'self';",
|
||||
// * CKEDITOR Specific https://ckeditor.com/docs/ckeditor5/latest/installation/advanced/csp.html
|
||||
"connect-src 'self' " . implode(' ', [
|
||||
"connect-src 'self' blob: " . implode(' ', [
|
||||
// * VITE DEV
|
||||
config('app.debug') ? "wss://{$host}:4443" : '',
|
||||
config('app.debug') ? "https://{$host}:4443" : '',
|
||||
|
|
|
|||
|
|
@ -38,17 +38,18 @@ class StoreProductRequest extends FormRequest
|
|||
{
|
||||
$rules = [
|
||||
'name' => 'required|string|min:3|max:255',
|
||||
'no_art' => 'nullable|numeric|min:0',
|
||||
'code_ean' => [
|
||||
'required',
|
||||
'numeric',
|
||||
'unique:products,code_ean',
|
||||
'regex:/^[0-9]{7}$|^[0-9]{8}$|^[0-9]{13}$/',
|
||||
],
|
||||
'range_id' => 'exists:ranges,id'
|
||||
'picture_alt' => 'required_with:picture|string|between:3,255',
|
||||
'picture_title' => 'required_with:picture|string|between:3,255',
|
||||
'range_id' => 'exists:ranges,id'
|
||||
];
|
||||
$width = config('theme.product_image_maxwidth');
|
||||
$height = config('theme.product_image_maxheight');
|
||||
$width = config('theme.models.products.picture_max_width');
|
||||
$height = config('theme.models.products.picture_max_height');
|
||||
return \array_merge(
|
||||
$rules,
|
||||
$this->pictureRules('picture', $width, $height, $width, $height, true),
|
||||
|
|
@ -63,7 +64,7 @@ class StoreProductRequest extends FormRequest
|
|||
public function attributes(): array
|
||||
{
|
||||
return [
|
||||
'code_ean' => trans('Code EAN'),
|
||||
'code_ean' => trans('validation.custom.ean_code'),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,9 +39,11 @@ class StoreRangeRequest extends FormRequest
|
|||
$rules = [
|
||||
'name' => 'required|string|min:2|max:255',
|
||||
];
|
||||
$width = config('theme.models.ranges.picture_max_width');
|
||||
$height = config('theme.models.ranges.picture_max_height');
|
||||
return \array_merge(
|
||||
$rules,
|
||||
$this->pictureRules('picture', 500, 500, 500, 500, false),
|
||||
$this->pictureRules('picture', $width, $height, $width, $height, false),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,13 +3,13 @@
|
|||
namespace App\Models;
|
||||
|
||||
use App\Lib\Helpers\FileStorageHelper;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Product.
|
||||
*
|
||||
* @property string $name Name
|
||||
* @property integer $no_art Number of this article
|
||||
* @property string $picture Path of the picture
|
||||
* @property integer $code_ean Ean code
|
||||
* @property-read \Illuminate\Support\Carbon $created_at Creation Date.
|
||||
|
|
@ -24,6 +24,8 @@ use Illuminate\Database\Eloquent\Model;
|
|||
*/
|
||||
class Product extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
|
|
@ -31,8 +33,9 @@ class Product extends Model
|
|||
*/
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'no_art',
|
||||
'picture',
|
||||
'picture_alt',
|
||||
'picture_title',
|
||||
'code_ean',
|
||||
'range_id',
|
||||
];
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
namespace App\Models;
|
||||
|
||||
use App\Lib\Helpers\FileStorageHelper;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
|
|
@ -21,6 +22,8 @@ use Illuminate\Database\Eloquent\Model;
|
|||
*/
|
||||
class Range extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ namespace App\Providers;
|
|||
|
||||
use App\Auth\CrmUserProvider;
|
||||
use App\Enums\Users\RoleEnum;
|
||||
use App\Models\Product;
|
||||
use App\Models\User;
|
||||
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
|
|
@ -28,6 +29,12 @@ class AuthServiceProvider extends ServiceProvider
|
|||
return $user->role === RoleEnum::conceptor;
|
||||
});
|
||||
|
||||
Gate::define(
|
||||
'fo.showProducts',
|
||||
// phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClass
|
||||
fn (?User $user) => view()->exists('theme::pages.products') and (bool)Product::query()->count()
|
||||
);
|
||||
|
||||
$this->app->auth->provider('crm', function ($app, array $config) {
|
||||
return new CrmUserProvider($app['hash'], $config['model']);
|
||||
});
|
||||
|
|
|
|||
27
database/factories/ProductFactory.php
Normal file
27
database/factories/ProductFactory.php
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Product>
|
||||
*/
|
||||
class ProductFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'name' => 'product ' . \fake()->jobTitle(),
|
||||
// * EAN 13 generate
|
||||
'code_ean' => fake()->randomNumber(8, true) . fake()->randomNumber(5, true),
|
||||
'picture_alt' => fake()->sentence(),
|
||||
'picture_title' => fake()->sentence(),
|
||||
];
|
||||
}
|
||||
}
|
||||
25
database/factories/RangeFactory.php
Normal file
25
database/factories/RangeFactory.php
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Range>
|
||||
*/
|
||||
class RangeFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'name' => 'range ' . \fake()->jobTitle(),
|
||||
'picture_alt' => fake()->sentence(),
|
||||
'picture_title' => fake()->sentence(),
|
||||
];
|
||||
}
|
||||
}
|
||||
BIN
database/factories/assets/products/default-picture-550x550.jpg
Normal file
BIN
database/factories/assets/products/default-picture-550x550.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.9 KiB |
BIN
database/factories/assets/ranges/default-picture-476x355.jpg
Normal file
BIN
database/factories/assets/ranges/default-picture-476x355.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.4 KiB |
|
|
@ -15,8 +15,12 @@ class CreateRangesTable extends Migration
|
|||
{
|
||||
Schema::create('ranges', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->string('picture')->nullable();
|
||||
|
||||
$table->string('name')->comment('Nom de la gamme');
|
||||
$table->string('picture')->nullable()->comment('Image de la gamme');
|
||||
$table->string('picture_alt')->nullable()->comment('Attribut alt de l\'image de la gamme');
|
||||
$table->string('picture_title')->nullable()->comment('Attribut title de l\'image de la gamme');
|
||||
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,10 +15,13 @@ class CreateProductsTable extends Migration
|
|||
{
|
||||
Schema::create('products', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->unsignedInteger('no_art')->nullable();
|
||||
$table->string('picture')->nullable();
|
||||
$table->unsignedBigInteger('code_ean');
|
||||
$table->string('name')->comment('Nom du produit');
|
||||
$table->string('picture')->nullable()->comment('Image du produit');
|
||||
$table->string('picture_alt')->nullable()->comment('Attribut alt de l\'image du produit');
|
||||
$table->string('picture_title')->nullable()->comment('Attribut title de l\'image du produit');
|
||||
|
||||
$table->unsignedBigInteger('code_ean')->comment('Code EAN du produit pour la participation au jeu');
|
||||
|
||||
$table->foreignId('range_id')->before('created_at')->references('id')
|
||||
->on('ranges')->onDelete('cascade');
|
||||
$table->timestamps();
|
||||
|
|
|
|||
|
|
@ -13,8 +13,10 @@ class DatabaseSeeder extends Seeder
|
|||
*/
|
||||
public function run()
|
||||
{
|
||||
$this->call(SettingsSeeder::class);
|
||||
$this->call(StaticPageSeeder::class);
|
||||
$this->call(PrizeSeeder::class);
|
||||
$this->call([
|
||||
SettingsSeeder::class,
|
||||
StaticPageSeeder::class,
|
||||
PrizeSeeder::class,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
45
database/seeders/ProductSeeder.php
Normal file
45
database/seeders/ProductSeeder.php
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Lib\Helpers\FileStorageHelper;
|
||||
use App\Models\Product;
|
||||
use App\Models\Range;
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\File;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class ProductSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
Schema::disableForeignKeyConstraints();
|
||||
DB::table('products')->truncate();
|
||||
DB::table('ranges')->truncate();
|
||||
Schema::enableForeignKeyConstraints();
|
||||
|
||||
File::deleteDirectory(\storage_path('app/public/modelfiles/ranges'));
|
||||
File::deleteDirectory(\storage_path('app/public/modelfiles/products'));
|
||||
|
||||
$this->call(RangeSeeder::class);
|
||||
|
||||
Range::all()->each(function (Range $range) {
|
||||
Product::factory(6)->make()->each(function (Product $product) use ($range) {
|
||||
$product->picture = FileStorageHelper::storeFile(
|
||||
new Range(),
|
||||
new \SplFileInfo(
|
||||
\resource_path('../database/factories/assets/products/default-picture-550x550.jpg')
|
||||
)
|
||||
);
|
||||
$product->range()->associate($range);
|
||||
$product->saveQuietly();
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
28
database/seeders/RangeSeeder.php
Normal file
28
database/seeders/RangeSeeder.php
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Lib\Helpers\FileStorageHelper;
|
||||
use App\Models\Range;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class RangeSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
Range::factory(6)->make()->each(function (Range $range) {
|
||||
$range->picture = FileStorageHelper::storeFile(
|
||||
new Range(),
|
||||
new \SplFileInfo(
|
||||
\resource_path('../database/factories/assets/ranges/default-picture-476x355.jpg')
|
||||
)
|
||||
);
|
||||
$range->saveQuietly();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -9,10 +9,10 @@ return [
|
|||
'faq-questions' => 'Question pour la FAQ|Questions pour la FAQ',
|
||||
'faq-themes' => 'Thème pour la FAQ|Thèmes pour la FAQ',
|
||||
'gain-views' => 'Page de gain|Pages de gain',
|
||||
'prizes' => 'Lots',
|
||||
'ranges' => 'Gammes',
|
||||
'products' => 'Produits',
|
||||
'winners' => 'Gagnants',
|
||||
'prizes' => 'Lot',
|
||||
'range' => 'Gamme',
|
||||
'winner' => 'Gagnant',
|
||||
'settings' => 'Réglages',
|
||||
'product' => 'Produit',
|
||||
]
|
||||
];
|
||||
|
|
|
|||
|
|
@ -221,6 +221,8 @@ return [
|
|||
'female' => 'de la ',
|
||||
'vowel' => 'de l\''
|
||||
],
|
||||
'attribute_alt' => 'attribut alt',
|
||||
'attribute_title' => 'attribut title',
|
||||
'event' => 'évènement',
|
||||
'model' => 'élément ciblé',
|
||||
'order' => 'ordre',
|
||||
|
|
@ -250,7 +252,6 @@ return [
|
|||
'pdf_winning_proof' => 'pdf preuve de gain',
|
||||
'need_proof' => 'preuve de gain obligatoire',
|
||||
'picture' => 'illustration',
|
||||
'no_art' => 'numéro d\'article',
|
||||
'ean_code' => 'code EAN',
|
||||
'start_date' => 'date de début',
|
||||
'end_date' => 'date de fin',
|
||||
|
|
|
|||
|
|
@ -380,6 +380,7 @@
|
|||
class="form-text text-body-secondary d-block"
|
||||
>{{ __("vue.ImageInputComponent.preview_picture") }}</small>
|
||||
<img
|
||||
v-if="intValue"
|
||||
class="img-fluid"
|
||||
:src="intValue"
|
||||
:alt="__('Image placeholder')"
|
||||
|
|
@ -431,6 +432,7 @@ export default defineComponent({
|
|||
mounted() {
|
||||
const json = String(this.$attrs.json ?? "");
|
||||
this.initTooltips();
|
||||
|
||||
if (json.length) {
|
||||
// * Init uppon Laravel Blade
|
||||
const data = JSON.parse(json);
|
||||
|
|
@ -453,6 +455,10 @@ export default defineComponent({
|
|||
if (data.browseEvent !== undefined) {
|
||||
this.intBrowseEvent = data.browseEvent ? true : false;
|
||||
}
|
||||
this.intHasImage = false;
|
||||
if (this.intValue.length) {
|
||||
this.fetchPictureFromPath(`${this.intValue}`);
|
||||
}
|
||||
} else {
|
||||
// * Init Uppon Vue component
|
||||
this.intId = this.id;
|
||||
|
|
@ -469,7 +475,6 @@ export default defineComponent({
|
|||
this.intRequired = this.required;
|
||||
this.intBrowseEvent = this.browseEvent;
|
||||
}
|
||||
this.intHasImage = false;
|
||||
},
|
||||
props: {
|
||||
id: {
|
||||
|
|
@ -630,35 +635,7 @@ export default defineComponent({
|
|||
}
|
||||
// * Using browse event, If user changed imagem recompile blob (File Upload storage strategy)
|
||||
if (this.inTbrowseEvent && this.inThasImage) {
|
||||
const actualImage = this.$refs.actualImage as HTMLInputElement,
|
||||
container = new DataTransfer();
|
||||
this.$nextTick(() => {
|
||||
this.intValue = value.replace(/^\/|^/, "/");
|
||||
this.intValueFileName = value.replace(/^\/|^/, "");
|
||||
fetch(this.intValue)
|
||||
.then((response) => {
|
||||
this.intOriginalFileName = decodeURI(response.url.substring(
|
||||
response.url.lastIndexOf("/") + 1
|
||||
));
|
||||
return response.blob();
|
||||
})
|
||||
.then((blob: Blob) => {
|
||||
if (!actualImage.files) {
|
||||
throw new Error("3- missing files list");
|
||||
}
|
||||
this.fetchDataUrlImageSizes(this.inTvalue);
|
||||
const file = new File([blob], this.inTvalueFileName, {
|
||||
type: "image/png",
|
||||
lastModified: new Date().getTime(),
|
||||
});
|
||||
this.intHasImage = true;
|
||||
this.intOriginalFile = file;
|
||||
this.$emit("imageFile", file);
|
||||
container.items.add(file);
|
||||
actualImage.files = container.files;
|
||||
this.changedImage();
|
||||
});
|
||||
});
|
||||
this.fetchPictureFromPath(value);
|
||||
}
|
||||
},
|
||||
},
|
||||
|
|
@ -761,6 +738,42 @@ export default defineComponent({
|
|||
this.$nextTick(() => (this.intHasImage = false));
|
||||
this.$emit("imageFile", null);
|
||||
},
|
||||
fetchPictureFromPath(value: string): void {
|
||||
const actualImage: HTMLInputElement = this.$refs.actualImage as HTMLInputElement,
|
||||
container: DataTransfer = new DataTransfer();
|
||||
|
||||
this.$nextTick(() => {
|
||||
const stringValue: string = value.replace(/^\/|^/, "/"),
|
||||
stringFileName: string = stringValue.substring(stringValue.lastIndexOf("/")).replace(/^\/|^/, "");
|
||||
|
||||
fetch(stringValue)
|
||||
.then((response) => {
|
||||
this.intOriginalFileName = decodeURI(response.url.substring(
|
||||
response.url.lastIndexOf("/") + 1
|
||||
));
|
||||
return response.blob();
|
||||
})
|
||||
.then((blob: Blob) => {
|
||||
if (!actualImage.files) {
|
||||
throw new Error("3- missing files list");
|
||||
}
|
||||
this.fetchDataUrlImageSizes(stringValue);
|
||||
const file = new File([blob], stringFileName, {
|
||||
type: "image/png",
|
||||
lastModified: new Date().getTime(),
|
||||
});
|
||||
|
||||
this.intValue = stringValue;
|
||||
this.intValueFileName = stringFileName;
|
||||
this.intHasImage = true;
|
||||
this.intOriginalFile = file;
|
||||
this.$emit("imageFile", file);
|
||||
container.items.add(file);
|
||||
actualImage.files = container.files;
|
||||
this.changedImage();
|
||||
});
|
||||
});
|
||||
},
|
||||
changedImage() {
|
||||
const reader = new FileReader(),
|
||||
actualImage = this.$refs.actualImage as HTMLInputElement;
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ import WordCounter from "./WordCounterComponent.vue";
|
|||
const textarea = ref<HTMLTextAreaElement | null>(null);
|
||||
|
||||
export default defineComponent({
|
||||
name: "InputTextAutoComponent",
|
||||
inheritAttrs: false,
|
||||
mixins: [trans],
|
||||
components: {
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ import { defineComponent } from "vue";
|
|||
import trans from "../modules/trans";
|
||||
|
||||
export default defineComponent({
|
||||
name: "WordCounterComponent",
|
||||
mixins: [trans],
|
||||
mounted() {
|
||||
const json = String(this.$attrs.json ?? "{}");
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
title="{{ __('Accéder au front du projet') }}" target="_blank">
|
||||
{{ config('app.name', 'Laravel') }}
|
||||
</a>
|
||||
@auth
|
||||
@auth('backend')
|
||||
<button class="navbar-toggler" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" type="button"
|
||||
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="{{ __('Toggle navigation') }}">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
|
|
@ -50,7 +50,7 @@
|
|||
</form>
|
||||
</li>
|
||||
<!-- Authentication Links -->
|
||||
@auth
|
||||
@auth('backend')
|
||||
<li class="nav-item dropdown">
|
||||
<button class="btn nav-link dropdown-toggle d-flex align-items-center h-100 flex-row border-0 ps-3" id="navbarDropdown"
|
||||
data-bs-toggle="dropdown" type="button">
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
@extends('back::layout', ['brParam' => $prizeModel])
|
||||
|
||||
@section('title', __('Création d\'une :model', ['model' => Str::singular(__('models.classes.prizes'))]))
|
||||
@section('description', __('Création d\'une toute nouvelle :model', ['model' => Str::singular(__('models.classes.prizes'))]))
|
||||
@section('title', __('Création d\'une :model', ['model' => Str::singular(__('models.classes.prize'))]))
|
||||
@section('description', __('Création d\'une toute nouvelle :model', ['model' => Str::singular(__('models.classes.prize'))]))
|
||||
@section('breadcrumb',
|
||||
request()->route()->getName())
|
||||
|
||||
|
|
@ -9,14 +9,14 @@
|
|||
<div class="d-flex justify-content-between flex-md-nowrap align-items-center flex-wrap pb-3">
|
||||
<div class="d-flex align-items-center flex-row">
|
||||
<a class="btn btn-primary text-decoration-none m-0 me-2" data-bs-toggle="tooltip" data-bs-placement="top"
|
||||
href="{{ route('bo.prizes.index') }}" title="{{ __('crud.helpers.list_all', ['model' => __('models.classes.prizes')]) }}">
|
||||
href="{{ route('bo.prizes.index') }}" title="{{ __('crud.helpers.list_all', ['model' => __('models.classes.prize')]) }}">
|
||||
<i class="fa-solid fa-arrow-left"></i>
|
||||
</a>
|
||||
@include('modules.breadcrumbs.breadcrumb-body', ['brParam' => $prizeModel])
|
||||
</div>
|
||||
<div class="mb-md-0 mb-2">
|
||||
<button class="btn btn-primary" id="formSubmitClone" data-bs-toggle="tooltip" data-bs-placement="top" type="submit"
|
||||
title="{{ __('crud.helpers.save_model', ['model' => Str::singular(__('models.classes.prizes'))]) }}">
|
||||
title="{{ __('crud.helpers.save_model', ['model' => Str::singular(__('models.classes.prize'))]) }}">
|
||||
{{ __('crud.actions.save') }}
|
||||
</button>
|
||||
</div>
|
||||
|
|
@ -27,7 +27,7 @@
|
|||
<div class="row mt-3">
|
||||
<div class="col text-center">
|
||||
<button class="btn btn-primary" id="formSubmit" data-bs-toggle="tooltip" data-bs-placement="top" type="submit"
|
||||
title="{{ __('crud.helpers.save_model', ['model' => Str::singular(__('models.classes.prizes'))]) }}">
|
||||
title="{{ __('crud.helpers.save_model', ['model' => Str::singular(__('models.classes.prize'))]) }}">
|
||||
{{ __('crud.actions.save') }}
|
||||
</button>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
@extends('back::layout', ['brParam' => $prizeModel])
|
||||
|
||||
@section('title', __('Édition d\'une :model', ['model' => Str::singular(__('models.classes.prizes'))]))
|
||||
@section('description', __('Édition d\'une :model déjà existante', ['model' => Str::singular(__('models.classes.prizes'))]))
|
||||
@section('title', __('Édition d\'une :model', ['model' => Str::singular(__('models.classes.prize'))]))
|
||||
@section('description', __('Édition d\'une :model déjà existante', ['model' => Str::singular(__('models.classes.prize'))]))
|
||||
@section('breadcrumb',
|
||||
request()->route()->getName())
|
||||
|
||||
|
|
@ -9,7 +9,7 @@
|
|||
<div class="d-flex justify-content-between flex-md-nowrap align-items-center flex-wrap pb-3">
|
||||
<div class="d-flex align-items-start flex-row">
|
||||
<a class="btn btn-primary text-decoration-none m-0 me-2" data-bs-toggle="tooltip" data-bs-placement="top"
|
||||
href="{{ route('bo.prizes.index') }}" title="{{ __('crud.helpers.list_all', ['model' => __('models.classes.prizes')]) }}">
|
||||
href="{{ route('bo.prizes.index') }}" title="{{ __('crud.helpers.list_all', ['model' => __('models.classes.prize')]) }}">
|
||||
<i class="fa-solid fa-arrow-left"></i>
|
||||
</a>
|
||||
@include('modules.breadcrumbs.breadcrumb-body', ['brParam' => $prizeModel])
|
||||
|
|
@ -20,11 +20,11 @@
|
|||
@method('DELETE')
|
||||
<div class="btn-group" role="group">
|
||||
<button class="btn btn-primary" id="formSubmitClone" data-bs-toggle="tooltip" data-bs-placement="top" type="submit"
|
||||
title="{{ __('crud.helpers.save_model', ['model' => Str::singular(__('models.classes.prizes'))]) }}">
|
||||
title="{{ __('crud.helpers.save_model', ['model' => Str::singular(__('models.classes.prize'))]) }}">
|
||||
{{ __('crud.actions.save') }}
|
||||
</button>
|
||||
<button class="btn btn-danger" data-bs-toggle="tooltip" data-bs-placement="top" type="submit"
|
||||
title="{{ __('crud.helpers.delete_model', ['model' => Str::singular(__('models.classes.prizes'))]) }}">
|
||||
title="{{ __('crud.helpers.delete_model', ['model' => Str::singular(__('models.classes.prize'))]) }}">
|
||||
<i class="fa-solid fa-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
|
@ -38,7 +38,7 @@
|
|||
<div class="row">
|
||||
<div class="col text-center">
|
||||
<button class="btn btn-primary" id="formSubmit" data-bs-toggle="tooltip" data-bs-placement="top" type="submit"
|
||||
title="{{ __('crud.helpers.save_model', ['model' => Str::singular(__('models.classes.prizes'))]) }}">
|
||||
title="{{ __('crud.helpers.save_model', ['model' => Str::singular(__('models.classes.prize'))]) }}">
|
||||
{{ __('crud.actions.save') }}
|
||||
</button>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
]),
|
||||
'placeholder' => __(':field du :model', [
|
||||
'field' => Str::ucfirst(__('validation.custom.label_one')),
|
||||
'model' => Str::singular(__('models.classes.prizes')),
|
||||
'model' => Str::singular(__('models.classes.prize')),
|
||||
]),
|
||||
])
|
||||
</div>
|
||||
|
|
@ -54,7 +54,7 @@
|
|||
]),
|
||||
'placeholder' => __(':field du :model', [
|
||||
'field' => Str::ucfirst(__('validation.custom.label_many')),
|
||||
'model' => Str::singular(__('models.classes.prizes')),
|
||||
'model' => Str::singular(__('models.classes.prize')),
|
||||
]),
|
||||
])
|
||||
</div>
|
||||
|
|
@ -86,7 +86,7 @@
|
|||
]),
|
||||
'placeholder' => __(':field du :model', [
|
||||
'field' => Str::ucfirst(__('validation.attributes.title')),
|
||||
'model' => Str::singular(__('models.classes.prizes')),
|
||||
'model' => Str::singular(__('models.classes.prize')),
|
||||
]),
|
||||
])
|
||||
</div>
|
||||
|
|
@ -110,7 +110,7 @@
|
|||
]),
|
||||
'placeholder' => __(':field du :model', [
|
||||
'field' => Str::ucfirst(__('validation.custom.subtitle')),
|
||||
'model' => Str::singular(__('models.classes.prizes')),
|
||||
'model' => Str::singular(__('models.classes.prize')),
|
||||
]),
|
||||
])
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
@extends('back::layout')
|
||||
|
||||
@section('title', __('models.classes.prizes'))
|
||||
@section('description', __('Liste de toutes les :model', ['model' => __('models.classes.prizes')]))
|
||||
@section('title', __('models.classes.prize'))
|
||||
@section('description', __('Liste de toutes les :model', ['model' => __('models.classes.prize')]))
|
||||
|
||||
@section('content')
|
||||
<div class="d-flex justify-content-between flex-md-nowrap align-items-center flex-wrap">
|
||||
@include('modules.breadcrumbs.breadcrumb-body')
|
||||
<a class="btn btn-primary float-right" data-bs-toggle="tooltip" data-bs-placement="top" href="{{ route('bo.prizes.create') }}"
|
||||
title="{{ __('crud.helpers.create_model', ['model' => Str::singular(__('models.classes.prizes'))]) }}">
|
||||
title="{{ __('crud.helpers.create_model', ['model' => Str::singular(__('models.classes.prize'))]) }}">
|
||||
<i class="fa-solid fa-plus"></i>
|
||||
</a>
|
||||
</div>
|
||||
|
|
@ -64,7 +64,7 @@
|
|||
@else
|
||||
<tr>
|
||||
<td class="fw-bold border-0 text-center">
|
||||
{{ __('crud.other.no_model_found', ['model' => Str::singular(__('models.classes.prizes'))]) }}</td>
|
||||
{{ __('crud.other.no_model_found', ['model' => Str::singular(__('models.classes.prize'))]) }}</td>
|
||||
</tr>
|
||||
@endif
|
||||
</table>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
@extends('back::layout', ['brParam' => $productModel])
|
||||
|
||||
@section('title', __('Création d\'une :model', ['model' => Str::singular(__('models.classes.products'))]))
|
||||
@section('description', __('Création d\'une toute nouvelle :model', ['model' => Str::singular(__('models.classes.products'))]))
|
||||
@section('title', __('Création d\'une :model', ['model' => Str::singular(__('models.classes.product'))]))
|
||||
@section('description', __('Création d\'une toute nouvelle :model', ['model' => Str::singular(__('models.classes.product'))]))
|
||||
@section('breadcrumb',
|
||||
request()->route()->getName())
|
||||
|
||||
|
|
@ -9,14 +9,14 @@
|
|||
<div class="d-flex justify-content-between flex-md-nowrap align-items-center flex-wrap pb-3">
|
||||
<div class="d-flex align-items-center flex-row">
|
||||
<a class="btn btn-primary text-decoration-none m-0 me-2" data-bs-toggle="tooltip" data-bs-placement="top"
|
||||
href="{{ route('bo.products.index') }}" title="{{ __('crud.helpers.list_all', ['model' => __('models.classes.products')]) }}">
|
||||
href="{{ route('bo.products.index') }}" title="{{ __('crud.helpers.list_all', ['model' => __('models.classes.product')]) }}">
|
||||
<i class="fa-solid fa-arrow-left"></i>
|
||||
</a>
|
||||
@include('modules.breadcrumbs.breadcrumb-body', ['brParam' => $productModel])
|
||||
</div>
|
||||
<div class="mb-md-0 mb-2">
|
||||
<button class="btn btn-primary" id="formSubmitClone" data-bs-toggle="tooltip" data-bs-placement="top" type="submit"
|
||||
title="{{ __('crud.helpers.save_model', ['model' => Str::singular(__('models.classes.products'))]) }}">
|
||||
title="{{ __('crud.helpers.save_model', ['model' => Str::singular(__('models.classes.product'))]) }}">
|
||||
{{ __('crud.actions.save') }}
|
||||
</button>
|
||||
</div>
|
||||
|
|
@ -27,7 +27,7 @@
|
|||
<div class="row mt-3">
|
||||
<div class="col text-center">
|
||||
<button class="btn btn-primary" id="formSubmit" data-bs-toggle="tooltip" data-bs-placement="top" type="submit"
|
||||
title="{{ __('crud.helpers.save_model', ['model' => Str::singular(__('models.classes.products'))]) }}">
|
||||
title="{{ __('crud.helpers.save_model', ['model' => Str::singular(__('models.classes.product'))]) }}">
|
||||
{{ __('crud.actions.save') }}
|
||||
</button>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
@extends('back::layout', ['brParam' => $productModel])
|
||||
|
||||
@section('title', __('Édition d\'une :model', ['model' => Str::singular(__('models.classes.products'))]))
|
||||
@section('description', __('Édition d\'une :model déjà existante', ['model' => Str::singular(__('models.classes.products'))]))
|
||||
@section('title', __('Édition d\'une :model', ['model' => Str::singular(__('models.classes.product'))]))
|
||||
@section('description', __('Édition d\'une :model déjà existante', ['model' => Str::singular(__('models.classes.product'))]))
|
||||
@section('breadcrumb',
|
||||
request()->route()->getName())
|
||||
|
||||
|
|
@ -9,7 +9,7 @@
|
|||
<div class="d-flex justify-content-between flex-md-nowrap align-items-center flex-wrap pb-3">
|
||||
<div class="d-flex align-items-start flex-row">
|
||||
<a class="btn btn-primary text-decoration-none m-0 me-2" data-bs-toggle="tooltip" data-bs-placement="top"
|
||||
href="{{ route('bo.products.index') }}" title="{{ __('crud.helpers.list_all', ['model' => __('models.classes.products')]) }}">
|
||||
href="{{ route('bo.products.index') }}" title="{{ __('crud.helpers.list_all', ['model' => __('models.classes.product')]) }}">
|
||||
<i class="fa-solid fa-arrow-left"></i>
|
||||
</a>
|
||||
@include('modules.breadcrumbs.breadcrumb-body', ['brParam' => $productModel])
|
||||
|
|
@ -20,11 +20,11 @@
|
|||
@method('DELETE')
|
||||
<div class="btn-group" role="group">
|
||||
<button class="btn btn-primary" id="formSubmitClone" data-bs-toggle="tooltip" data-bs-placement="top" type="submit"
|
||||
title="{{ __('crud.helpers.save_model', ['model' => Str::singular(__('models.classes.products'))]) }}">
|
||||
title="{{ __('crud.helpers.save_model', ['model' => Str::singular(__('models.classes.product'))]) }}">
|
||||
{{ __('crud.actions.save') }}
|
||||
</button>
|
||||
<button class="btn btn-danger" data-bs-toggle="tooltip" data-bs-placement="top" type="submit"
|
||||
title="{{ __('crud.helpers.delete_model', ['model' => Str::singular(__('models.classes.products'))]) }}">
|
||||
title="{{ __('crud.helpers.delete_model', ['model' => Str::singular(__('models.classes.product'))]) }}">
|
||||
<i class="fa-solid fa-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
|
@ -38,7 +38,7 @@
|
|||
<div class="row">
|
||||
<div class="col text-center">
|
||||
<button class="btn btn-primary" id="formSubmit" data-bs-toggle="tooltip" data-bs-placement="top" type="submit"
|
||||
title="{{ __('crud.helpers.save_model', ['model' => Str::singular(__('models.classes.products'))]) }}">
|
||||
title="{{ __('crud.helpers.save_model', ['model' => Str::singular(__('models.classes.product'))]) }}">
|
||||
{{ __('crud.actions.save') }}
|
||||
</button>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -23,69 +23,90 @@
|
|||
]),
|
||||
'placeholder' => __(':field du :model', [
|
||||
'field' => Str::ucfirst(__('validation.attributes.name')),
|
||||
'model' => Str::singular(__('models.classes.products')),
|
||||
'model' => Str::singular(__('models.classes.product')),
|
||||
]),
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
{{-- NO_ART --}}
|
||||
<div class="col-12 col-md-6 mb-3">
|
||||
<fieldset class="h-100 border p-3">
|
||||
<legend>{{ Str::ucfirst(__('validation.custom.no_art')) }}</legend>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
@include('back::partials.inputs.int-number', [
|
||||
'id' => 'productNoArt',
|
||||
'label' => __(':field', [
|
||||
'field' => Str::ucfirst(__('validation.custom.no_art')),
|
||||
]),
|
||||
'name' => 'no_art',
|
||||
'required' => false,
|
||||
'model' => $productModel ?? null,
|
||||
'helper' => __('validation.min.numeric', [
|
||||
'attribute' => __(':field', [
|
||||
'field' => Str::ucfirst(__('validation.custom.no_art')),
|
||||
]),
|
||||
'min' => 0,
|
||||
]),
|
||||
'min' => 0,
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
{{-- PICTURE --}}
|
||||
<div class="col-12 mb-3">
|
||||
<div class="col-12 pb-3">
|
||||
<fieldset class="h-100 border p-3">
|
||||
<legend>{{ Str::ucfirst(__('validation.custom.picture')) }}</legend>
|
||||
<div class="row">
|
||||
<legend>{{ Str::ucfirst(__('validation.attributes.image')) }}</legend>
|
||||
<div class="row mb-3">
|
||||
{{-- PICTURE_ALT --}}
|
||||
<div class="col-12 col-md-6 m-md-0 mb-3">
|
||||
@include('back::partials.inputs.varchar', [
|
||||
'id' => 'productPictureAlt',
|
||||
'label' => __(':field1 :inter1:field2 :inter2:model', [
|
||||
'field1' => Str::ucfirst(__('validation.custom.attribute_alt')),
|
||||
'inter1' => __('validation.custom.of_the.vowel'),
|
||||
'field2' => __('validation.attributes.image'),
|
||||
'inter2' => __('validation.custom.of_the.male'),
|
||||
'model' => __('models.classes.product'),
|
||||
]),
|
||||
'hasWordCounter' => true,
|
||||
'name' => 'picture_alt',
|
||||
'required' => false,
|
||||
'model' => $productModel ?? null,
|
||||
'helper' => __('crud.minicrud.picture_alt_helper'),
|
||||
'placeholder' => __(':field1 :inter1:field2 :inter2:model', [
|
||||
'field1' => Str::ucfirst(__('validation.custom.attribute_alt')),
|
||||
'inter1' => __('validation.custom.of_the.vowel'),
|
||||
'field2' => __('validation.attributes.image'),
|
||||
'inter2' => __('validation.custom.of_the.male'),
|
||||
'model' => __('models.classes.product'),
|
||||
]),
|
||||
])
|
||||
</div>
|
||||
{{-- PICTURE_TITLE --}}
|
||||
<div class="col-12 col-md-6 mb-3">
|
||||
@include('back::.partials.inputs.varchar', [
|
||||
'id' => 'productPictureTitle',
|
||||
'label' => __(':field1 :inter1:field2 :inter2:model', [
|
||||
'field1' => Str::ucfirst(__('validation.custom.attribute_title')),
|
||||
'inter1' => __('validation.custom.of_the.vowel'),
|
||||
'field2' => __('validation.attributes.image'),
|
||||
'inter2' => __('validation.custom.of_the.male'),
|
||||
'model' => __('models.classes.product'),
|
||||
]),
|
||||
'hasWordCounter' => true,
|
||||
'name' => 'picture_title',
|
||||
'required' => false,
|
||||
'model' => $productModel ?? null,
|
||||
'helper' => __('crud.minicrud.picture_title_helper'),
|
||||
'placeholder' => __(':field1 :inter1:field2 :inter2:model', [
|
||||
'field1' => Str::ucfirst(__('validation.custom.attribute_title')),
|
||||
'inter1' => __('validation.custom.of_the.vowel'),
|
||||
'field2' => __('validation.attributes.image'),
|
||||
'inter2' => __('validation.custom.of_the.male'),
|
||||
'model' => __('models.classes.product'),
|
||||
]),
|
||||
])
|
||||
</div>
|
||||
{{-- PICTURE --}}
|
||||
<div class="col-12">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
@include('back::partials.inputs.varchar-picture', [
|
||||
'id' => 'productPicture',
|
||||
'name' => 'picture',
|
||||
'width' => 500,
|
||||
'height' => 500,
|
||||
'model' => $productModel ?? null,
|
||||
'helper' => __('crud.minicrud.dimensions_must_be', [
|
||||
'widthpx' => '500px',
|
||||
'heightpx' => '500px',
|
||||
]),
|
||||
'required' => false,
|
||||
'preview' => true,
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
@include('back::partials.inputs.varchar-picture', [
|
||||
'id' => 'productPicture',
|
||||
'name' => 'picture',
|
||||
'width' => config('theme.models.products.picture_max_width'),
|
||||
'height' => config('theme.models.products.picture_max_height'),
|
||||
'model' => $productModel ?? null,
|
||||
'helper' => __('crud.minicrud.dimensions_must_be', [
|
||||
'widthpx' => config('theme.models.products.picture_max_width') . 'px',
|
||||
'heightpx' => config('theme.models.products.picture_max_height') . 'px',
|
||||
]),
|
||||
'required' => false,
|
||||
'preview' => true,
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
{{-- CODE_EAN --}}
|
||||
<div class="col-12 col-md-6 mb-3">
|
||||
<fieldset class="h-100 border p-3">
|
||||
<fieldset class="container-fluid border p-3">
|
||||
<legend>{{ Str::ucfirst(__('validation.custom.ean_code')) }}</legend>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
|
|
@ -118,13 +139,13 @@
|
|||
<div class="col-12">
|
||||
@include('back::partials.inputs.bigint-foreign-id', [
|
||||
'id' => 'productRange',
|
||||
'label' => __('crud.minicrud.associated', ['entity' => __('models.classes.ranges')]),
|
||||
'label' => __('crud.minicrud.associated', ['entity' => __('models.classes.range')]),
|
||||
'name' => 'range_id',
|
||||
'size' => 5,
|
||||
'model' => $productModel ?? null,
|
||||
'associatedModels' => $rangeModels,
|
||||
'foreignLabel' => 'name',
|
||||
'helper' => __('crud.minicrud.select', ['entity' => __('models.classes.ranges')]),
|
||||
'helper' => __('crud.minicrud.select', ['entity' => __('models.classes.range')]),
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
@extends('back::layout')
|
||||
|
||||
@section('title', __('models.classes.products'))
|
||||
@section('description', __('Liste de toutes les :model', ['model' => __('models.classes.products')]))
|
||||
@section('title', __('models.classes.product'))
|
||||
@section('description', __('Liste de toutes les :model', ['model' => __('models.classes.product')]))
|
||||
|
||||
@section('content')
|
||||
<div class="d-flex justify-content-between flex-md-nowrap align-items-center flex-wrap">
|
||||
@include('modules.breadcrumbs.breadcrumb-body')
|
||||
<a class="btn btn-primary float-right" data-bs-toggle="tooltip" data-bs-placement="top" href="{{ route('bo.products.create') }}"
|
||||
title="{{ __('crud.helpers.create_model', ['model' => Str::singular(__('models.classes.products'))]) }}">
|
||||
title="{{ __('crud.helpers.create_model', ['model' => Str::singular(__('models.classes.product'))]) }}">
|
||||
<i class="fa-solid fa-plus"></i>
|
||||
</a>
|
||||
</div>
|
||||
|
|
@ -18,9 +18,8 @@
|
|||
@include('back::modules.table-col-sorter', [
|
||||
'cols' => [
|
||||
'name' => Str::ucfirst(__('validation.attributes.name')),
|
||||
'no_art' => Str::ucfirst(__('validation.custom.no_art')),
|
||||
'code_ean' => Str::ucfirst(__('validation.custom.ean_code')),
|
||||
'range_id' => Str::ucfirst(__('models.classes.ranges')),
|
||||
'range_id' => Str::ucfirst(__('models.classes.range')),
|
||||
],
|
||||
])
|
||||
</thead>
|
||||
|
|
@ -28,7 +27,6 @@
|
|||
@foreach ($productModels as $productModel)
|
||||
<tr class="border-bottom list-item">
|
||||
<td class="text-center align-middle">{{ $productModel->name }}</td>
|
||||
<td class="text-center align-middle">{{ $productModel->no_art }}</td>
|
||||
<td class="text-center align-middle">{{ $productModel->code_ean }}</td>
|
||||
<td class="text-center align-middle">{{ $productModel->range->name }}</td>
|
||||
<td class="text-end align-middle">
|
||||
|
|
@ -52,7 +50,7 @@
|
|||
@else
|
||||
<tr>
|
||||
<td class="fw-bold border-0 text-center">
|
||||
{{ __('crud.other.no_model_found', ['model' => Str::singular(__('models.classes.products'))]) }}</td>
|
||||
{{ __('crud.other.no_model_found', ['model' => Str::singular(__('models.classes.product'))]) }}</td>
|
||||
</tr>
|
||||
@endif
|
||||
</table>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
@extends('back::layout', ['brParam' => $rangeModel])
|
||||
|
||||
@section('title', __('Création d\'une :model', ['model' => Str::singular(__('models.classes.ranges'))]))
|
||||
@section('description', __('Création d\'une toute nouvelle :model', ['model' => Str::singular(__('models.classes.ranges'))]))
|
||||
@section('title', __('Création d\'une :model', ['model' => Str::singular(__('models.classes.range'))]))
|
||||
@section('description', __('Création d\'une toute nouvelle :model', ['model' => Str::singular(__('models.classes.range'))]))
|
||||
@section('breadcrumb',
|
||||
request()->route()->getName())
|
||||
|
||||
|
|
@ -9,14 +9,14 @@
|
|||
<div class="d-flex justify-content-between flex-md-nowrap align-items-center flex-wrap pb-3">
|
||||
<div class="d-flex align-items-center flex-row">
|
||||
<a class="btn btn-primary text-decoration-none m-0 me-2" data-bs-toggle="tooltip" data-bs-placement="top"
|
||||
href="{{ route('bo.ranges.index') }}" title="{{ __('crud.helpers.list_all', ['model' => __('models.classes.ranges')]) }}">
|
||||
href="{{ route('bo.ranges.index') }}" title="{{ __('crud.helpers.list_all', ['model' => __('models.classes.range')]) }}">
|
||||
<i class="fa-solid fa-arrow-left"></i>
|
||||
</a>
|
||||
@include('modules.breadcrumbs.breadcrumb-body', ['brParam' => $rangeModel])
|
||||
</div>
|
||||
<div class="mb-md-0 mb-2">
|
||||
<button class="btn btn-primary" id="formSubmitClone" data-bs-toggle="tooltip" data-bs-placement="top" type="submit"
|
||||
title="{{ __('crud.helpers.save_model', ['model' => Str::singular(__('models.classes.ranges'))]) }}">
|
||||
title="{{ __('crud.helpers.save_model', ['model' => Str::singular(__('models.classes.range'))]) }}">
|
||||
{{ __('crud.actions.save') }}
|
||||
</button>
|
||||
</div>
|
||||
|
|
@ -27,7 +27,7 @@
|
|||
<div class="row mt-3">
|
||||
<div class="col text-center">
|
||||
<button class="btn btn-primary" id="formSubmit" data-bs-toggle="tooltip" data-bs-placement="top" type="submit"
|
||||
title="{{ __('crud.helpers.save_model', ['model' => Str::singular(__('models.classes.ranges'))]) }}">
|
||||
title="{{ __('crud.helpers.save_model', ['model' => Str::singular(__('models.classes.range'))]) }}">
|
||||
{{ __('crud.actions.save') }}
|
||||
</button>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
@extends('back::layout', ['brParam' => $rangeModel])
|
||||
|
||||
@section('title', __('Édition d\'une :model', ['model' => Str::singular(__('models.classes.ranges'))]))
|
||||
@section('description', __('Édition d\'une :model déjà existante', ['model' => Str::singular(__('models.classes.ranges'))]))
|
||||
@section('title', __('Édition d\'une :model', ['model' => Str::singular(__('models.classes.range'))]))
|
||||
@section('description', __('Édition d\'une :model déjà existante', ['model' => Str::singular(__('models.classes.range'))]))
|
||||
@section('breadcrumb',
|
||||
request()->route()->getName())
|
||||
|
||||
|
|
@ -9,7 +9,7 @@
|
|||
<div class="d-flex justify-content-between flex-md-nowrap align-items-center flex-wrap pb-3">
|
||||
<div class="d-flex align-items-start flex-row">
|
||||
<a class="btn btn-primary text-decoration-none m-0 me-2" data-bs-toggle="tooltip" data-bs-placement="top"
|
||||
href="{{ route('bo.ranges.index') }}" title="{{ __('crud.helpers.list_all', ['model' => __('models.classes.ranges')]) }}">
|
||||
href="{{ route('bo.ranges.index') }}" title="{{ __('crud.helpers.list_all', ['model' => __('models.classes.range')]) }}">
|
||||
<i class="fa-solid fa-arrow-left"></i>
|
||||
</a>
|
||||
@include('modules.breadcrumbs.breadcrumb-body', ['brParam' => $rangeModel])
|
||||
|
|
@ -20,11 +20,11 @@
|
|||
@method('DELETE')
|
||||
<div class="btn-group" role="group">
|
||||
<button class="btn btn-primary" id="formSubmitClone" data-bs-toggle="tooltip" data-bs-placement="top" type="submit"
|
||||
title="{{ __('crud.helpers.save_model', ['model' => Str::singular(__('models.classes.ranges'))]) }}">
|
||||
title="{{ __('crud.helpers.save_model', ['model' => Str::singular(__('models.classes.range'))]) }}">
|
||||
{{ __('crud.actions.save') }}
|
||||
</button>
|
||||
<button class="btn btn-danger" data-bs-toggle="tooltip" data-bs-placement="top" type="submit"
|
||||
title="{{ __('crud.helpers.delete_model', ['model' => Str::singular(__('models.classes.ranges'))]) }}">
|
||||
title="{{ __('crud.helpers.delete_model', ['model' => Str::singular(__('models.classes.range'))]) }}">
|
||||
<i class="fa-solid fa-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
|
@ -38,7 +38,7 @@
|
|||
<div class="row">
|
||||
<div class="col text-center">
|
||||
<button class="btn btn-primary" id="formSubmit" data-bs-toggle="tooltip" data-bs-placement="top" type="submit"
|
||||
title="{{ __('crud.helpers.save_model', ['model' => Str::singular(__('models.classes.ranges'))]) }}">
|
||||
title="{{ __('crud.helpers.save_model', ['model' => Str::singular(__('models.classes.range'))]) }}">
|
||||
{{ __('crud.actions.save') }}
|
||||
</button>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
]),
|
||||
'placeholder' => __(':field de la :model', [
|
||||
'field' => Str::ucfirst(__('validation.attributes.name')),
|
||||
'model' => Str::singular(__('models.classes.ranges')),
|
||||
'model' => Str::singular(__('models.classes.range')),
|
||||
]),
|
||||
])
|
||||
</div>
|
||||
|
|
@ -31,22 +31,73 @@
|
|||
</fieldset>
|
||||
</div>
|
||||
{{-- PICTURE --}}
|
||||
<div class="col-12">
|
||||
<fieldset class="h-100 border p-3">
|
||||
<legend>{{ Str::ucfirst(__('validation.custom.picture')) }}</legend>
|
||||
<div class="row">
|
||||
<div class="col-12 pb-3">
|
||||
<fieldset class="container-fluid border p-3">
|
||||
<legend>{{ Str::ucfirst(__('validation.attributes.image')) }}</legend>
|
||||
<div class="row mb-3">
|
||||
{{-- PICTURE_ALT --}}
|
||||
<div class="col-12 col-md-6 m-md-0 mb-3">
|
||||
@include('back::partials.inputs.varchar', [
|
||||
'id' => 'rangePictureAlt',
|
||||
'label' => __(':field1 :inter1:field2 :inter2:model', [
|
||||
'field1' => Str::ucfirst(__('validation.custom.attribute_alt')),
|
||||
'inter1' => __('validation.custom.of_the.vowel'),
|
||||
'field2' => __('validation.attributes.image'),
|
||||
'inter2' => __('validation.custom.of_the.male'),
|
||||
'model' => __('models.classes.range'),
|
||||
]),
|
||||
'hasWordCounter' => true,
|
||||
'name' => 'picture_alt',
|
||||
'required' => false,
|
||||
'model' => $rangeModel ?? null,
|
||||
'helper' => __('crud.minicrud.picture_alt_helper'),
|
||||
'placeholder' => __(':field1 :inter1:field2 :inter2:model', [
|
||||
'field1' => Str::ucfirst(__('validation.custom.attribute_alt')),
|
||||
'inter1' => __('validation.custom.of_the.vowel'),
|
||||
'field2' => __('validation.attributes.image'),
|
||||
'inter2' => __('validation.custom.of_the.male'),
|
||||
'model' => __('models.classes.range'),
|
||||
]),
|
||||
])
|
||||
</div>
|
||||
{{-- PICTURE_TITLE --}}
|
||||
<div class="col-12 col-md-6 mb-3">
|
||||
@include('back::.partials.inputs.varchar', [
|
||||
'id' => 'rangePictureTitle',
|
||||
'label' => __(':field1 :inter1:field2 :inter2:model', [
|
||||
'field1' => Str::ucfirst(__('validation.custom.attribute_title')),
|
||||
'inter1' => __('validation.custom.of_the.vowel'),
|
||||
'field2' => __('validation.attributes.image'),
|
||||
'inter2' => __('validation.custom.of_the.male'),
|
||||
'model' => __('models.classes.range'),
|
||||
]),
|
||||
'hasWordCounter' => true,
|
||||
'name' => 'picture_title',
|
||||
'required' => false,
|
||||
'model' => $rangeModel ?? null,
|
||||
'helper' => __('crud.minicrud.picture_title_helper'),
|
||||
'placeholder' => __(':field1 :inter1:field2 :inter2:model', [
|
||||
'field1' => Str::ucfirst(__('validation.custom.attribute_title')),
|
||||
'inter1' => __('validation.custom.of_the.vowel'),
|
||||
'field2' => __('validation.attributes.image'),
|
||||
'inter2' => __('validation.custom.of_the.male'),
|
||||
'model' => __('models.classes.range'),
|
||||
]),
|
||||
])
|
||||
</div>
|
||||
{{-- PICTURE --}}
|
||||
<div class="col-12">
|
||||
@include('back::partials.inputs.varchar-picture', [
|
||||
'id' => 'rangePicture',
|
||||
'name' => 'picture',
|
||||
'width' => 500,
|
||||
'height' => 500,
|
||||
'width' => config('theme.models.ranges.picture_max_width'),
|
||||
'height' => config('theme.models.ranges.picture_max_height'),
|
||||
'model' => $rangeModel ?? null,
|
||||
'helper' => __('crud.minicrud.dimensions_must_be', [
|
||||
'widthpx' => '500px',
|
||||
'heightpx' => '500px',
|
||||
'widthpx' => config('theme.models.ranges.picture_max_width') . 'px',
|
||||
'heightpx' => config('theme.models.ranges.picture_max_height') . 'px',
|
||||
]),
|
||||
'required' => true,
|
||||
'required' => false,
|
||||
'preview' => true,
|
||||
])
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
@extends('back::layout')
|
||||
|
||||
@section('title', __('models.classes.ranges'))
|
||||
@section('description', __('Liste de toutes les :model', ['model' => __('models.classes.ranges')]))
|
||||
@section('title', __('models.classes.range'))
|
||||
@section('description', __('Liste de toutes les :model', ['model' => __('models.classes.range')]))
|
||||
|
||||
@section('content')
|
||||
<div class="d-flex justify-content-between flex-md-nowrap align-items-center flex-wrap">
|
||||
@include('modules.breadcrumbs.breadcrumb-body')
|
||||
<a class="btn btn-primary float-right" data-bs-toggle="tooltip" data-bs-placement="top" href="{{ route('bo.ranges.create') }}"
|
||||
title="{{ __('crud.helpers.create_model', ['model' => Str::singular(__('models.classes.ranges'))]) }}">
|
||||
title="{{ __('crud.helpers.create_model', ['model' => Str::singular(__('models.classes.range'))]) }}">
|
||||
<i class="fa-solid fa-plus"></i>
|
||||
</a>
|
||||
</div>
|
||||
|
|
@ -46,7 +46,7 @@
|
|||
@else
|
||||
<tr>
|
||||
<td class="fw-bold border-0 text-center">
|
||||
{{ __('crud.other.no_model_found', ['model' => Str::singular(__('models.classes.ranges'))]) }}</td>
|
||||
{{ __('crud.other.no_model_found', ['model' => Str::singular(__('models.classes.range'))]) }}</td>
|
||||
</tr>
|
||||
@endif
|
||||
</table>
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ Breadcrumbs::for('bo.gain-views.edit', function (Generator $trail, GainView $gai
|
|||
|
||||
// * PRIZES
|
||||
Breadcrumbs::for('bo.prizes.index', function (Generator $trail) {
|
||||
$trail->push(trans_choice('models.classes.prizes', 2), route('bo.prizes.index'));
|
||||
$trail->push(trans_choice('models.classes.prize', 2), route('bo.prizes.index'));
|
||||
});
|
||||
Breadcrumbs::for('bo.prizes.create', function (Generator $trail) {
|
||||
$trail->parent('bo.prizes.index');
|
||||
|
|
@ -88,7 +88,7 @@ Breadcrumbs::for('bo.prizes.edit', function (Generator $trail, Prize $prize) {
|
|||
|
||||
// * RANGES
|
||||
Breadcrumbs::for('bo.ranges.index', function (Generator $trail) {
|
||||
$trail->push(trans_choice('models.classes.ranges', 2), route('bo.ranges.index'));
|
||||
$trail->push(trans_choice('models.classes.range', 2), route('bo.ranges.index'));
|
||||
});
|
||||
Breadcrumbs::for('bo.ranges.create', function (Generator $trail) {
|
||||
$trail->parent('bo.ranges.index');
|
||||
|
|
@ -101,7 +101,7 @@ Breadcrumbs::for('bo.ranges.edit', function (Generator $trail, Range $range) {
|
|||
|
||||
// * PRODUCTS
|
||||
Breadcrumbs::for('bo.products.index', function (Generator $trail) {
|
||||
$trail->push(trans_choice('models.classes.products', 2), route('bo.products.index'));
|
||||
$trail->push(trans_choice('models.classes.product', 2), route('bo.products.index'));
|
||||
});
|
||||
Breadcrumbs::for('bo.products.create', function (Generator $trail) {
|
||||
$trail->parent('bo.products.index');
|
||||
|
|
|
|||
|
|
@ -2,19 +2,19 @@
|
|||
|
||||
use App\Http\Controllers\Bo\ActivityLogController;
|
||||
use App\Http\Controllers\Bo\BannedIpController;
|
||||
use App\Http\Controllers\Bo\CodesController;
|
||||
use App\Http\Controllers\Bo\CodeController;
|
||||
use App\Http\Controllers\Bo\DashboardController;
|
||||
use App\Http\Controllers\Bo\FaqQuestionsController;
|
||||
use App\Http\Controllers\Bo\FaqThemesController;
|
||||
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\PrizesController;
|
||||
use App\Http\Controllers\Bo\ProductsController;
|
||||
use App\Http\Controllers\Bo\PrizeController;
|
||||
use App\Http\Controllers\Bo\ProductController;
|
||||
use App\Http\Controllers\Bo\RangeController;
|
||||
use App\Http\Controllers\Bo\SettingsController;
|
||||
use App\Http\Controllers\Bo\StaticPageController;
|
||||
use App\Http\Controllers\Bo\UserController;
|
||||
use App\Http\Controllers\Bo\WinnersListController;
|
||||
use App\Http\Controllers\Bo\WinnerListController;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
|
@ -63,13 +63,13 @@ Route::prefix('bo')->name('bo.')->group(function () {
|
|||
|
||||
Route::middleware(['is-super-admin'])->group(function () {
|
||||
// * FAQ - THEMES
|
||||
Route::resource('/faq-themes', FaqThemesController::class)->except('show');
|
||||
Route::resource('/faq-themes', FaqThemeController::class)->except('show');
|
||||
// * FAQ - QUESTIONS
|
||||
Route::resource('/faq-questions', FaqQuestionsController::class)->except('show');
|
||||
Route::resource('/faq-questions', FaqQuestionController::class)->except('show');
|
||||
// * GAIN VIEWS
|
||||
Route::resource('/gain-views', GainViewController::class)->except('show');
|
||||
// * PRIZES
|
||||
Route::resource('/prizes', PrizesController::class)
|
||||
Route::resource('/prizes', PrizeController::class)
|
||||
->except('show')
|
||||
->withoutMiddleware('htmlsanitize')
|
||||
->middleware(['htmlsanitize:arg_content']);
|
||||
|
|
@ -78,22 +78,22 @@ Route::prefix('bo')->name('bo.')->group(function () {
|
|||
->except('show')
|
||||
->withoutMiddleware('is-super-admin');
|
||||
// * PRODUCTS
|
||||
Route::resource('products', ProductsController::class)
|
||||
Route::resource('products', ProductController::class)
|
||||
->except('show')
|
||||
->withoutMiddleware('is-super-admin');
|
||||
// * SETTINGS.
|
||||
Route::resource('/settings', SettingsController::class)
|
||||
->only(['edit', 'update']);
|
||||
// * WINNERS LIST
|
||||
Route::get('/winners-list', [WinnersListController::class, 'index'])->name('winners-list');
|
||||
Route::get('/winners-list', [WinnerListController::class, 'index'])->name('winners-list');
|
||||
// * INSTANT WIN
|
||||
Route::get('/instant-win', [InstantWinController::class, 'index'])->name('instant-win');
|
||||
Route::get('/ajax/instant-win-generate', [InstantWinController::class, 'instantWinGenerate']);
|
||||
// * UNIQUES CODES.
|
||||
Route::get('/codes', [CodesController::class, 'index'])->name('codes');
|
||||
Route::post('/codes', [CodesController::class, 'generate'])->name('generate-codes');
|
||||
Route::get('/codes/search', [CodesController::class, 'search'])->name('codes.search');
|
||||
Route::post('/codes/export', [CodesController::class, 'export'])->name('export-codes');
|
||||
Route::get('/codes', [CodeController::class, 'index'])->name('codes');
|
||||
Route::post('/codes', [CodeController::class, 'generate'])->name('generate-codes');
|
||||
Route::get('/codes/search', [CodeController::class, 'search'])->name('codes.search');
|
||||
Route::post('/codes/export', [CodeController::class, 'export'])->name('export-codes');
|
||||
|
||||
// * BANNED IPS
|
||||
Route::resource('/bannedips', BannedIpController::class)->except('show');
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ use App\Http\Controllers\Fo\FAQController;
|
|||
use App\Http\Controllers\Fo\GainsController;
|
||||
use App\Http\Controllers\Fo\HomeController;
|
||||
use App\Http\Controllers\Fo\HowToPlayController;
|
||||
use App\Http\Controllers\Fo\ProduitsController;
|
||||
use App\Http\Controllers\Fo\TeaserController;
|
||||
use App\Http\Controllers\Fo\StaticPageController;
|
||||
use App\Http\Controllers\Fo\WinningProofController;
|
||||
|
|
@ -45,13 +44,12 @@ Route::middleware(['throttle:credentials'])->name('fo.')->group(function () {
|
|||
|
||||
|
||||
Route::get('/', [HomeController::class, 'home'])->name('homepage');
|
||||
|
||||
Route::get('produits-porteurs', [HomeController::class, 'showProducts'])->name('produits-porteurs');
|
||||
Route::get('reglement', [StaticPageController::class, 'reglement'])->name('reglement');
|
||||
Route::get('charte', [StaticPageController::class, 'charte'])->name('charte');
|
||||
Route::get('mentions-legales', [StaticPageController::class, 'legals'])->name('legals');
|
||||
Route::get('faq', [FAQController::class, 'index'])->name('faq');
|
||||
Route::get('comment-jouer', [HowToPlayController::class, 'index'])->name('comment-jouer');
|
||||
Route::get('les-gains', [GainsController::class, 'index'])->name('les-gains');
|
||||
Route::get('produits-porteurs', [ProduitsController::class, 'index'])->name('produits-porteurs');
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue