update CRUD question
This commit is contained in:
parent
1f7455de5a
commit
05b4f83009
28 changed files with 1163 additions and 212 deletions
|
|
@ -69,7 +69,6 @@ class CustomerController extends Controller
|
|||
Session::remove("crud.$modelTable.sort_col");
|
||||
}
|
||||
|
||||
|
||||
if (request()->brand or Session::has("crud.$modelTable.brand")) {
|
||||
$brand = $request->brand ?? Session::get("crud.$modelTable.brand");
|
||||
Session::put("crud.$modelTable.brand", $brand);
|
||||
|
|
@ -194,7 +193,7 @@ class CustomerController extends Controller
|
|||
});
|
||||
} catch (\ErrorException $e) {
|
||||
return redirect()->route('customers.index')
|
||||
->with('error', trans('Le compte n\'as pas pu être supprimé.'));
|
||||
->with('error', trans('Le compte n\'a pas pu être supprimé.'));
|
||||
} //end try
|
||||
|
||||
return redirect()->route('customers.index')->with('warning', trans('Compte supprimé.'));
|
||||
|
|
|
|||
|
|
@ -4,14 +4,14 @@ namespace App\Http\Controllers;
|
|||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\QuestionExport;
|
||||
use App\Http\Requests\Questions\StoreQuestionRequest;
|
||||
use App\Http\Requests\Questions\UpdateQuestionRequest;
|
||||
use App\Models\Brand;
|
||||
use App\Models\Question;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Str;
|
||||
use Kwaadpepper\CrudPolicies\Http\Requests\CrudIndexRequest;
|
||||
use Kwaadpepper\CrudPolicies\Traits\CrudController;
|
||||
use League\Csv\Writer;
|
||||
use Symfony\Component\HttpFoundation\StreamedResponse;
|
||||
|
||||
|
|
@ -20,48 +20,163 @@ use Symfony\Component\HttpFoundation\StreamedResponse;
|
|||
*/
|
||||
class QuestionController extends Controller
|
||||
{
|
||||
use CrudController {
|
||||
index as crudIndex;
|
||||
}
|
||||
|
||||
/** @var Question */
|
||||
public static $modelClass = Question::class;
|
||||
|
||||
/**
|
||||
* The Bo app layout
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public static $layout = 'layouts.app';
|
||||
|
||||
/**
|
||||
* Event index crud-policies
|
||||
*
|
||||
* @param Builder $query
|
||||
* @return Builder
|
||||
*/
|
||||
public function indexQuery(Builder $query): Builder
|
||||
{
|
||||
if (request()->brand) {
|
||||
$query = $query->where('brand_id', '=', request()->brand);
|
||||
}
|
||||
return $query;
|
||||
}
|
||||
|
||||
/**
|
||||
* Overload crud-policies index
|
||||
*
|
||||
* @param CrudIndexRequest $request
|
||||
* @param Request $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index(CrudIndexRequest $request)
|
||||
public function index(Request $request)
|
||||
{
|
||||
/** @var \Illuminate\View\View */
|
||||
$view = $this->crudIndex($request);
|
||||
if ($request->ajax()) {
|
||||
return $view;
|
||||
$modelTable = (new Question())->getTable();
|
||||
$modelClass = Question::class;
|
||||
$query = Question::query();
|
||||
|
||||
if ($request->brand) {
|
||||
$query = $query->where('brand_id', '=', request()->brand);
|
||||
}
|
||||
return view('question.index', $view->getData());
|
||||
if ($request->search) {
|
||||
$this->searchQuery(
|
||||
$query,
|
||||
$request->search,
|
||||
null,
|
||||
'question',
|
||||
);
|
||||
}
|
||||
|
||||
$this->sortQuery($query);
|
||||
|
||||
/** @var \Illuminate\Pagination\AbstractPaginator */
|
||||
$questionModels = $query->paginate(12);
|
||||
|
||||
return view('questions.index', compact(
|
||||
'modelClass',
|
||||
'modelTable',
|
||||
'questionModels'
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @param \App\Models\Question $question
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function create(Question $question)
|
||||
{
|
||||
$brandModels = Brand::get();
|
||||
|
||||
return view('questions.create', [
|
||||
'questionModel' => $question,
|
||||
'brandModels' => $brandModels
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param \App\Http\Requests\Questions\StoreQuestionRequest $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(StoreQuestionRequest $request)
|
||||
{
|
||||
return DB::transaction(function () use ($request) {
|
||||
$question = new Question();
|
||||
$question->fill($request->validated());
|
||||
if ($question->saveOrFail()) {
|
||||
return redirect()
|
||||
->route('questions.edit', $question)
|
||||
->with('success', trans(
|
||||
':model a été créé.',
|
||||
['model' => Str::singular(trans('models.classes.questions'))]
|
||||
));
|
||||
}
|
||||
return redirect()
|
||||
->back()
|
||||
->with('error', trans(
|
||||
':model n\'a pas été créé.',
|
||||
['model' => Str::singular(trans('models.classes.questions'))]
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param \App\Models\Question $question
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit(Question $question)
|
||||
{
|
||||
$brandModels = Brand::get();
|
||||
|
||||
return view('questions.edit', [
|
||||
'questionModel' => $question,
|
||||
'brandModels' => $brandModels
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update a spacific resource in storage.
|
||||
*
|
||||
* @param \App\Http\Requests\Questions\UpdateQuestionRequest $request
|
||||
* @param \App\Models\Question $question
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(UpdateQuestionRequest $request, Question $question)
|
||||
{
|
||||
return DB::transaction(function () use ($request, $question) {
|
||||
$question->fill($request->validated());
|
||||
if ($question->saveOrFail()) {
|
||||
return redirect()
|
||||
->route('questions.edit', $question)
|
||||
->with('success', trans(
|
||||
':model a été mis à jour.',
|
||||
['model' => Str::singular(trans('models.classes.questions'))]
|
||||
));
|
||||
}
|
||||
return redirect()
|
||||
->back()
|
||||
->with('error', trans(
|
||||
':model n\'a pas été mis à jour.',
|
||||
['model' => Str::singular(trans('models.classes.questions'))]
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the specified resource.
|
||||
*
|
||||
* @param \App\Models\Question $question
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show(Question $question)
|
||||
{
|
||||
return view('questions.show', [
|
||||
'questionModel' => $question
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param \App\Models\Question $question
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function destroy(Question $question): \Illuminate\Http\RedirectResponse
|
||||
{
|
||||
if ($question->deleteOrFail()) {
|
||||
return redirect()->route('questions.index')
|
||||
->with('success', trans(
|
||||
':model a été supprimé.',
|
||||
['model' => Str::singular(trans('models.classes.questions'))]
|
||||
));
|
||||
}
|
||||
return redirect()->back()
|
||||
->with('error', trans(
|
||||
':model n\'a pas pu être supprimé.',
|
||||
['model' => Str::singular(trans('models.classes.questions'))]
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -72,7 +187,21 @@ class QuestionController extends Controller
|
|||
public function export()
|
||||
{
|
||||
$brands = Brand::all();
|
||||
return view('question.export', compact('brands'));
|
||||
return view('questions.export', compact('brands'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function jsonPaginate()
|
||||
{
|
||||
return DB::transaction(function () {
|
||||
/** @var \App\Models\Tag */
|
||||
$brandModels = Brand::paginate(12);
|
||||
return \response()->json($brandModels ?? 500);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
44
app/Http/Requests/Questions/StoreQuestionRequest.php
Normal file
44
app/Http/Requests/Questions/StoreQuestionRequest.php
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Requests\Questions;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StoreQuestionRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return auth()->check();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'question' => 'required|string|min:5|max:255',
|
||||
'type' => 'required|integer|min:0',
|
||||
'brand_id' => 'required|integer|min:0',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get custom attributes for validator errors.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function attributes(): array
|
||||
{
|
||||
return [
|
||||
'name' => trans('Nom de la marque'),
|
||||
];
|
||||
}
|
||||
}
|
||||
7
app/Http/Requests/Questions/UpdateQuestionRequest.php
Normal file
7
app/Http/Requests/Questions/UpdateQuestionRequest.php
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Requests\Questions;
|
||||
|
||||
class UpdateQuestionRequest extends StoreQuestionRequest
|
||||
{
|
||||
}
|
||||
111
package-lock.json
generated
111
package-lock.json
generated
|
|
@ -11,6 +11,8 @@
|
|||
"@fortawesome/free-solid-svg-icons": "^6.4.0",
|
||||
"@rushstack/eslint-patch": "^1.3.1",
|
||||
"@types/bootstrap": "^5.2.6",
|
||||
"@types/vue-select": "^3.16.2",
|
||||
"@types/webpack-env": "^1.18.1",
|
||||
"@typescript-eslint/eslint-plugin": "^5.59.9",
|
||||
"@typescript-eslint/parser": "^5.59.9",
|
||||
"@vue/eslint-config-typescript": "^11.0.3",
|
||||
|
|
@ -32,6 +34,7 @@
|
|||
"resolve-url-loader": "^3.1.3",
|
||||
"sass": "^1.32.11",
|
||||
"sass-loader": "^11.0.1",
|
||||
"slugify": "^1.6.6",
|
||||
"stylelint": "^14.11.0",
|
||||
"stylelint-config-idiomatic-order": "^8.1.0",
|
||||
"stylelint-config-prettier": "^9.0.5",
|
||||
|
|
@ -45,7 +48,8 @@
|
|||
"typescript-eslint": "^0.0.1-alpha.0",
|
||||
"vue": "^3.2.38",
|
||||
"vue-eslint-parser": "^9.1.0",
|
||||
"vue-loader": "^16.8.3"
|
||||
"vue-loader": "^16.8.3",
|
||||
"vue-select": "^4.0.0-beta.3"
|
||||
}
|
||||
},
|
||||
"node_modules/@ampproject/remapping": {
|
||||
|
|
@ -2611,6 +2615,42 @@
|
|||
"integrity": "sha512-AZU7vQcy/4WFEuwnwsNsJnFwupIpbllH1++LXScN6uxT1Z4zPzdrWG97w4/I7eFKFTvfy/bHFStWjdBAg2Vjug==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/vue-select": {
|
||||
"version": "3.16.2",
|
||||
"resolved": "https://registry.npmjs.org/@types/vue-select/-/vue-select-3.16.2.tgz",
|
||||
"integrity": "sha512-KkmQiNI7Cei2YV3wn7O2fmM6PpfuM9ybYFMDqq2AvIZNZ2BRHMMV70yaa1EKBRvqu5qY5ekel5WzcRRfNu56PQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"vue": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/vue-select/node_modules/@vue/compiler-sfc": {
|
||||
"version": "2.7.14",
|
||||
"resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-2.7.14.tgz",
|
||||
"integrity": "sha512-aNmNHyLPsw+sVvlQFQ2/8sjNuLtK54TC6cuKnVzAY93ks4ZBrvwQSnkkIh7bsbNhum5hJBS00wSDipQ937f5DA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@babel/parser": "^7.18.4",
|
||||
"postcss": "^8.4.14",
|
||||
"source-map": "^0.6.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/vue-select/node_modules/vue": {
|
||||
"version": "2.7.14",
|
||||
"resolved": "https://registry.npmjs.org/vue/-/vue-2.7.14.tgz",
|
||||
"integrity": "sha512-b2qkFyOM0kwqWFuQmgd4o+uHGU7T+2z3T+WQp8UBjADfEv2n4FEMffzBmCKNP0IGzOEEfYjvtcC62xaSKeQDrQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@vue/compiler-sfc": "2.7.14",
|
||||
"csstype": "^3.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/webpack-env": {
|
||||
"version": "1.18.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/webpack-env/-/webpack-env-1.18.1.tgz",
|
||||
"integrity": "sha512-D0HJET2/UY6k9L6y3f5BL+IDxZmPkYmPT4+qBrRdmRLYRuV0qNKizMgTvYxXZYn+36zjPeoDZAEYBCM6XB+gww==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/ws": {
|
||||
"version": "8.5.5",
|
||||
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.5.tgz",
|
||||
|
|
@ -10387,6 +10427,15 @@
|
|||
"url": "https://github.com/chalk/slice-ansi?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/slugify": {
|
||||
"version": "1.6.6",
|
||||
"resolved": "https://registry.npmjs.org/slugify/-/slugify-1.6.6.tgz",
|
||||
"integrity": "sha512-h+z7HKHYXj6wJU+AnS/+IH8Uh9fdcX1Lrhg1/VMdf9PwoBQXFcXiAdsy2tSK0P6gKwJLXp02r90ahUCqHk9rrw==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=8.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/sockjs": {
|
||||
"version": "0.3.24",
|
||||
"resolved": "https://registry.npmjs.org/sockjs/-/sockjs-0.3.24.tgz",
|
||||
|
|
@ -11688,6 +11737,15 @@
|
|||
"webpack": "^4.1.0 || ^5.0.0-0"
|
||||
}
|
||||
},
|
||||
"node_modules/vue-select": {
|
||||
"version": "4.0.0-beta.3",
|
||||
"resolved": "https://registry.npmjs.org/vue-select/-/vue-select-4.0.0-beta.3.tgz",
|
||||
"integrity": "sha512-sXufbTDluz26a39UUZE9jeh9Hojnn8zr9qDDUlVEBc7E0F+h3+Nzy8YzyFHuVNrrYLmK0zrPkb7hWFulAEW41Q==",
|
||||
"dev": true,
|
||||
"peerDependencies": {
|
||||
"vue": "3.x"
|
||||
}
|
||||
},
|
||||
"node_modules/vue-style-loader": {
|
||||
"version": "4.1.3",
|
||||
"resolved": "https://registry.npmjs.org/vue-style-loader/-/vue-style-loader-4.1.3.tgz",
|
||||
|
|
@ -14152,6 +14210,44 @@
|
|||
"integrity": "sha512-AZU7vQcy/4WFEuwnwsNsJnFwupIpbllH1++LXScN6uxT1Z4zPzdrWG97w4/I7eFKFTvfy/bHFStWjdBAg2Vjug==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/vue-select": {
|
||||
"version": "3.16.2",
|
||||
"resolved": "https://registry.npmjs.org/@types/vue-select/-/vue-select-3.16.2.tgz",
|
||||
"integrity": "sha512-KkmQiNI7Cei2YV3wn7O2fmM6PpfuM9ybYFMDqq2AvIZNZ2BRHMMV70yaa1EKBRvqu5qY5ekel5WzcRRfNu56PQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"vue": "^2.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vue/compiler-sfc": {
|
||||
"version": "2.7.14",
|
||||
"resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-2.7.14.tgz",
|
||||
"integrity": "sha512-aNmNHyLPsw+sVvlQFQ2/8sjNuLtK54TC6cuKnVzAY93ks4ZBrvwQSnkkIh7bsbNhum5hJBS00wSDipQ937f5DA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/parser": "^7.18.4",
|
||||
"postcss": "^8.4.14",
|
||||
"source-map": "^0.6.1"
|
||||
}
|
||||
},
|
||||
"vue": {
|
||||
"version": "2.7.14",
|
||||
"resolved": "https://registry.npmjs.org/vue/-/vue-2.7.14.tgz",
|
||||
"integrity": "sha512-b2qkFyOM0kwqWFuQmgd4o+uHGU7T+2z3T+WQp8UBjADfEv2n4FEMffzBmCKNP0IGzOEEfYjvtcC62xaSKeQDrQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@vue/compiler-sfc": "2.7.14",
|
||||
"csstype": "^3.1.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"@types/webpack-env": {
|
||||
"version": "1.18.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/webpack-env/-/webpack-env-1.18.1.tgz",
|
||||
"integrity": "sha512-D0HJET2/UY6k9L6y3f5BL+IDxZmPkYmPT4+qBrRdmRLYRuV0qNKizMgTvYxXZYn+36zjPeoDZAEYBCM6XB+gww==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/ws": {
|
||||
"version": "8.5.5",
|
||||
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.5.tgz",
|
||||
|
|
@ -20031,6 +20127,12 @@
|
|||
"is-fullwidth-code-point": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"slugify": {
|
||||
"version": "1.6.6",
|
||||
"resolved": "https://registry.npmjs.org/slugify/-/slugify-1.6.6.tgz",
|
||||
"integrity": "sha512-h+z7HKHYXj6wJU+AnS/+IH8Uh9fdcX1Lrhg1/VMdf9PwoBQXFcXiAdsy2tSK0P6gKwJLXp02r90ahUCqHk9rrw==",
|
||||
"dev": true
|
||||
},
|
||||
"sockjs": {
|
||||
"version": "0.3.24",
|
||||
"resolved": "https://registry.npmjs.org/sockjs/-/sockjs-0.3.24.tgz",
|
||||
|
|
@ -21002,6 +21104,13 @@
|
|||
"loader-utils": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"vue-select": {
|
||||
"version": "4.0.0-beta.3",
|
||||
"resolved": "https://registry.npmjs.org/vue-select/-/vue-select-4.0.0-beta.3.tgz",
|
||||
"integrity": "sha512-sXufbTDluz26a39UUZE9jeh9Hojnn8zr9qDDUlVEBc7E0F+h3+Nzy8YzyFHuVNrrYLmK0zrPkb7hWFulAEW41Q==",
|
||||
"dev": true,
|
||||
"requires": {}
|
||||
},
|
||||
"vue-style-loader": {
|
||||
"version": "4.1.3",
|
||||
"resolved": "https://registry.npmjs.org/vue-style-loader/-/vue-style-loader-4.1.3.tgz",
|
||||
|
|
|
|||
|
|
@ -20,6 +20,8 @@
|
|||
"@fortawesome/free-solid-svg-icons": "^6.4.0",
|
||||
"@rushstack/eslint-patch": "^1.3.1",
|
||||
"@types/bootstrap": "^5.2.6",
|
||||
"@types/vue-select": "^3.16.2",
|
||||
"@types/webpack-env": "^1.18.1",
|
||||
"@typescript-eslint/eslint-plugin": "^5.59.9",
|
||||
"@typescript-eslint/parser": "^5.59.9",
|
||||
"@vue/eslint-config-typescript": "^11.0.3",
|
||||
|
|
@ -41,6 +43,7 @@
|
|||
"resolve-url-loader": "^3.1.3",
|
||||
"sass": "^1.32.11",
|
||||
"sass-loader": "^11.0.1",
|
||||
"slugify": "^1.6.6",
|
||||
"stylelint": "^14.11.0",
|
||||
"stylelint-config-idiomatic-order": "^8.1.0",
|
||||
"stylelint-config-prettier": "^9.0.5",
|
||||
|
|
@ -54,6 +57,7 @@
|
|||
"typescript-eslint": "^0.0.1-alpha.0",
|
||||
"vue": "^3.2.38",
|
||||
"vue-eslint-parser": "^9.1.0",
|
||||
"vue-loader": "^16.8.3"
|
||||
"vue-loader": "^16.8.3",
|
||||
"vue-select": "^4.0.0-beta.3"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import "./utilities/vue";
|
|||
|
||||
// CUSTOM
|
||||
import "./pages/customer.delete";
|
||||
import "./pages/data.delete";
|
||||
import "./pages/service.index";
|
||||
import "./pages/single_optin.index";
|
||||
import "./pages/statsExport";
|
||||
|
|
|
|||
111
resources/ts/components/InputTextAutoComponent.vue
Normal file
111
resources/ts/components/InputTextAutoComponent.vue
Normal file
|
|
@ -0,0 +1,111 @@
|
|||
<template>
|
||||
<div :class="`input-text-auto-component-${intName}`">
|
||||
<WordCounter
|
||||
:id="intId"
|
||||
class="ck-word-count"
|
||||
/>
|
||||
<textarea
|
||||
ref="textarea"
|
||||
:id="intId"
|
||||
:class="`input-text-auto-component-input need-word-counter ${intClass}`"
|
||||
:name="intName"
|
||||
:aria-describedby="intAriaDescribedby"
|
||||
:placeholder="intPlaceholder"
|
||||
:required="intRequired"
|
||||
@input="onInput"
|
||||
@blur="onBlur"
|
||||
v-model="intValue"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent, ref } from "vue";
|
||||
import trans from "./../modules/trans";
|
||||
import WordCounter from "./WordCounterComponent.vue";
|
||||
|
||||
const textarea = ref<HTMLTextAreaElement | null>(null);
|
||||
|
||||
export default defineComponent({
|
||||
name: "InputTextAutoComponent",
|
||||
inheritAttrs: false,
|
||||
mixins: [trans],
|
||||
components: {
|
||||
WordCounter,
|
||||
},
|
||||
setup() {
|
||||
return { textarea };
|
||||
},
|
||||
beforeMount() {
|
||||
if (!this.$attrs.json) {
|
||||
throw new Error("this component requires json");
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
const json = String(this.$attrs.json ?? "{}"),
|
||||
data = JSON.parse(json);
|
||||
this.intId = String(data.id);
|
||||
this.intClass = String(data.class);
|
||||
this.intName = String(data.name);
|
||||
this.intPlaceholder = String(data.placeholder);
|
||||
this.intAriaDescribedby = String(data.ariaDescribedby);
|
||||
this.intValue = String(data.value);
|
||||
if (data.required) {
|
||||
this.intRequired = true;
|
||||
}
|
||||
if (this.textarea) {
|
||||
// Default input init
|
||||
this.textarea.setAttribute("style", "height: 1rem;overflow-y: hidden;");
|
||||
}
|
||||
// * Init input
|
||||
this.$nextTick(this.onInput);
|
||||
},
|
||||
data(): {
|
||||
intId: string;
|
||||
intClass: string;
|
||||
intName: string;
|
||||
intPlaceholder: string;
|
||||
intAriaDescribedby: string;
|
||||
intRequired: boolean;
|
||||
intValue: string;
|
||||
} {
|
||||
return {
|
||||
intId: "",
|
||||
intClass: "",
|
||||
intName: "",
|
||||
intPlaceholder: "",
|
||||
intAriaDescribedby: "",
|
||||
intRequired: false,
|
||||
intValue: "",
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
onBlur() {
|
||||
const el = textarea.value;
|
||||
if (!el) {
|
||||
throw new Error("undefined textarea element");
|
||||
}
|
||||
// * Remove every new line char
|
||||
el.value = el.value.replace(/[\n\r]/g, "");
|
||||
this.$nextTick(() => {
|
||||
el.style.height = "auto";
|
||||
el.style.height = `${el.scrollHeight}px`;
|
||||
});
|
||||
},
|
||||
onInput() {
|
||||
const el = textarea.value;
|
||||
if (!el) {
|
||||
throw new Error("undefined textarea element");
|
||||
}
|
||||
el.style.height = "auto";
|
||||
el.style.height = `${el.scrollHeight}px`;
|
||||
},
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.input-text-auto-component-input {
|
||||
resize: none;
|
||||
}
|
||||
</style>
|
||||
199
resources/ts/components/SearchBelongsToManyDropdownComponent.vue
Normal file
199
resources/ts/components/SearchBelongsToManyDropdownComponent.vue
Normal file
|
|
@ -0,0 +1,199 @@
|
|||
<template>
|
||||
<div>
|
||||
<Transition name="fade">
|
||||
<p
|
||||
v-if="message"
|
||||
class="message"
|
||||
>
|
||||
{{ message }}
|
||||
</p>
|
||||
</Transition>
|
||||
<VueSelect
|
||||
:id="name"
|
||||
ref="select"
|
||||
:loading="loading"
|
||||
v-model="modelsRelated"
|
||||
:clearable="false"
|
||||
label="name"
|
||||
:options="data"
|
||||
@search="search"
|
||||
:filterable="true"
|
||||
:disabled="dReadonly || dDisabled"
|
||||
:searchable="true"
|
||||
placeholder="Une marque existante"
|
||||
>
|
||||
<template #list-footer>
|
||||
<li class="pagination">
|
||||
<button
|
||||
@click="
|
||||
$event.preventDefault();
|
||||
page -= 1;
|
||||
"
|
||||
:disabled="!hasPrevPage"
|
||||
class="btn btn-sm btn-primary mt-2 mb-2 ms-2 me-2"
|
||||
>
|
||||
{{ __("Précédent") }}
|
||||
</button>
|
||||
<button
|
||||
@click="
|
||||
$event.preventDefault();
|
||||
page += 1;
|
||||
"
|
||||
:disabled="!hasNextPage"
|
||||
class="btn btn-sm btn-primary mt-2 mb-2"
|
||||
>
|
||||
{{ __("Suivant") }}
|
||||
</button>
|
||||
</li>
|
||||
</template>
|
||||
</VueSelect>
|
||||
<input
|
||||
type="hidden"
|
||||
v-model="modelsRelated.id"
|
||||
:name="name"
|
||||
>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from "vue";
|
||||
import route from "../modules/route";
|
||||
import trans from "./../modules/trans";
|
||||
import VueSelect from "vue-select";
|
||||
|
||||
export default defineComponent({
|
||||
components: {
|
||||
VueSelect,
|
||||
},
|
||||
mixins: [route, trans],
|
||||
data(): {
|
||||
name: string;
|
||||
dDisabled: boolean;
|
||||
dReadonly: boolean;
|
||||
modelsRelated: VselectOption;
|
||||
loading: boolean;
|
||||
searchText: string;
|
||||
data: LaravelModelList;
|
||||
page: number;
|
||||
perPage: number;
|
||||
hasNextPage: boolean;
|
||||
hasPrevPage: boolean;
|
||||
message: string | null;
|
||||
} {
|
||||
return {
|
||||
name: "",
|
||||
dDisabled: false,
|
||||
dReadonly: false,
|
||||
modelsRelated: {
|
||||
id: 0,
|
||||
name: "",
|
||||
value: 0,
|
||||
},
|
||||
loading: false,
|
||||
searchText: "",
|
||||
data: [],
|
||||
page: 1,
|
||||
perPage: 12,
|
||||
hasNextPage: true,
|
||||
hasPrevPage: false,
|
||||
message: null,
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
const json = String(this.$attrs.json ?? "{}"),
|
||||
data = JSON.parse(json);
|
||||
this.name = data.name;
|
||||
this.dDisabled = !!data.disabled;
|
||||
this.dReadonly = !!data.readonly;
|
||||
if (data.modelSelected) {
|
||||
this.modelsRelated = data.modelSelected;
|
||||
} else if (data.modelsRelated) {
|
||||
this.modelsRelated = data.modelsRelated;
|
||||
} else {
|
||||
this.modelsRelated = {
|
||||
id: 0,
|
||||
name: "",
|
||||
value: 0,
|
||||
};
|
||||
}
|
||||
this.search(false);
|
||||
},
|
||||
watch: {
|
||||
page() {
|
||||
if (this.page < 1) {
|
||||
this.page = 1;
|
||||
}
|
||||
if (this.page > 1) {
|
||||
this.hasPrevPage = true;
|
||||
} else {
|
||||
this.hasPrevPage = false;
|
||||
}
|
||||
this.search();
|
||||
},
|
||||
data() {
|
||||
if (this.data.length == this.perPage) {
|
||||
this.hasNextPage = true;
|
||||
} else {
|
||||
this.hasNextPage = false;
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
search(search: false | null | string = null): void {
|
||||
if (search !== false && search !== null) {
|
||||
this.searchText = search;
|
||||
}
|
||||
let init = search === false ? true : false,
|
||||
routeUrl = this.route("questions.jsonPaginate");
|
||||
|
||||
if (!routeUrl) {
|
||||
throw new Error("undefined route questions.jsonPaginate");
|
||||
}
|
||||
|
||||
if (this.page) {
|
||||
routeUrl += "?page=" + this.page;
|
||||
}
|
||||
if (this.searchText) {
|
||||
routeUrl += "&s=" + this.searchText;
|
||||
}
|
||||
|
||||
this.loading = true;
|
||||
|
||||
window.axios
|
||||
.get(routeUrl)
|
||||
.then((response) => {
|
||||
this.data = response.data.data as LaravelModelList;
|
||||
if (init && this.data.length && this.modelsRelated.value === null) {
|
||||
this.modelsRelated = this.data[0] as VselectOption;
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
this.message =
|
||||
"Erreur lors de l'opération, merci d'actualiser la page.";
|
||||
if (e.response?.status === 422) {
|
||||
const errors = e.response?.data?.errors;
|
||||
if (errors instanceof String) {
|
||||
this.message = errors as string;
|
||||
}
|
||||
if (errors instanceof Object) {
|
||||
this.message = Object.values(errors).reduce(function (
|
||||
previous,
|
||||
current
|
||||
) {
|
||||
return String(previous) + String(current);
|
||||
}) as string;
|
||||
}
|
||||
console.warn(errors);
|
||||
}
|
||||
})
|
||||
.then(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import "./../../../node_modules/vue-select/dist/vue-select.css";
|
||||
</style>
|
||||
8
resources/ts/index.d.ts
vendored
8
resources/ts/index.d.ts
vendored
|
|
@ -7,6 +7,12 @@ interface EnumInterface {
|
|||
value: number | string;
|
||||
}
|
||||
|
||||
type VselectOptionType = {
|
||||
id: number;
|
||||
name: string;
|
||||
value: number | string;
|
||||
};
|
||||
|
||||
// * Laravel Paginator
|
||||
|
||||
interface PaginatorLink {
|
||||
|
|
@ -66,8 +72,8 @@ declare global {
|
|||
type LaravelModelList = ModelList;
|
||||
type LaravelPaginator = Paginator;
|
||||
type LaravelPaginatorLink = PaginatorLink;
|
||||
|
||||
type Enum = EnumInterface;
|
||||
type VselectOption = VselectOptionType;
|
||||
|
||||
interface Window {
|
||||
axios: AxiosStatic;
|
||||
|
|
|
|||
25
resources/ts/pages/data.delete.ts
Normal file
25
resources/ts/pages/data.delete.ts
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
import Swal from "sweetalert2";
|
||||
const datasDelete = document.querySelectorAll("#dataDelete");
|
||||
|
||||
if (datasDelete) {
|
||||
datasDelete.forEach((dataDelete) => {
|
||||
dataDelete.addEventListener("submit", (e) => {
|
||||
const self = e.target as HTMLFormElement;
|
||||
e.preventDefault();
|
||||
Swal.fire({
|
||||
title: "Supprimer cette information ?",
|
||||
text: "Attention cette action est irréversible, cette information sera complètement retiré des bases",
|
||||
icon: "warning",
|
||||
confirmButtonText:
|
||||
"Je comprends le danger et suis conscient de ce que je fait",
|
||||
showCancelButton: true,
|
||||
cancelButtonText: "Annuler",
|
||||
confirmButtonColor: "#dc3545",
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
self?.submit();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
@ -28,6 +28,7 @@ import {
|
|||
faArrowRightFromBracket,
|
||||
faArrowAltCircleDown,
|
||||
faArrowAltCircleUp,
|
||||
faComments,
|
||||
} from "@fortawesome/free-solid-svg-icons";
|
||||
|
||||
config.autoReplaceSvg = false;
|
||||
|
|
@ -59,5 +60,6 @@ library.add(faSearch);
|
|||
library.add(faArrowRightFromBracket);
|
||||
library.add(faArrowAltCircleDown);
|
||||
library.add(faArrowAltCircleUp);
|
||||
library.add(faComments);
|
||||
|
||||
dom.watch();
|
||||
|
|
|
|||
|
|
@ -16,30 +16,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="card-body bg-white">
|
||||
<form action="{{ request()->fullUrlWithQuery(['rst' => null]) }}">
|
||||
<div class="input-group mb-3">
|
||||
<label class="input-group-text" for="brandSelect">{{ __('Filter par Marque') }}</label>
|
||||
<select class="form-select" id="brandSelect">
|
||||
<option value="0" @if(!request()->brand) selected @endif>{{ __('Sélectionnez une marque..') }}</option>
|
||||
@foreach(Brand::all() as $brand)
|
||||
<option value="{{ $brand->id }}" @if(request()->brand == "$brand->id" or Session::get("crud.$modelTable.brand") == $brand->id) selected @endif>{{ $brand->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<label class="input-group-text bg-warning" for="searchField">🔍🠚</label>
|
||||
<input type="search" id="searchField" name="search" class="form-control" value="{{ request()->search ?? Session::get("crud.$modelTable.search") }}" placeholder="Recherche.."/>
|
||||
<input type="text" name="sort_col" class="d-none" value="{{ request()->sort_col }}"/>
|
||||
<input type="text" name="sort_way" class="d-none" value="{{ request()->sort_way }}"/>
|
||||
@if(request()->brand)
|
||||
<input type="hidden" name="brand" class="d-none" value="{{ request()->brand }}"/>
|
||||
@endif
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<i class="fas fa-search"></i>
|
||||
</button>
|
||||
<a class="btn btn-danger" href="{{ request()->fullUrlWithQuery(['rst' => 'true', 'search' => null, 'brand' => null]) }}">
|
||||
<i class="fas fa-backspace"></i>
|
||||
</a>
|
||||
</div>
|
||||
</form>
|
||||
@include('modules.search-bar-brand')
|
||||
{!! $customerModels->links() !!}
|
||||
<div class="row w-100 mx-auto">
|
||||
<div class="col p-0">
|
||||
|
|
|
|||
|
|
@ -20,8 +20,8 @@
|
|||
@else
|
||||
<main role="main" class="mt-5 mb-5 bg-white body-full">
|
||||
@endif
|
||||
<div class="row justify-content-center bg-light">
|
||||
<div class="col col-md-6">
|
||||
<div class="row justify-content-center w-100 mx-auto bg-light">
|
||||
<div class="col-12">
|
||||
@include('modules.flash-messages')
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -33,8 +33,8 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@stack('scriptsConstants')
|
||||
@include('crud-policies::crud.modules.scriptConstants')
|
||||
<!-- Other -->
|
||||
@include('modules.window-system')
|
||||
<script src="{{ mix('js/preload-back.js', 'build') }}"></script>
|
||||
@stack('scripts')
|
||||
</body>
|
||||
|
|
|
|||
24
resources/views/modules/search-bar-brand.blade.php
Normal file
24
resources/views/modules/search-bar-brand.blade.php
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
<form action="{{ request()->fullUrlWithQuery(['rst' => null]) }}">
|
||||
<div class="input-group mb-3">
|
||||
<label class="input-group-text" for="brandSelect">{{ __('Filter par Marque') }}</label>
|
||||
<select class="form-select" id="brandSelect">
|
||||
<option value="0" @if(!request()->brand) selected @endif>{{ __('Sélectionnez une marque..') }}</option>
|
||||
@foreach(Brand::all() as $brand)
|
||||
<option value="{{ $brand->id }}" @if(request()->brand == "$brand->id" or Session::get("crud.$modelTable.brand") == $brand->id) selected @endif>{{ $brand->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<label class="input-group-text bg-warning" for="searchField">🔍🠚</label>
|
||||
<input type="search" id="searchField" name="search" class="form-control" value="{{ request()->search ?? Session::get("crud.$modelTable.search") }}" placeholder="Recherche.."/>
|
||||
<input type="text" name="sort_col" class="d-none" value="{{ request()->sort_col }}"/>
|
||||
<input type="text" name="sort_way" class="d-none" value="{{ request()->sort_way }}"/>
|
||||
@if(request()->brand)
|
||||
<input type="hidden" name="brand" class="d-none" value="{{ request()->brand }}"/>
|
||||
@endif
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<i class="fas fa-search"></i>
|
||||
</button>
|
||||
<a class="btn btn-danger" href="{{ request()->fullUrlWithQuery(['rst' => 'true', 'search' => null, 'brand' => null]) }}">
|
||||
<i class="fas fa-backspace"></i>
|
||||
</a>
|
||||
</div>
|
||||
</form>
|
||||
14
resources/views/modules/window-system.blade.php
Normal file
14
resources/views/modules/window-system.blade.php
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<script @if(isset($nonce)) nonce="{{ $nonce }}" @endif>
|
||||
if (!window.__SYSTEM) {
|
||||
window.__SYSTEM = {};
|
||||
}
|
||||
window.__SYSTEM._locale = "{{ app()->getLocale() }}";
|
||||
window.__SYSTEM._translations = @json(cache(sprintf('translations.%s', app()->getLocale())) ?? []);
|
||||
if(!window.__SYSTEM._routes) {
|
||||
window.__SYSTEM._routes = {}
|
||||
}
|
||||
window.__SYSTEM._routes.questions = {
|
||||
jsonPaginate: "{{ route('questions.jsonPaginate') }}",
|
||||
};
|
||||
</script>
|
||||
@stack('scripts')
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
<label for="{{ $id }}" class="col-form-label">
|
||||
<b>{{ $label }} {{ $required ? '*' : '' }}</b>
|
||||
</label>
|
||||
@php
|
||||
$data = [
|
||||
'readonly' => $readonly,
|
||||
'name' => $name,
|
||||
'modelsRelated' => $modelsRelated,
|
||||
'modelSelected' => $modelSelected,
|
||||
];
|
||||
@endphp
|
||||
<div class="search-belongs-to-many-dropdown" data-json='@json($data)'></div>
|
||||
@include('modules.input-error', [
|
||||
'inputName' => $name,
|
||||
'helperId' => "{$id}Help",
|
||||
'helper' => $helper,
|
||||
])
|
||||
|
|
@ -19,7 +19,7 @@ $data = [
|
|||
'value' => old($name, $model->{$name} ?? '')
|
||||
];
|
||||
@endphp
|
||||
<div id="input-text-auto" data-json='@json($data)'></div>
|
||||
<div class="input-text-auto" data-json='@json($data)'></div>
|
||||
@include('modules.input-error', [
|
||||
'inputName' => $name,
|
||||
'helperId' => "{$id}Help",
|
||||
|
|
|
|||
|
|
@ -1,135 +0,0 @@
|
|||
@extends($viewLayout)
|
||||
|
||||
@section('title', sprintf('%s - %s', transFb(sprintf('models.classes.%s', strtolower(Str::plural(class_basename($modelClass)))), Str::plural(class_basename($modelClass))), __('crud-policies::crud.viewAny')))
|
||||
@section('description', sprintf('%s %s', __('crud-policies::crud.viewAny'), trans(Str::plural(class_basename($modelClass)))))
|
||||
@section('metaIndex', 'noindex,nofollow')
|
||||
|
||||
@section('content')
|
||||
<div class="card">
|
||||
@include('crud-policies::crud.modules.flashMessage')
|
||||
<div class="card-header">
|
||||
@include('crud-policies::crud.modules.breadcrumb', ['action' => CrudAction::viewAny()])
|
||||
@include('crud-policies::crud.modules.actionbar.bar', ['action' => CrudAction::viewAny()])
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col">
|
||||
<form action="{{ url()->current() }}">
|
||||
<div class="input-group mb-3">
|
||||
<label class="input-group-text" for="brandSelect">{{ __('Filter par Marque') }}</label>
|
||||
<select class="form-select" id="brandSelect">
|
||||
<option value="0" @if(!request()->brand) selected @endif>{{ __('Sélectionnez une marque..') }}</option>
|
||||
@foreach(Brand::all() as $brand)
|
||||
<option value="{{ $brand->id }}" @if(request()->brand == "$brand->id") selected @endif>{{ $brand->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<label class="input-group-text bg-warning" for="searchField">🔍🠚</label>
|
||||
<input type="search" id="searchField" name="search" class="form-control" value="{{ request()->search }}" placeholder="Recherche.."/>
|
||||
<input type="text" name="sort_col" class="d-none" value="{{ request()->sort_col }}"/>
|
||||
<input type="text" name="sort_way" class="d-none" value="{{ request()->sort_way }}"/>
|
||||
@if(request()->brand)
|
||||
<input type="hidden" name="brand" class="d-none" value="{{ request()->brand }}"/>
|
||||
@endif
|
||||
<a class="btn btn-danger" href="{{ url()->current() }}">{{ __('crud-policies::crud.reset') }}</a>
|
||||
<button type="submit" class="btn btn-primary">
|
||||
{{ __('crud-policies::crud.search') }}
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{{ $models->appends(Request::except('rst'))->links() }}
|
||||
<table class="table text-center">
|
||||
<thead class="thead-dark">
|
||||
@include('crud-policies::crud.modules.sorter')
|
||||
</thead>
|
||||
<tbody>
|
||||
@if(count($models))
|
||||
|
||||
{{-- INIT QUERIES for OPTIMIZING --}}
|
||||
@foreach ($modelClass::getEditableProperties() as $fieldName => $prop)
|
||||
@if($prop['type']->equals(CrudType::order()))
|
||||
@php ${"$modelTable$fieldName"} = $modelClass::max($fieldName); @endphp
|
||||
@endif
|
||||
@if($prop['type']->equals(CrudType::belongsTo()))
|
||||
@php try { $models->load(Str::singular((new $prop['belongsTo']())->getTable())); } catch(\Exception $e) {} @endphp
|
||||
@endif
|
||||
@if($prop['type']->equals(CrudType::belongsToMany()))
|
||||
@php $models->load("$fieldName"); @endphp
|
||||
@endif
|
||||
@if($prop['type']->equals(CrudType::hasMany()))
|
||||
@php $models->load("$fieldName"); @endphp
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
{{-- DISPLAY MODELS --}}
|
||||
@foreach($models as $model)
|
||||
<tr>
|
||||
@foreach ($modelClass::getEditableProperties() as $fieldName => $prop)
|
||||
@if(in_array(CrudAction::viewAny(), $prop['actions']))
|
||||
@switch($prop['type'])
|
||||
@case(CrudType::belongsToMany() and $prop['belongsToMany'] === \App\Models\Project::class)
|
||||
<td>
|
||||
@foreach($model->{$fieldName} as $pSite)
|
||||
<a href="{{ CrudController::getRoutePrefixed($pSite->getTable().'.show', $pSite) }}">{{ $pSite->{$prop['belongsToManyLabel']} }}</a>
|
||||
@endforeach
|
||||
</td>
|
||||
@break
|
||||
@case(CrudType::hasMany())
|
||||
<td>
|
||||
@foreach($model->{$fieldName} as $pSite)
|
||||
<span>{{ $pSite->{$prop['hasManyLabel']} }}</span>
|
||||
@endforeach
|
||||
</td>
|
||||
@break
|
||||
@case(CrudType::password())
|
||||
{{-- Ignore --}}
|
||||
@break
|
||||
@default
|
||||
<td>@include('crud-policies::crud.printfield', [
|
||||
'action' => CrudAction::viewAny(),
|
||||
'field' => $model->{$fieldName},
|
||||
'props' => $prop,
|
||||
"$modelTable$fieldName" => ${"$modelTable$fieldName"} ?? null
|
||||
])</td>
|
||||
@endswitch
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
{{-- MODEL ACTIONS --}}
|
||||
<td>
|
||||
<div class="btn-group" role="group" aria-label="{{ Str::plural(__('crud-policies::crud.action')) }}">
|
||||
@can('view', $model)
|
||||
<a href="{{ CrudController::getRoutePrefixed("$modelTable.show", $model) }}" class="btn btn-sm btn-primary">{{ __('crud-policies::crud.view') }}</a>
|
||||
@endcan
|
||||
@can('update', $model)
|
||||
<a href="{{ CrudController::getRoutePrefixed("$modelTable.edit", $model) }}" class="btn btn-sm btn-info">{{ __('crud-policies::crud.edit') }}</a>
|
||||
@endcan
|
||||
@can('delete', $model)
|
||||
<form action="{{ CrudController::getRoutePrefixed("$modelTable.destroy", $model) }}" method="POST" onsubmit="__CRUD.confirmDelete(event)">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button type="submit" class="btn btn-sm btn-danger">{{ __('crud-policies::crud.delete') }}</button>
|
||||
</form>
|
||||
@endcan
|
||||
@can('viewAny', \App\Models\Answer::class)
|
||||
<a href="{{ CrudController::getRoutePrefixed("questions.answers.index", $model) }}" class="btn btn-sm btn-dark">{{ Str::ucfirst(__('models.classes.answers')) }}</a>
|
||||
@endcan
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@else
|
||||
<tr>
|
||||
<td colspan="{{ count($modelClass::getEditableProperties()) }}">
|
||||
{{ __('crud-policies::crud.nothingtoshow') }}
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
{{ $models->links() }}
|
||||
</div>
|
||||
</div>
|
||||
@include('crud-policies::crud.modules.scriptConstants')
|
||||
@endsection
|
||||
51
resources/views/questions/create.blade.php
Normal file
51
resources/views/questions/create.blade.php
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
@extends('layouts.app')
|
||||
|
||||
@section('title', sprintf('%s - %s', __('models.classes.questions'), Str::ucfirst(__('création'))))
|
||||
@section('description', __('Création d\'une :model', ['model' => __('models.classes.questions')]))
|
||||
@section('metaIndex', 'noindex,nofollow')
|
||||
|
||||
@section('content')
|
||||
<div class="card border-0">
|
||||
<div class="card-header bg-light">
|
||||
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center">
|
||||
<div class="d-flex flex-row align-items-start">
|
||||
<a href="{{ route('questions.index') }}"
|
||||
class="btn btn-primary text-decoration-none me-2"
|
||||
data-bs-toggle="tooltip"
|
||||
data-bs-placement="top"
|
||||
title="{{ __('Retourner sur la liste des :model', ['model' => __('models.classes.questions')]) }}"
|
||||
data-bs-toggle="tooltip">
|
||||
<i class="fa-solid fa-arrow-left"></i>
|
||||
</a>
|
||||
@include('breadcrumbs.breadcrumb-body')
|
||||
</div>
|
||||
<div class="col-12 col-md-4 d-flex justify-content-center justify-content-md-end align-items-center">
|
||||
<button id="formSubmitClone"
|
||||
type="button"
|
||||
class="btn btn-primary"
|
||||
title="{{ __('Sauvegarder cette :model', ['model' => Str::singular(__('models.classes.questions'))]) }}"
|
||||
data-bs-toggle="tooltip">
|
||||
{{ __('Sauvegarder') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body bg-white">
|
||||
<form action="{{ route('questions.store') }}"
|
||||
method="POST">
|
||||
@csrf
|
||||
@include('questions.form')
|
||||
<div class="row">
|
||||
<div class="col text-center">
|
||||
<button id="formSubmit"
|
||||
type="submit"
|
||||
class="btn btn-primary"
|
||||
title="{{ __('Sauvegarder cette :model', ['model' => Str::singular(__('models.classes.questions'))]) }}"
|
||||
data-bs-toggle="tooltip">{{ __('Sauvegarder') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
71
resources/views/questions/edit.blade.php
Normal file
71
resources/views/questions/edit.blade.php
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
@extends('layouts.app')
|
||||
|
||||
@section('title', sprintf('%s - %s', __('models.classes.questions'), Str::ucfirst(__('édition'))))
|
||||
@section('description', __('Édition d\'une :model', ['model' => __('models.classes.questions')]))
|
||||
@section('metaIndex', 'noindex,nofollow')
|
||||
|
||||
@section('content')
|
||||
<div class="card border-0">
|
||||
<div class="card-header bg-light">
|
||||
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center">
|
||||
<div class="d-flex flex-row align-items-start">
|
||||
<a href="{{ route('questions.index') }}"
|
||||
class="btn btn-primary text-decoration-none me-2"
|
||||
data-bs-toggle="tooltip"
|
||||
data-bs-placement="top"
|
||||
title="{{ __('Retourner sur la liste des :model', ['model' => __('models.classes.questions')]) }}"
|
||||
data-bs-toggle="tooltip">
|
||||
<i class="fa-solid fa-arrow-left"></i>
|
||||
</a>
|
||||
@include('breadcrumbs.breadcrumb-body')
|
||||
</div>
|
||||
<div class="col-12 col-md-4 d-flex justify-content-center justify-content-md-end align-items-center">
|
||||
<form id="dataDelete"
|
||||
action="{{ route('questions.destroy', ['question' => $questionModel]) }}"
|
||||
method="POST"
|
||||
class="btn-group">
|
||||
<a href="{{ route("questions.answers.index", $questionModel) }}" class="btn btn-dark"
|
||||
title="{{ __('Afficher les :model', ['model' => __('models.classes.answers')]) }}"
|
||||
data-bs-toggle="tooltip">
|
||||
<i class="fa-solid fa-comments"></i>
|
||||
</a>
|
||||
<button id="formSubmitClone"
|
||||
type="button"
|
||||
class="btn btn-primary"
|
||||
title="{{ __('Sauvegarder cette :model', ['model' => Str::singular(__('models.classes.questions'))]) }}"
|
||||
data-bs-toggle="tooltip">
|
||||
{{ __('Sauvegarder') }}
|
||||
</button>
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button class="btn btn-danger"
|
||||
title="{{ __('Supprimer cette :model', ['model' => Str::singular(__('models.classes.questions'))]) }}"
|
||||
data-bs-toggle="tooltip">
|
||||
<i class="fa-solid fa-trash"></i>
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body bg-white">
|
||||
<form action="{{ route('questions.update', $questionModel->id) }}"
|
||||
method="POST">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
@include('questions.form')
|
||||
<div class="row">
|
||||
<div class="col text-center">
|
||||
<button id="formSubmit"
|
||||
type="submit"
|
||||
class="btn btn-primary"
|
||||
title="{{ __('Sauvegarder ce :model', ['model' => Str::singular(__('models.classes.questions'))]) }}"
|
||||
data-bs-toggle="tooltip">
|
||||
{{ __('Sauvegarder') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
79
resources/views/questions/form.blade.php
Normal file
79
resources/views/questions/form.blade.php
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
<div class="row">
|
||||
{{-- TITLE --}}
|
||||
<div class="col-12 col-md-6 mb-3">
|
||||
<fieldset class="border h-100 bg-white p-3">
|
||||
<legend>{{ __('Question') }}</legend>
|
||||
<div class="row">
|
||||
<div class="col-12 mb-3">
|
||||
@include('partials.inputs.varchar-multiline', [
|
||||
'id' => 'questionText',
|
||||
'label' => __('Texte de la :model', ['model' => Str::singular(__('models.classes.questions'))]),
|
||||
'name' => 'question',
|
||||
'model' => $questionModel ?? null,
|
||||
'required' => true,
|
||||
'helper' => __('validation.between.string', [
|
||||
'attribute' => __(':model', ['model' => Str::singular(__('models.classes.questions'))]),
|
||||
'min' => 5,
|
||||
'max' => 160
|
||||
]),
|
||||
'placeholder' => __('Une question pertinente.'),
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
{{-- TYPE --}}
|
||||
<div class="col-12 col-md-6 mb-3">
|
||||
<fieldset class="border h-100 bg-white p-3">
|
||||
<legend>{{ __('Type') }}</legend>
|
||||
<div class="row">
|
||||
<div class="col-12 mb-3">
|
||||
@include('partials.inputs.select-enum', [
|
||||
'id' => 'questionType',
|
||||
'label' => __('Type de la :model', ['model' => Str::singular(__('models.classes.questions'))]),
|
||||
'name' => 'type',
|
||||
'model' => $questionModel ?? null,
|
||||
'required' => true,
|
||||
'associatedModels' => \App\Enums\QuestionType::toArray(),
|
||||
'helper' => trans('Selectionnez un Type parmis la liste.'),
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
{{-- BRAND --}}
|
||||
<div class="col-12 col-md-6 pb-3">
|
||||
<fieldset class="border h-100 bg-white p-3">
|
||||
<legend>{{ __('Marque') }}</legend>
|
||||
<div class="row">
|
||||
@include('partials.inputs.search-belongs-to-many-dropdown', [
|
||||
'id' => 'questionBrand',
|
||||
'label' => __('Marque associée'),
|
||||
'name' => 'brand_id',
|
||||
'modelsRelated' => $brandModels ?? [],
|
||||
'modelSelected' => $questionModel->brand ?? [],
|
||||
'readonly' => false,
|
||||
'placeholder' => __('Rechercher une marque'),
|
||||
'helper' => __('Selectionner une :model qui sera associée parmis la liste (une seule et unique marque doit être choisie).', [
|
||||
'model' => Str::singular(__('models.classes.brands'))
|
||||
]),
|
||||
'required' => true,
|
||||
])
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@push('scripts')
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
// Submit button clone.
|
||||
const submit = document.getElementById('formSubmit')
|
||||
submitClone = document.getElementById('formSubmitClone');
|
||||
submitClone.addEventListener('click', (event) => {
|
||||
event.preventDefault();
|
||||
submit.click();
|
||||
})
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
69
resources/views/questions/index-list.blade.php
Normal file
69
resources/views/questions/index-list.blade.php
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
<div class="table-responsive">
|
||||
<table class="table table-hover text-center">
|
||||
<thead class="border-dark border-top-0 border-start-0 border-end-0 border-2">
|
||||
@php
|
||||
$rst = !is_null(request()->rst);
|
||||
$routeName = request()->route()->getName();
|
||||
$noOrder = Session::get("$routeName.sort_col") !== 'status' and (Session::has("$routeName.sort_col") or Session::has("$routeName.sort_way"));
|
||||
$cols = [
|
||||
'question' => __('Question'),
|
||||
'brand_id' => __('Marque'),
|
||||
'answers' => __('Réponses'),
|
||||
];
|
||||
@endphp
|
||||
@include('modules.table-col-sorter', ['cols' => $cols, 'mobileHide' => ['status'], 'ignore' => ['answers']])
|
||||
</thead>
|
||||
<tbody>
|
||||
@if(count($questionModels))
|
||||
{{-- DISPLAY MODELS --}}
|
||||
@foreach($questionModels as $questionModel)
|
||||
<tr>
|
||||
<td class="align-middle bg-white">{{ $questionModel->question }}</td>
|
||||
<td class="align-middle bg-white">{{ $questionModel->brand->name }}</td>
|
||||
<td class="align-middle bg-white">
|
||||
@foreach ($questionModel->answers as $answer)
|
||||
{{ $answer->answer }}
|
||||
@endforeach
|
||||
</td>
|
||||
{{-- MODEL ACTIONS --}}
|
||||
<td class="text-end bg-white">
|
||||
<form id="dataDelete"
|
||||
action="{{ route("$modelTable.destroy", $questionModel) }}"
|
||||
method="POST"
|
||||
class="btn-group">
|
||||
<a href="{{ route("questions.answers.index", $questionModel) }}" class="btn btn-sm btn-dark"
|
||||
title="{{ __('Afficher les :model', ['model' => __('models.classes.answers')]) }}"
|
||||
data-bs-toggle="tooltip">
|
||||
<i class="fa-solid fa-comments"></i>
|
||||
</a>
|
||||
<a href="{{ route("$modelTable.show", $questionModel) }}" class="btn btn-sm btn-warning"
|
||||
title="{{ __('Afficher cette :model', ['model' => Str::singular(__('models.classes.questions'))]) }}"
|
||||
data-bs-toggle="tooltip">
|
||||
<i class="fa-solid fa-eye"></i>
|
||||
</a>
|
||||
<a href="{{ route("$modelTable.edit", $questionModel) }}" class="btn btn-sm btn-primary"
|
||||
title="{{ __('Modifier cette :model', ['model' => Str::singular(__('models.classes.questions'))]) }}"
|
||||
data-bs-toggle="tooltip">
|
||||
<i class="fa-solid fa-pencil"></i>
|
||||
</a>
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button class="btn btn-sm btn-danger"
|
||||
title="{{ __('Supprimer cette :model', ['model' => Str::singular(__('models.classes.questions'))]) }}"
|
||||
data-bs-toggle="tooltip">
|
||||
<i class="fa-solid fa-trash"></i>
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@else
|
||||
<tr>
|
||||
<td class="bg-white" colspan="8">
|
||||
<span class="h3">{{ __('Aucun résultat pour les :models', ['models' => __('models.classes.questions')]) }}
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
41
resources/views/questions/index.blade.php
Normal file
41
resources/views/questions/index.blade.php
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
@extends('layouts.app')
|
||||
|
||||
@section('title', sprintf('%s - %s', __('models.classes.questions'), Str::ucfirst(__('liste'))))
|
||||
@section('description', __('Listage de tous les :model', ['model' => __('models.classes.questions')]))
|
||||
@section('metaIndex', 'noindex,nofollow')
|
||||
|
||||
@section('content')
|
||||
<div class="row w-100 mx-auto">
|
||||
<div class="col p-0">
|
||||
<div class="card rounded-0 border-0">
|
||||
<div class="card-header bg-light">
|
||||
<div class="row w-100 mx-auto">
|
||||
<div class="col p-0">
|
||||
@include('breadcrumbs.breadcrumb-body')
|
||||
</div>
|
||||
<div class="col-md-3 d-flex align-items-center p-0">
|
||||
<div class="input-group justify-content-end">
|
||||
<a href="{{ route('questions.create') }}"
|
||||
class="btn btn-primary"
|
||||
title="{{ __('Ajouter une :model', ['model' => Str::singular(__('models.classes.questions'))]) }}"
|
||||
data-bs-toggle="tooltip">
|
||||
<i class="fa-solid fa-plus"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body bg-white">
|
||||
@include('modules.search-bar-brand')
|
||||
<div class="row w-100 mx-auto">
|
||||
<div class="col p-0">
|
||||
@include('questions.index-list')
|
||||
</div>
|
||||
</div>
|
||||
{!! $questionModels->links() !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@include('crud-policies::crud.modules.scriptConstants')
|
||||
@endsection
|
||||
90
resources/views/questions/show.blade.php
Normal file
90
resources/views/questions/show.blade.php
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
@extends('layouts.app')
|
||||
|
||||
@section('title', sprintf('%s - %s', __('models.classes.questions'), Str::ucfirst(__('aperçu'))))
|
||||
@section('description', __('Aperçu d\'un :model', ['model' => __('models.classes.questions')]))
|
||||
@section('metaIndex', 'noindex,nofollow')
|
||||
@section('breadcrumb', request()->route()->getName())
|
||||
|
||||
@section('content')
|
||||
<div class="card border-0">
|
||||
<div class="card-header bg-light">
|
||||
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center">
|
||||
<div class="d-flex flex-row align-items-start">
|
||||
<a href="{{ route('questions.index') }}"
|
||||
class="btn btn-primary text-decoration-none me-2"
|
||||
data-bs-toggle="tooltip"
|
||||
data-bs-placement="top"
|
||||
title="{{ __('Retourner sur la liste des :model', ['model' => __('models.classes.questions')]) }}"
|
||||
data-bs-toggle="tooltip">
|
||||
<i class="fa-solid fa-arrow-left"></i>
|
||||
</a>
|
||||
@include('breadcrumbs.breadcrumb-body')
|
||||
</div>
|
||||
<div class="col-12 col-md-4 d-flex justify-content-center justify-content-md-end align-items-center">
|
||||
<form id="dataDelete"
|
||||
class="btn-group"
|
||||
action="{{ route('questions.destroy', ['question' => $questionModel]) }}"
|
||||
method="POST">
|
||||
<a href="{{ route("questions.answers.index", $questionModel) }}" class="btn btn-dark"
|
||||
title="{{ __('Afficher les :model', ['model' => __('models.classes.answers')]) }}"
|
||||
data-bs-toggle="tooltip">
|
||||
<i class="fa-solid fa-comments"></i>
|
||||
</a>
|
||||
<a href="{{ route("questions.edit", $questionModel) }}" class="btn btn-primary"
|
||||
title="{{ __('Modifier cette :model', ['model' => Str::singular(__('models.classes.questions'))]) }}"
|
||||
data-bs-toggle="tooltip">
|
||||
<i class="fa-solid fa-pencil"></i>
|
||||
</a>
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button class="btn btn-danger"
|
||||
title="{{ __('Supprimer cette :model', ['model' => Str::singular(__('models.classes.questions'))]) }}"
|
||||
data-bs-toggle="tooltip">
|
||||
<i class="fa-solid fa-trash"></i>
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body bg-white">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col">
|
||||
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center py-0 mb-2">
|
||||
<h1 class="h2">{{ __('Informations d\'une question') }} - {{ Str::singular(__('models.classes.brands')) }} {{ $questionModel->brand->name }}</h1>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<table class="table table-sm table-bordered table-striped">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="w-50"><b>{{ __('Question') }}</b></td>
|
||||
<td class="w-50">{{ $questionModel->question }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="w-50"><b>{{ __('Type') }}</b></td>
|
||||
<td class="w-50">
|
||||
@foreach (\App\Enums\QuestionType::toArray() as $questionType)
|
||||
@if($questionType->value === $questionModel->type->value)
|
||||
{{ $questionType->label }}
|
||||
@endif
|
||||
@endforeach
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="w-50"><b>{{ __('Marque') }}</b></td>
|
||||
<td class="w-50">{{ $questionModel->brand->name }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="w-50"><b>{{ __('Réponses') }}</b></td>
|
||||
<td class="w-50">
|
||||
@foreach ($questionModel->answers as $answer)
|
||||
{{ $answer->answer }}
|
||||
@endforeach
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@include('crud-policies::crud.modules.scriptConstants')
|
||||
@endsection
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
use App\Models\Brand;
|
||||
use App\Models\Question;
|
||||
use Diglactic\Breadcrumbs\Breadcrumbs;
|
||||
use Diglactic\Breadcrumbs\Generator;
|
||||
|
||||
|
|
@ -25,3 +25,20 @@ Breadcrumbs::for('brands.edit', function (Generator $trail) {
|
|||
$trail->parent('brands.index');
|
||||
$trail->push(trans('Édition'));
|
||||
});
|
||||
|
||||
// * QUESTIONS
|
||||
Breadcrumbs::for('questions.index', function (Generator $trail) {
|
||||
$trail->push(trans('Questions'), route('questions.index'));
|
||||
});
|
||||
Breadcrumbs::for('questions.edit', function (Generator $trail) {
|
||||
$trail->parent('questions.index');
|
||||
$trail->push(trans('Édition'));
|
||||
});
|
||||
Breadcrumbs::for('questions.create', function (Generator $trail) {
|
||||
$trail->parent('questions.index');
|
||||
$trail->push(trans('Création'));
|
||||
});
|
||||
Breadcrumbs::for('questions.show', function (Generator $trail) {
|
||||
$trail->parent('questions.index');
|
||||
$trail->push(trans('Aperçu'));
|
||||
});
|
||||
|
|
|
|||
|
|
@ -35,9 +35,7 @@ Route::middleware(['auth'])->group(function () {
|
|||
->name('manage-brand');
|
||||
|
||||
// * Services
|
||||
Route::resource('services', ServiceController::class)->except([
|
||||
'delete'
|
||||
]);
|
||||
Route::resource('services', ServiceController::class)->except(['delete']);
|
||||
Route::post('/services/{service}/token/generate', [ServiceController::class, 'generateServicePassword'])
|
||||
->name('generate-token-service');
|
||||
|
||||
|
|
@ -57,6 +55,8 @@ Route::middleware(['auth'])->group(function () {
|
|||
Route::post('/questions/export', [QuestionController::class, 'exportSubmit'])->name('questions.exportSubmit');
|
||||
Route::resource('questions', QuestionController::class);
|
||||
Route::resource('questions.answers', AnswerController::class);
|
||||
Route::get('/questions/json/paginate', [QuestionController::class, 'jsonPaginate'])
|
||||
->name('questions.jsonPaginate');
|
||||
|
||||
// * Stats
|
||||
Route::match(['get', 'post'], '/stats/brand', [StatsController::class, 'viewStatsByBrand'])
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue