From 777d3e0e86611bea5e20144d2889bb6df9b60d96 Mon Sep 17 00:00:00 2001 From: Vincent BRIDIER Date: Thu, 13 Jul 2023 08:34:54 +0000 Subject: [PATCH] Multiple fix --- .env.example | 3 + CHANGELOG.md | 4 + README.md | 15 +- app/Console/Commands/CreateAdmin.php | 14 +- app/Enums/SettingTypesEnum.php | 16 +- app/Enums/UserRolesEnum.php | 38 + app/Http/Controllers/API/AppController.php | 27 + .../Controllers/API/SettingsController.php | 31 + app/Http/Controllers/API/SyncController.php | 246 +++ .../Controllers/Bo/DashboardController.php | 50 +- .../Controllers/Bo/DirectoriesController.php | 62 +- .../Controllers/Bo/DocumentController.php | 50 +- app/Http/Controllers/Bo/SettingController.php | 22 +- app/Http/Controllers/Bo/TagController.php | 147 ++ app/Http/Kernel.php | 1 + app/Http/Middleware/CheckApiToken.php | 24 + .../Bo/Documents/StoreDocumentRequest.php | 24 +- app/Http/Requests/Bo/ImportRequest.php | 3 +- .../Bo/Settings/UpdateSettingRequest.php | 55 +- app/Http/Requests/Bo/Tags/StoreTagRequest.php | 56 + .../Requests/Bo/Tags/UpdateTagRequest.php | 7 + app/Http/Resources/ApiResponseResource.php | 46 + app/Http/Resources/AppUserCollection.php | 19 + app/Http/Resources/ContactsCollection.php | 19 + app/Http/Resources/DirectoriesCollection.php | 19 + app/Http/Resources/DocumentsCollection.php | 19 + app/Imports/AppUserImport.php | 13 +- app/Mail/AccountCreated.php | 47 + app/Mail/SendFlyer.php | 40 + app/Mail/SendFlyerFailed.php | 40 + app/Models/AppUser.php | 2 +- app/Models/Contact.php | 63 + app/Models/Directory.php | 23 +- app/Models/Document.php | 42 +- app/Models/Tag.php | 107 ++ app/Models/User.php | 9 + app/Providers/AppServiceProvider.php | 3 + app/Providers/RouteServiceProvider.php | 7 + composer.json | 16 +- composer.lock | 1510 +++++++++++++---- config/app.php | 2 + config/auth.php | 2 + database/factories/DirectoryFactory.php | 1 + database/factories/TagFactory.php | 34 + ..._03_14_152416_create_failed_jobs_table.php | 2 +- ..._14_171940_update_role_app_users_table.php | 34 - ...093018_update_password_app_users_table.php | 27 - ..._101434_update_surname_app_users_table.php | 32 - ...23_03_20_105223_update_directory_table.php | 55 + ...3_20_110635_add_pivot_directory_table.php} | 8 +- ...23_03_24_171035_update_app_users_table.php | 86 + .../2023_03_27_112237_update_users_table.php | 30 +- ...23_03_29_125343_update_app_users_table.php | 34 - ...23_03_31_105223_update_directory_table.php | 40 - ...023_04_05_093932_update_document_table.php | 105 +- ...023_04_18_144609_update_settings_table.php | 84 + .../2023_04_18_153753_create_tags_table.php | 34 + ...3_04_18_153812_create_taggables_table.php} | 12 +- ...023_04_18_172743_update_contacts_table.php | 45 + database/seeders/DatabaseSeeder.php | 1 + database/seeders/DirectorySeeder.php | 25 +- database/seeders/MigrationSeeder.php | 31 + database/seeders/TagSeeder.php | 24 + resources/lang/en/models.php | 3 +- resources/lang/fr/models.php | 3 +- .../BelongsToManyDropdownComponent.vue | 6 +- .../components/CrudDocumentInputComponent.vue | 20 +- .../ts/bo/components/DirectoriesComponent.vue | 259 ++- resources/ts/utilities/fontawesome.ts | 4 + resources/views/bo/layout.blade.php | 4 +- resources/views/bo/layouts/header.blade.php | 2 +- resources/views/bo/layouts/nav-menu.blade.php | 8 + resources/views/bo/mails/sendflyer.blade.php | 17 + .../views/bo/mails/sendflyerfailed.blade.php | 11 + .../views/bo/modules/pagination.blade.php | 14 +- .../views/bo/modules/search-bar.blade.php | 9 + .../bo/modules/table-col-sorter.blade.php | 6 +- .../views/bo/pages/app-users/create.blade.php | 3 +- .../views/bo/pages/app-users/edit.blade.php | 2 +- .../bo/pages/app-users/index-list.blade.php | 12 +- .../views/bo/pages/app-users/index.blade.php | 17 +- resources/views/bo/pages/dashboard.blade.php | 39 +- .../views/bo/pages/directories/edit.blade.php | 2 +- .../views/bo/pages/directories/form.blade.php | 8 +- .../bo/pages/directories/index.blade.php | 8 +- .../views/bo/pages/documents/create.blade.php | 2 +- .../views/bo/pages/documents/edit.blade.php | 4 +- .../views/bo/pages/documents/form.blade.php | 37 + .../bo/pages/documents/index-list.blade.php | 96 +- .../views/bo/pages/documents/index.blade.php | 9 +- .../bo/pages/settings/index-list.blade.php | 6 +- .../views/bo/pages/settings/index.blade.php | 5 - .../views/bo/pages/tags/create.blade.php | 53 + resources/views/bo/pages/tags/edit.blade.php | 65 + resources/views/bo/pages/tags/form.blade.php | 36 + .../views/bo/pages/tags/index-list.blade.php | 84 + resources/views/bo/pages/tags/index.blade.php | 43 + .../inputs/bigint-foreign-id.blade.php | 5 +- .../inputs/pivot-belongs-to-many.blade.php | 6 +- .../views/modules/breadcrumb/layout.blade.php | 2 +- .../views/modules/flash-message.blade.php | 10 +- .../views/modules/script-constants.blade.php | 1 + routes/api.php | 27 + routes/web-bo.php | 27 +- 104 files changed, 3744 insertions(+), 918 deletions(-) create mode 100644 CHANGELOG.md create mode 100644 app/Enums/UserRolesEnum.php create mode 100644 app/Http/Controllers/API/AppController.php create mode 100644 app/Http/Controllers/API/SettingsController.php create mode 100644 app/Http/Controllers/API/SyncController.php create mode 100644 app/Http/Controllers/Bo/TagController.php create mode 100644 app/Http/Middleware/CheckApiToken.php create mode 100644 app/Http/Requests/Bo/Tags/StoreTagRequest.php create mode 100644 app/Http/Requests/Bo/Tags/UpdateTagRequest.php create mode 100644 app/Http/Resources/ApiResponseResource.php create mode 100644 app/Http/Resources/AppUserCollection.php create mode 100644 app/Http/Resources/ContactsCollection.php create mode 100644 app/Http/Resources/DirectoriesCollection.php create mode 100644 app/Http/Resources/DocumentsCollection.php create mode 100644 app/Mail/AccountCreated.php create mode 100644 app/Mail/SendFlyer.php create mode 100644 app/Mail/SendFlyerFailed.php create mode 100644 app/Models/Contact.php create mode 100644 app/Models/Tag.php create mode 100644 database/factories/TagFactory.php delete mode 100644 database/migrations/2023_03_14_171940_update_role_app_users_table.php delete mode 100644 database/migrations/2023_03_15_093018_update_password_app_users_table.php delete mode 100644 database/migrations/2023_03_15_101434_update_surname_app_users_table.php create mode 100644 database/migrations/2023_03_20_105223_update_directory_table.php rename database/migrations/{2023_03_31_110635_add_pivot_directory_table.php => 2023_03_20_110635_add_pivot_directory_table.php} (66%) create mode 100644 database/migrations/2023_03_24_171035_update_app_users_table.php delete mode 100644 database/migrations/2023_03_29_125343_update_app_users_table.php delete mode 100644 database/migrations/2023_03_31_105223_update_directory_table.php create mode 100644 database/migrations/2023_04_18_144609_update_settings_table.php create mode 100644 database/migrations/2023_04_18_153753_create_tags_table.php rename database/migrations/{2023_03_14_171035_rename_activated_app_users_table.php => 2023_04_18_153812_create_taggables_table.php} (51%) create mode 100644 database/migrations/2023_04_18_172743_update_contacts_table.php create mode 100644 database/seeders/MigrationSeeder.php create mode 100644 database/seeders/TagSeeder.php create mode 100644 resources/views/bo/mails/sendflyer.blade.php create mode 100644 resources/views/bo/mails/sendflyerfailed.blade.php create mode 100644 resources/views/bo/pages/tags/create.blade.php create mode 100644 resources/views/bo/pages/tags/edit.blade.php create mode 100644 resources/views/bo/pages/tags/form.blade.php create mode 100644 resources/views/bo/pages/tags/index-list.blade.php create mode 100644 resources/views/bo/pages/tags/index.blade.php diff --git a/.env.example b/.env.example index 475c648..5acc673 100644 --- a/.env.example +++ b/.env.example @@ -3,6 +3,9 @@ APP_ENV=local APP_KEY= APP_DEBUG=true APP_URL=http://localhost +API_TOKEN=toto + +BRAND= LOG_CHANNEL=stack LOG_DEPRECATIONS_CHANNEL=null diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..d4763d9 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,4 @@ +#### **21/04/23 ► v2.1** +- Refonte totale du back-office +- Ajout des étiquettes sur les documents +- Ajout d'une section administration des étiquettes diff --git a/README.md b/README.md index b076a24..44f526a 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,10 @@ -## reste à faire +## Migration v2.1 -FO : -ts -view -route -les fichiers à la racine +- add default table of laravel named "Migrations" : +`php artisan migrate:install` +  +- seed migrations already passed : +`php artisan db:seed --class=MigrationSeeder --force` +  +- continue migrations : +`php artisan migrate` diff --git a/app/Console/Commands/CreateAdmin.php b/app/Console/Commands/CreateAdmin.php index 5525698..3fad0bf 100644 --- a/app/Console/Commands/CreateAdmin.php +++ b/app/Console/Commands/CreateAdmin.php @@ -3,7 +3,7 @@ namespace App\Console\Commands; use App\Models\User; -use App\Enums\AppUserRolesEnum; +use App\Enums\UserRolesEnum; use Illuminate\Console\Command; use Illuminate\Support\Facades\Validator; use Illuminate\Validation\ValidationException; @@ -201,16 +201,16 @@ class CreateAdmin extends Command try { $tmp = $this->choice( 'Select his role', - [AppUserRolesEnum::total()->label, AppUserRolesEnum::user()->label], - AppUserRolesEnum::user()->label, + [UserRolesEnum::admin()->label, UserRolesEnum::client()->label], + UserRolesEnum::client()->label, $maxAttempts = null, $allowMultipleSelections = false ); - if ($tmp === AppUserRolesEnum::total()->label) { - $tmp = AppUserRolesEnum::total(); + if ($tmp === UserRolesEnum::admin()->label) { + $tmp = UserRolesEnum::admin(); } - if ($tmp === AppUserRolesEnum::user()->label) { - $tmp = AppUserRolesEnum::user(); + if ($tmp === UserRolesEnum::client()->label) { + $tmp = UserRolesEnum::client(); } $validator = Validator::make(['role' => $tmp], [ 'role' => 'required' diff --git a/app/Enums/SettingTypesEnum.php b/app/Enums/SettingTypesEnum.php index 6aff116..2c28fb7 100644 --- a/app/Enums/SettingTypesEnum.php +++ b/app/Enums/SettingTypesEnum.php @@ -8,10 +8,10 @@ use Kwaadpepper\Enum\BaseEnumRoutable; * This defines a data type. * * @method static self string() string type - * @method static self json() string type * @method static self numeric() numeric type - * @method static self boolean() boolean type * @method static self picture() picture type + * @method static self json() string type + * @method static self boolean() boolean type * @method static self color() color type * @method static self directory() directory type */ @@ -25,10 +25,10 @@ final class SettingTypesEnum extends BaseEnumRoutable { return [ 'string' => 1, - 'json' => 2, - 'numeric' => 3, - 'boolean' => 4, - 'picture' => 5, + 'numeric' => 2, + 'picture' => 3, + 'json' => 4, + 'boolean' => 5, 'color' => 6, 'directory' => 7 ]; @@ -42,10 +42,10 @@ final class SettingTypesEnum extends BaseEnumRoutable { return [ 'string' => 'String (Hexa)', - 'json' => 'Json', 'numeric' => 'Numeric', - 'boolean' => 'Boolean', 'picture' => 'Picture', + 'json' => 'Json', + 'boolean' => 'Boolean', 'color' => 'Color', 'directory' => 'Directory', ]; diff --git a/app/Enums/UserRolesEnum.php b/app/Enums/UserRolesEnum.php new file mode 100644 index 0000000..0cfe46a --- /dev/null +++ b/app/Enums/UserRolesEnum.php @@ -0,0 +1,38 @@ + 1, + 'client' => 2, + ]; + } + + /** + * enum labels + * @return array + */ + protected static function labels(): array + { + return [ + 'admin' => 'Administrateur', + 'client' => 'Client', + ]; + } +} diff --git a/app/Http/Controllers/API/AppController.php b/app/Http/Controllers/API/AppController.php new file mode 100644 index 0000000..6ca236a --- /dev/null +++ b/app/Http/Controllers/API/AppController.php @@ -0,0 +1,27 @@ +orWhere('key', 'Button2')->orWhere('key', 'Button3')->get(); + + foreach ($settings as $setting) { + $response['folders'][$setting->key] = Directory::find($setting->value)->only('id', 'name'); + } + + return new ApiResponseResource("OK", $response); + } +} diff --git a/app/Http/Controllers/API/SettingsController.php b/app/Http/Controllers/API/SettingsController.php new file mode 100644 index 0000000..be680a8 --- /dev/null +++ b/app/Http/Controllers/API/SettingsController.php @@ -0,0 +1,31 @@ +key] = + SettingTypesEnum::numeric()->equals($setting->type) || + SettingTypesEnum::boolean()->equals($setting->type) || + SettingTypesEnum::directory()->equals($setting->type) + ? \intval($setting->value) + : $setting->value; + } + return new ApiResponseResource("OK", $response); + } +} diff --git a/app/Http/Controllers/API/SyncController.php b/app/Http/Controllers/API/SyncController.php new file mode 100644 index 0000000..33b8271 --- /dev/null +++ b/app/Http/Controllers/API/SyncController.php @@ -0,0 +1,246 @@ +get()); + } + + /** + * @param \Illuminate\Http\Request $request + * @return \App\Http\Resources\ContactsCollection + */ + public function getContacts(Request $request) + { + $userId = $request->userId; + $this->syncContacts($request->contacts, $userId); + return new \App\Http\Resources\ContactsCollection(Contact::where('app_user_id', $userId)->get()); + } + + /** + * @param \Illuminate\Http\Request $request + * @return \App\Http\Resources\DirectoriesCollection + */ + public function getDirectories(Request $request) + { + return new \App\Http\Resources\DirectoriesCollection(Directory::all()); + } + + /** + * @param \Illuminate\Http\Request $request + * @return \App\Http\Resources\DocumentsCollection + */ + public function getDocuments(Request $request) + { + return new \App\Http\Resources\DocumentsCollection(Document::where('status', 1)->get()); + } + + /** + * @param \Illuminate\Http\Request $request + * @return array + */ + public function getVersion(Request $request) + { + $app_uuid = $request->app_uuid; + $app_version = $request->app_version; + $version = Setting::select('value AS version')->where('key', 'version')->first(); + $ShowIsActive = Setting::select('value AS ShowIsActive')->where('key', 'ShowIsActive')->first(); + + try { + $client = new \GuzzleHttp\Client(); + $response = $client->request( + 'GET', + 'https://store.ldc.fr/api/get-version?token=@P$oi6or!bL2-r%3C&app_uuid=' . $app_uuid + ); + $body = $response->getBody(); + $storeVersion = json_decode($body)->version; + } catch (ClientException $e) { + $storeVersion = $app_version; + } + + if ($storeVersion > $app_version) { + $newApp = true; + } else { + $newApp = false; + } + + return ['version' => $version->version, 'ShowIsActive' => $ShowIsActive->ShowIsActive, 'newApp' => $newApp]; + } + + /** + * @param \Illuminate\Http\Request $request + * @return string + */ + public function sendFlyer(Request $request) + { + $email = $request->emails['email']; + $subject = $request->emails['subject']; + $message = $request->emails['message']; + $app_user_id = $request->emails['app_user_id']; + $docs = $request->emails['documents']; + + $user = AppUser::find($app_user_id); + + $attach = []; + $filesName = []; + $noExists = []; + foreach ($docs as $doc) { + $exists = Storage::disk('public')->exists('docs/' . $doc['uuid'] . '.' . $doc['type']); + if ($exists) { + array_push($attach, URL::temporarySignedRoute( + 'bo.docs.download', + now()->addDays(30), + ['uuid' => $doc['uuid']] + )); + array_push($filesName, $doc['title']); + } else { + array_push($noExists, $doc['title']); + } + } + if (count($noExists) === 0) { + $message = new SendFlyer([ + 'body' => $message, + 'from' => $user->email, + 'fromName' => $user->firstname . ' ' . $user->lastname, + 'subject' => '[' . config('app.BRAND') . '] - ' . $subject, + 'attach' => $attach, + 'filesName' => $filesName, + ]); + + Mail::to($email) + ->cc($user->email) + ->queue($message); + } else { + $message = new SendFlyerFailed([ + 'email' => $email, + 'message' => $message, + 'subject' => $subject, + 'filesName' => $filesName, + 'noExists' => $noExists + ]); + + Mail::to($user->email) + ->queue($message); + } //end if + return 'OK'; + } + + /** + * @param mixed $contacts + * @param mixed $userId + * @return void + */ + private function syncContacts(mixed $contacts, mixed $userId) + { + $contacts = json_decode(json_encode($contacts), false); + foreach ($contacts as $contact) { + if ($contact->to_delete === true) { + $tmp = Contact::where([ + ['id', '=', $contact->uniq_id], + ['app_user_id', '=', $contact->app_user_id] + ])->first(); + if ($tmp) { + $tmp->delete(); + } + } else { + if ($contact->app_user_id != $userId) { + $tmp = Contact::where([ + ['id', '=', $contact->uniq_id], + ['app_user_id', '=', $userId] + ])->first(); + if ($tmp) { + $tmp->delete(); + } + } + $tmp = Contact::where([ + ['id', '=', $contact->uniq_id], + ['app_user_id', '=', $contact->app_user_id] + ])->first(); + if ($tmp) { + $tmp->email = $contact->email; + $tmp->type = $contact->type; + $tmp->other = $contact->other; + $tmp->select1 = $contact->select1; + $tmp->select2 = $contact->select2; + $tmp->lastname = $contact->lastname; + $tmp->firstname = $contact->firstname; + $tmp->company = $contact->company; + $tmp->address = $contact->address; + $tmp->phone = empty($contact->phone) ? "" : $contact->phone; + $tmp->products = $contact->products; + $tmp->notes = $contact->notes; + $tmp->visits = $contact->visits; + $tmp->app_user_id = $contact->app_user_id; + $tmp->save(); + } else { + $tmp = new Contact(); + $tmp->id = $contact->uniq_id; + $tmp->email = $contact->email; + $tmp->type = $contact->type; + $tmp->other = $contact->other; + $tmp->select1 = $contact->select1; + $tmp->select2 = $contact->select2; + $tmp->lastname = $contact->lastname; + $tmp->firstname = $contact->firstname; + $tmp->company = $contact->company; + $tmp->address = $contact->address; + $tmp->phone = empty($contact->phone) ? "" : $contact->phone; + $tmp->products = json_encode($contact->products); + $tmp->notes = $contact->notes; + $tmp->visits = $contact->visits; + $tmp->app_user_id = $contact->app_user_id; + $tmp->save(); + } //end if + } //end if + } //end foreach + } + + /** + * @param \Illuminate\Http\Request $request + * @return void + */ + public function processOcr(Request $request) + { + // Instantiates a client. + $imageAnnotator = new ImageAnnotatorClient([ + 'credentials' => public_path() . '/credentials.json' + ]); + + // The name of the image file to annotate. + $fileName = 'test.jpg'; + + // Prepare the image to be annotated. + $image = file_get_contents(public_path() . "/" . $fileName); + + // Performs label detection on the image file. + $response = $imageAnnotator->textDetection($image); + $labels = $response->getTextAnnotations(); + + foreach ($labels as $label) { + echo $label->getDescription() . "
"; + } + } +} diff --git a/app/Http/Controllers/Bo/DashboardController.php b/app/Http/Controllers/Bo/DashboardController.php index a79c1fe..6b04e7e 100644 --- a/app/Http/Controllers/Bo/DashboardController.php +++ b/app/Http/Controllers/Bo/DashboardController.php @@ -3,11 +3,15 @@ namespace App\Http\Controllers\Bo; use App\Http\Controllers\Controller; +use App\Models\Contact; +use Illuminate\Support\Facades\Storage; +use Parsedown; +use Illuminate\Support\Facades\File; class DashboardController extends Controller { /** - * Dashboard Page + * Show the application dashboard. * * @return \Illuminate\Contracts\View\View */ @@ -15,4 +19,48 @@ class DashboardController extends Controller { return view('bo.pages.dashboard'); } + + /** + * Récupérer les contacts (fichier .csv) et les fichiers. + * + * @return \Illuminate\Http\Response|\Illuminate\Contracts\Routing\ResponseFactory + */ + public function exportContact() + { + $csv_file = 'export-contacts.csv'; + $csvExporter = new \Laracsv\Export(); + $contacts = Contact::all(); + + $csvExporter->beforeEach(function ($contact) { + $contact->app_user_id = $contact->firstname . " " . $contact->lastname; + $contact->phone = "$contact->phone"; + }); + + $csvExporter->getWriter()->setDelimiter(';'); + $csvExporter->getWriter()->setEnclosure('"'); + $csvExporter->getWriter()->setOutputBOM(\League\Csv\Reader::BOM_UTF8); + $csvExporter->build($contacts, [ + 'app_user_id' => 'Propriétaire', + 'email' => 'Email', + 'type' => 'Type du contact', + 'other' => 'Type autre', + 'select1' => 'Select n°1', + 'select2' => 'Select n°2', + 'name' => 'Nom', + 'firstname' => 'Prénom', + 'company' => 'Entreprise', + 'address' => 'Adresse', + 'phone' => 'Téléphone', + 'notes' => 'Notes', + 'visits' => 'Visites', + ]); + + Storage::disk('public')->put($csv_file, $csvExporter->getWriter()->getContent()); + + return response()->download( + storage_path('app/public/') . "$csv_file", + 'contacts.csv', + ['Content-Type' => 'text/csv; charset=utf-8'] + )->deleteFileAfterSend(); + } } diff --git a/app/Http/Controllers/Bo/DirectoriesController.php b/app/Http/Controllers/Bo/DirectoriesController.php index e8bec46..682499a 100644 --- a/app/Http/Controllers/Bo/DirectoriesController.php +++ b/app/Http/Controllers/Bo/DirectoriesController.php @@ -6,6 +6,7 @@ use App\Http\Controllers\Controller; use App\Http\Requests\Bo\Directories\StoreDirectoryRequest; use App\Http\Requests\Bo\Directories\UpdateDirectoryRequest; use App\Models\Directory; +use App\Models\Setting; use Illuminate\Http\Request; use Illuminate\Support\Facades\DB; use Illuminate\Support\Str; @@ -35,7 +36,6 @@ class DirectoriesController extends Controller return DB::transaction(function () use ($request) { $directory = new Directory(); $directory->fill($request->validated()); - if ($directory->saveOrFail()) { return redirect() ->route('bo.directories.index') @@ -44,7 +44,6 @@ class DirectoriesController extends Controller ['model' => Str::singular(trans('models.classes.directories'))] )); } - return redirect() ->back() ->with('error', trans( @@ -102,26 +101,28 @@ class DirectoriesController extends Controller */ public function destroy(Directory $directory) { - return DB::transaction(function () use ($directory) { - foreach ($directory->children as $directoryChild) { - $directoryChild->directory_id = null; - $directoryChild->saveOrFail(); + foreach ($directory->children as $directoryChild) { + $directoryChild->directory_id = null; + $directoryChild->saveOrFail(); + } + $buttons = Setting::where('key', 'Button1')->orWhere('key', 'Button2')->orWhere('key', 'Button3')->get(); + foreach ($buttons as $button) { + if (isset($button->value) && intval($button->value) === $directory->id) { + return [ + $button->id => trans( + ':model :name n\'a pas été supprimé, + un bouton est encore associé à ce dernier dans les paramètres :', + [ + 'model' => Str::singular(trans('models.classes.directories')), + 'name' => $directory->name['fr'] + ] + ) + ]; } - if ($directory->deleteOrFail()) { - return redirect() - ->route('bo.directories.index') - ->with('warning', trans( - ':model a bien été supprimé', - ['model' => Str::singular(trans('models.classes.directories'))] - )); - } - return redirect() - ->back() - ->with('error', trans( - ':model n\'a pas été supprimé', - ['model' => Str::singular(trans('models.classes.directories'))] - )); - }); + } + if ($directory->deleteOrFail()) { + return Directory::orderBy('order', 'ASC')->get(); + } } /** @@ -138,11 +139,11 @@ class DirectoriesController extends Controller /** * Assign the new order and directory id to each directory. * - * @param array $directories - * @param mixed $directoryId + * @param array $directories + * @param integer $directoryId * @return void */ - public function assignOrder(array $directories, mixed $directoryId = null) + public function assignOrder(array $directories, int $directoryId = null) { foreach ($directories as $newDirectory) { $directory = Directory::where('id', $newDirectory['id'])->first(); @@ -167,18 +168,7 @@ class DirectoriesController extends Controller $directory->needAuthorization = $directory->needAuthorization ? false : true; if ($directory->saveOrFail()) { - return redirect() - ->route('bo.directories.index') - ->with('success', trans( - ':model a été mis à jour', - ['model' => Str::singular(trans('models.classes.directories'))] - )); + return $directory; } - return redirect() - ->back() - ->with('error', trans( - ':model n\'a été mis à jour', - ['model' => Str::singular(trans('models.classes.directories'))] - )); } } diff --git a/app/Http/Controllers/Bo/DocumentController.php b/app/Http/Controllers/Bo/DocumentController.php index 08486c7..066aa68 100644 --- a/app/Http/Controllers/Bo/DocumentController.php +++ b/app/Http/Controllers/Bo/DocumentController.php @@ -7,10 +7,13 @@ use App\Http\Requests\Bo\Documents\StoreDocumentRequest; use App\Http\Requests\Bo\Documents\UpdateDocumentRequest; use App\Models\Directory; use App\Models\Document; +use App\Models\Tag; use App\Traits\Controllers\ChangesModelOrder; +use Illuminate\Database\Eloquent\Builder; use Illuminate\Http\Request; use Illuminate\Http\UploadedFile; use Illuminate\Support\Facades\DB; +use Illuminate\Support\Facades\Storage; use Illuminate\Support\Str; use Pion\Laravel\ChunkUpload\Exceptions\UploadMissingFileException; use Pion\Laravel\ChunkUpload\Handler\HandlerFactory; @@ -30,6 +33,7 @@ class DocumentController extends Controller { /** @var \Illuminate\Database\Eloquent\Builder $documents */ $documents = Document::query(); + $tags = Tag::get(); if ($request->search) { $this->searchQuery( @@ -40,12 +44,23 @@ class DocumentController extends Controller ); } + $documents->when($request->tag, function ($query) use ($request) { + $query->whereHas('tags', function (Builder $query) use ($request) { + $query->where('id', $request->tag); + }); + }); + $this->sortQuery($documents); $searchFields = trans('Titre'); $documents = $documents->paginate(10); - return view('bo.pages.documents.index', compact('documents', 'searchFields')); + return view('bo.pages.documents.index', [ + 'documents' => $documents, + 'searchFields' => $searchFields, + 'searchTag' => $request->tag, + 'tags' => $tags + ]); } /** @@ -55,10 +70,11 @@ class DocumentController extends Controller */ public function create() { - $documents = Document::get(); + $documents = Document::where('lang', \App\Enums\Documents\LangEnum::fr())->get(); $directories = Directory::getChildrenDirectories(); + $tags = Tag::get(); - return view('bo.pages.documents.create', compact('documents', 'directories')); + return view('bo.pages.documents.create', compact('documents', 'directories', 'tags')); } /** @@ -72,8 +88,8 @@ class DocumentController extends Controller return DB::transaction(function () use ($request) { $document = new Document(); $document->fill($request->validated()); - if ($document->saveOrFail()) { + $document->tags()->sync(collect($request->tags)->pluck('id')); return redirect() ->route('bo.documents.edit', $document) ->with('success', trans( @@ -81,7 +97,6 @@ class DocumentController extends Controller ['model' => Str::singular(trans('models.classes.documents'))] )); } - return redirect() ->back() ->with('error', trans( @@ -99,13 +114,15 @@ class DocumentController extends Controller */ public function edit(Document $document) { - $documents = Document::get(); + $documents = Document::where('lang', \App\Enums\Documents\LangEnum::fr())->get(); $directories = Directory::getChildrenDirectories(); + $tags = Tag::get(); return view('bo.pages.documents.edit', [ 'documents' => $documents, 'documentModel' => $document, - 'directories' => $directories + 'directories' => $directories, + 'tags' => $tags ]); } @@ -120,6 +137,7 @@ class DocumentController extends Controller { return DB::transaction(function () use ($request, $document) { $document->fill($request->validated()); + $document->tags()->sync(collect($request->tags)->pluck('id')); if ($document->saveOrFail()) { return redirect() ->route('bo.documents.edit', $document) @@ -145,6 +163,10 @@ class DocumentController extends Controller */ public function destroy(Document $document) { + foreach ($document->children as $documentChild) { + Document::removeDocument($documentChild); + $documentChild->deleteOrFail(); + } if ($document->deleteOrFail()) { return redirect() ->route('bo.documents.index') @@ -153,7 +175,6 @@ class DocumentController extends Controller ['model' => Str::singular(trans('models.classes.documents'))] )); } - return redirect() ->back() ->with('error', trans( @@ -162,6 +183,19 @@ class DocumentController extends Controller )); } + /** + * Download the document + * + * @param mixed $uuid + * @return \Symfony\Component\HttpFoundation\BinaryFileResponse + */ + public function download(mixed $uuid) + { + $doc = Document::where('uuid', $uuid)->firstOrFail(); + $pathToFile = public_path() . Storage::url('docs/' . $doc->uuid . '.' . $doc->type); + return response()->download($pathToFile, $doc->path); + } + /** * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\JsonResponse diff --git a/app/Http/Controllers/Bo/SettingController.php b/app/Http/Controllers/Bo/SettingController.php index 3f675df..e8ddd51 100644 --- a/app/Http/Controllers/Bo/SettingController.php +++ b/app/Http/Controllers/Bo/SettingController.php @@ -6,43 +6,27 @@ use App\Http\Controllers\Controller; use App\Http\Requests\Bo\Settings\UpdateSettingRequest; use App\Models\Directory; use App\Models\Setting; -use App\Traits\Controllers\ChangesModelOrder; -use Illuminate\Http\Request; use Illuminate\Support\Facades\DB; use Illuminate\Support\Str; class SettingController extends Controller { - use ChangesModelOrder; - /** * Display a listing of the resource. * - * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ - public function index(Request $request) + public function index() { $directories = Directory::renderDirectories(Directory::whereNull('directory_id')->get()); /** @var \Illuminate\Database\Eloquent\Builder $settings */ $settings = Setting::query(); - if ($request->search) { - $this->searchQuery( - $settings, - $request->search, - null, - 'title', - ); - } - $this->sortQuery($settings); - $searchFields = trans('Titre'); + $settings = $settings->get(); - $settings = $settings->paginate(14); - - return view('bo.pages.settings.index', compact('settings', 'searchFields', 'directories')); + return view('bo.pages.settings.index', compact('settings', 'directories')); } /** diff --git a/app/Http/Controllers/Bo/TagController.php b/app/Http/Controllers/Bo/TagController.php new file mode 100644 index 0000000..2e5dac5 --- /dev/null +++ b/app/Http/Controllers/Bo/TagController.php @@ -0,0 +1,147 @@ +search) { + $this->searchQuery( + $tags, + $request->search, + null, + 'name', + ); + } + + $this->sortQuery($tags); + $searchFields = trans('Nom'); + + $tags = $tags->paginate(10); + + return view('bo.pages.tags.index', compact('tags', 'searchFields')); + } + + /** + * Show the form for creating a new resource. + * + * @return \Illuminate\Http\Response + */ + public function create() + { + return view('bo.pages.tags.create'); + } + + /** + * Store a newly created resource in storage. + * + * @param \App\Http\Requests\Bo\Tag\StoreTagRequest $request + * @return \Illuminate\Http\Response + */ + public function store(StoreTagRequest $request) + { + return DB::transaction(function () use ($request) { + $tag = new Tag(); + $tag->fill($request->validated()); + if ($tag->saveOrFail()) { + return redirect() + ->route('bo.tags.edit', $tag) + ->with('success', trans( + ':model a été créé', + ['model' => Str::singular(trans('models.classes.tags'))] + )); + } + return redirect() + ->back() + ->with('error', trans( + ':model n\'a pas été créé', + ['model' => Str::singular(trans('models.classes.tags'))] + )); + }); + } + + /** + * Show the form for editing the specified resource. + * + * @param \App\Models\Tag $tag + * @return \Illuminate\Http\Response + */ + public function edit(Tag $tag) + { + return view('bo.pages.tags.edit', ['tagModel' => $tag]); + } + + /** + * Update the specified resource in storage. + * + * @param \App\Http\Requests\Bo\Tag\UpdateTagRequest $request + * @param \App\Models\Tag $tag + * @return \Illuminate\Http\Response + */ + public function update(UpdateTagRequest $request, Tag $tag) + { + return DB::transaction(function () use ($request, $tag) { + $tag->fill($request->validated()); + + if ($tag->saveOrFail()) { + return redirect() + ->route('bo.tags.edit', $tag) + ->with('success', trans( + ':model a été mis à jour', + ['model' => Str::singular(trans('models.classes.tags'))] + )); + } + return redirect() + ->back() + ->with('error', trans( + ':model n\'a pas été mis à jour', + ['model' => Str::singular(trans('models.classes.tags'))] + )); + }); + } + + /** + * Remove the specified resource from storage. + * + * @param \App\Models\Tag $tag + * @return \Illuminate\Http\Response + */ + public function destroy(Tag $tag) + { + if ($tag->deleteOrFail()) { + return redirect() + ->route('bo.tags.index') + ->with('warning', trans( + ':model a bien été supprimé', + ['model' => Str::singular(trans('models.classes.tags'))] + )); + } + return redirect() + ->back() + ->with('error', trans( + ':model n\'a pas été supprimé', + ['model' => Str::singular(trans('models.classes.tags'))] + )); + } +} diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index 61765ee..84f0c8f 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -64,5 +64,6 @@ class Kernel extends HttpKernel 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class, 'htmlsanitize' => \App\Http\Middleware\HtmlSanitizer::class, + 'api.token' => \App\Http\Middleware\CheckApiToken::class, ]; } diff --git a/app/Http/Middleware/CheckApiToken.php b/app/Http/Middleware/CheckApiToken.php new file mode 100644 index 0000000..3f38e5b --- /dev/null +++ b/app/Http/Middleware/CheckApiToken.php @@ -0,0 +1,24 @@ +token) && $request->token == config('auth.API_TOKEN')) { + return $next($request); + } + return response()->json(['message' => 'Nope'], 401); + } +} diff --git a/app/Http/Requests/Bo/Documents/StoreDocumentRequest.php b/app/Http/Requests/Bo/Documents/StoreDocumentRequest.php index 1f6c935..0d0dfd1 100644 --- a/app/Http/Requests/Bo/Documents/StoreDocumentRequest.php +++ b/app/Http/Requests/Bo/Documents/StoreDocumentRequest.php @@ -18,6 +18,18 @@ class StoreDocumentRequest extends FormRequest return auth('backend')->check(); } + /** + * Prepare the data for validation. + * + * @return void + */ + protected function prepareForValidation() + { + $this->merge([ + 'status' => $this->status ? true : false + ]); + } + /** * Get the validation rules that apply to the request. * @@ -26,16 +38,17 @@ class StoreDocumentRequest extends FormRequest public function rules() { return [ + 'directory_id' => 'sometimes|nullable|integer', + 'document_id' => 'sometimes|nullable|integer', 'uuid' => 'required|min:3|max:255', 'title' => 'required|min:3|max:255', 'type' => 'required|min:3|max:255', - 'directory_id' => 'sometimes|nullable|integer', - 'document_id' => 'sometimes|nullable|integer', 'path' => 'required|min:3|max:255', 'lang' => [ 'required', new EnumIsValidRule(LangEnum::class) ], + 'status' => 'required|boolean' ]; } @@ -47,7 +60,14 @@ class StoreDocumentRequest extends FormRequest public function attributes() { return [ + 'directory_id' => \trans('dossier à associer'), + 'document_id' => \trans('document (FR) à associer'), 'title' => \trans('titre'), + 'uuid' => \trans('document'), + 'type' => \trans('type du document'), + 'path' => \trans('chemin du document'), + 'lang' => \trans('langue du document'), + 'status' => \trans('état de publication du document'), ]; } } diff --git a/app/Http/Requests/Bo/ImportRequest.php b/app/Http/Requests/Bo/ImportRequest.php index 5cd5f78..7e7d256 100644 --- a/app/Http/Requests/Bo/ImportRequest.php +++ b/app/Http/Requests/Bo/ImportRequest.php @@ -3,7 +3,6 @@ namespace App\Http\Requests\Bo; use Illuminate\Foundation\Http\FormRequest; -use Illuminate\Support\Facades\Auth; class ImportRequest extends FormRequest { @@ -14,7 +13,7 @@ class ImportRequest extends FormRequest */ public function authorize() { - return Auth::check(); + return auth('backend')->check(); } /** diff --git a/app/Http/Requests/Bo/Settings/UpdateSettingRequest.php b/app/Http/Requests/Bo/Settings/UpdateSettingRequest.php index 0c3e52d..ca290a4 100644 --- a/app/Http/Requests/Bo/Settings/UpdateSettingRequest.php +++ b/app/Http/Requests/Bo/Settings/UpdateSettingRequest.php @@ -2,6 +2,8 @@ namespace App\Http\Requests\Bo\Settings; +use App\Enums\UserRolesEnum; +use App\Models\Setting; use App\Traits\Requests\HasPicture; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Auth; @@ -25,7 +27,7 @@ class UpdateSettingRequest extends FormRequest ) { return auth('backend')->check(); } else { - return (auth('backend')->check() && Auth::user()->role === 1); + return (auth('backend')->check() && Auth::user()->role === UserRolesEnum::admin()->value); } } @@ -37,9 +39,14 @@ class UpdateSettingRequest extends FormRequest protected function prepareForValidation() { if ($this->key === "ShowIsActive") { - $this->merge(['value' => $this->value ? "true" : "false"]); - } - if ( + $this->merge(['value' => intval($this->value) ? "true" : "false"]); + } elseif ( + $this->key === "Button1" || + $this->key === "Button2" || + $this->key === "Button3" + ) { + $this->merge(['value' => $this->value === "0" ? null : $this->value]); + } elseif ( $this->key === "SquaredLogo" || $this->key === "RectangleLogo" || $this->key === "BackgroundImage" || @@ -56,22 +63,43 @@ class UpdateSettingRequest extends FormRequest */ public function rules() { - $rules = [ - 'value' => 'required|string|min:1', - ]; if ( + $this->key === "Button1" || + $this->key === "Button2" || + $this->key === "Button3" + ) { + $buttonsNullable = 0; + $buttons = Setting::where('key', 'Button1') + ->orWhere('key', 'Button2') + ->orWhere('key', 'Button3') + ->get(); + foreach ($buttons as $button) { + if ($button->value === null) { + if ($button->key !== $this->key) { + $buttonsNullable++; + } + }; + } + return [ + 'value' => [ + //phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassBeforeLastUsed + function ($attribute, $value, $fail) use ($buttonsNullable) { + if (!isset($value) && $buttonsNullable >= 2) { + $fail(\trans('Au moins 1 bouton doît être défini.')); + } + } + ] + ]; + } elseif ( $this->key === "SquaredLogo" || $this->key === "RectangleLogo" || $this->key === "BackgroundImage" || $this->key === "HomeButtonImage" ) { - return \array_merge( - $rules, - $this->pictureRules('value', true, 100, 100, 1920, 1200), - ); + return $this->pictureRules('value', true, 100, 100, 1920, 1200); } else { - return $rules; - } + return ['value' => 'required|string|min:1']; + } //end if } /** @@ -84,6 +112,7 @@ class UpdateSettingRequest extends FormRequest return [ 'key' => \trans('clé'), 'value' => \trans('valeur'), + 'type' => \trans('type'), ]; } } diff --git a/app/Http/Requests/Bo/Tags/StoreTagRequest.php b/app/Http/Requests/Bo/Tags/StoreTagRequest.php new file mode 100644 index 0000000..d9fb4d8 --- /dev/null +++ b/app/Http/Requests/Bo/Tags/StoreTagRequest.php @@ -0,0 +1,56 @@ +check(); + } + + /** + * Prepare the data for validation. + * + * @return void + */ + protected function prepareForValidation() + { + $this->merge([ + 'slug' => Str::slug($this->name), + ]); + } + + /** + * Get the validation rules that apply to the request. + * + * @return array + */ + public function rules() + { + return [ + 'name' => 'required|string|min:2|max:25', + ]; + } + + /** + * Get custom attributes for validator errors. + * + * @return array + */ + public function attributes(): array + { + return [ + 'name' => trans('name of the tag'), + 'slug' => trans('slug of the tag'), + ]; + } +} diff --git a/app/Http/Requests/Bo/Tags/UpdateTagRequest.php b/app/Http/Requests/Bo/Tags/UpdateTagRequest.php new file mode 100644 index 0000000..88166e6 --- /dev/null +++ b/app/Http/Requests/Bo/Tags/UpdateTagRequest.php @@ -0,0 +1,7 @@ +status = $status; + $this->datas = $datas; + } + + /** + * Transform the resource into an array. + * + * @param \Illuminate\Http\Request $request + * @return array + */ + public function toArray($request) + { + return [ + 'status' => $this->status, + 'datas' => $this->datas + ]; + } +} diff --git a/app/Http/Resources/AppUserCollection.php b/app/Http/Resources/AppUserCollection.php new file mode 100644 index 0000000..fa5b396 --- /dev/null +++ b/app/Http/Resources/AppUserCollection.php @@ -0,0 +1,19 @@ + $row[3], 'lastname' => ucfirst(strtolower($row[1])), 'firstname' => ucfirst(strtolower($row[2])), - 'password' => Str::random(10), + 'password' => '', 'status' => 1, 'role' => AppUserRolesEnum::user(), ]); + if ($user) { + $password = Str::random(10); + $user->password = Hash::make($password); + $user->save(); + + Mail::to($user->email)->send(new AccountCreated($user, $password)); + } + $user->saveOrFail(); return $user; diff --git a/app/Mail/AccountCreated.php b/app/Mail/AccountCreated.php new file mode 100644 index 0000000..015572a --- /dev/null +++ b/app/Mail/AccountCreated.php @@ -0,0 +1,47 @@ +user = $user; + $this->password = $password; + } + + /** + * Build the message. + * + * @return $this + */ + public function build() + { + return $this->subject(__("Votre compte a été créé"))->view('emails.account-created'); + } +} diff --git a/app/Mail/SendFlyer.php b/app/Mail/SendFlyer.php new file mode 100644 index 0000000..0573631 --- /dev/null +++ b/app/Mail/SendFlyer.php @@ -0,0 +1,40 @@ +data = (object)$data; + } + + /** + * Build the message. + * + * @return $this + */ + public function build() + { + return $this + ->from($this->data->from, $this->data->fromName) + ->subject($this->data->subject) + ->markdown('bo.mails.sendflyer'); + } +} diff --git a/app/Mail/SendFlyerFailed.php b/app/Mail/SendFlyerFailed.php new file mode 100644 index 0000000..68205a7 --- /dev/null +++ b/app/Mail/SendFlyerFailed.php @@ -0,0 +1,40 @@ +data = (object)$data; + } + + /** + * Build the message. + * + * @return $this + */ + public function build() + { + return $this + ->from('noreply@ldc.fr', '[APP] ' . config('app.name')) + ->subject('[MAIL] Une erreur est survenue') + ->view('bo.mails.sendflyerfailed', ['data' => $this->data]); + } +} diff --git a/app/Models/AppUser.php b/app/Models/AppUser.php index 61c2623..81cb6a1 100644 --- a/app/Models/AppUser.php +++ b/app/Models/AppUser.php @@ -103,6 +103,6 @@ class AppUser extends Model */ public function directories() { - return $this->morphToMany(Directory::class, 'taggable'); + return $this->morphToMany(Directory::class, 'directorable'); } } diff --git a/app/Models/Contact.php b/app/Models/Contact.php new file mode 100644 index 0000000..f529877 --- /dev/null +++ b/app/Models/Contact.php @@ -0,0 +1,63 @@ +belongsTo(AppUser::class, 'id', 'app_user_id'); + } +} diff --git a/app/Models/Directory.php b/app/Models/Directory.php index a759d13..d14bcaa 100644 --- a/app/Models/Directory.php +++ b/app/Models/Directory.php @@ -16,13 +16,6 @@ class Directory extends Model { use HasFactory; - /** - * The accessors to append to the model's array form. - * - * @var string[] - */ - protected $appends = ['is_system']; - /** * Fillable; * @@ -32,7 +25,8 @@ class Directory extends Model 'name', 'directory_id', 'order', - 'needAuthorization' + 'needAuthorization', + 'is_system' ]; /** @@ -52,6 +46,7 @@ class Directory extends Model protected static function booted() { static::creating(function (self $model) { + self::setIsSystem($model); self::setOrder($model); }); static::deleting(function (self $model) { @@ -76,14 +71,14 @@ class Directory extends Model } /** - * Check if is directory system. - * 1 = Salon + * Set order after the last element of the list. * - * @return boolean + * @param \Illuminate\Database\Eloquent\Model $model + * @return void */ - public function getIsSystemAttribute() + private static function setIsSystem(Model $model): void { - return $this->id === 1; + $model->is_system = ($model->is_system) ? $model->is_system : 0; } /** @@ -165,7 +160,7 @@ class Directory extends Model */ public function appusers() { - return $this->morphedByMany(AppUser::class, 'taggable'); + return $this->morphedByMany(AppUser::class, 'directorable'); } /** diff --git a/app/Models/Document.php b/app/Models/Document.php index 2d5732a..a16f042 100644 --- a/app/Models/Document.php +++ b/app/Models/Document.php @@ -41,6 +41,15 @@ class Document extends Model 'order', ]; + /** + * The attributes that should be cast. + * + * @var array + */ + protected $casts = [ + 'status' => 'bool' + ]; + /** * Map attribute names to enum classes. * @@ -62,6 +71,12 @@ class Document extends Model self::assertFieldIsUnique('title', $model->title); self::setOrder($model); }); + static::updating(function (self $model) { + $path = \ltrim(\urldecode("docs/" . $model->getOriginal('uuid') . $model->getOriginal('type')), '/'); + if (Storage::disk('public')->exists($path)) { + Storage::disk('public')->delete($path); + } + }); static::deleting(function (self $model) { self::removeDocument($model); }); @@ -94,24 +109,13 @@ class Document extends Model $model->order = \intval(self::query()->max('order')) + 1; } - /** - * Check if is directory system. - * 1 = Salon - * - * @return boolean - */ - public function getIsSystemAttribute() - { - return $this->id === 1; - } - /** * Set order after the last element of the list. * * @param \Illuminate\Database\Eloquent\Model $model * @return void */ - private static function removeDocument(Model $model): void + public static function removeDocument(Model $model): void { $path = \ltrim(\urldecode("storage/docs/" . $model->uuid . $model->type), '/'); if (\strpos($path, 'storage') !== 0) { @@ -142,7 +146,7 @@ class Document extends Model */ public function parent() { - return $this->belongsTo('App\Models\Documents', 'document_id'); + return $this->belongsTo('App\Models\Document', 'document_id'); } /** @@ -152,7 +156,7 @@ class Document extends Model */ public function children() { - return $this->hasMany('App\Models\Documents', 'document_id'); + return $this->hasMany('App\Models\Document', 'document_id'); } /** @@ -164,4 +168,14 @@ class Document extends Model { return $this->morphedByMany(AppUser::class, 'taggable'); } + + /** + * MorphToMany tags relation. + * + * @return \Illuminate\Database\Eloquent\Relations\MorphToMany + */ + public function tags() + { + return $this->morphToMany(Tag::class, 'taggable'); + } } diff --git a/app/Models/Tag.php b/app/Models/Tag.php new file mode 100644 index 0000000..745d0b2 --- /dev/null +++ b/app/Models/Tag.php @@ -0,0 +1,107 @@ +slug); + static::setOrder($tag); + }); + static::updating(function (self $tag) { + static::assertFieldIsUnique($tag->slug, $tag->id); + }); + static::deleting(function (self $tag) { + $tag->documents()->detach(); + }); + } + + // * METHODS + + /** + * Set the slug. + * + * @param \App\Models\Tag $tag + * + * @return void + */ + private static function setSlug(Tag $tag) + { + $tag->slug = Str::slug($tag->name); + } + + /** + * Asserts using validation that the field is unique. + * + * @param string $slug + * @param integer|null $id + * @return void + * @throws \Illuminate\Validation\ValidationException If field already exists. + */ + private static function assertFieldIsUnique(string $slug, ?int $id = null) + { + $table = (new self())->getTable(); + ToolboxHelper::assertFieldIsUnique($table, 'slug', $slug, $id); + } + + /** + * Set order after the last element of the list. + * + * @param \App\Models\Tag $tag + * @return void + */ + private static function setOrder(Tag $tag): void + { + $tag->order = \intval(self::query()->max('order')) + 1; + } + + // * RELATIONSHIPS + + /** + * MorphToMany documents relation. + * + * @return \Illuminate\Database\Eloquent\Relations\MorphToMany + */ + public function documents() + { + return $this->morphedByMany(Document::class, 'taggable'); + } +} diff --git a/app/Models/User.php b/app/Models/User.php index 86bbad3..33fc3a0 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -6,6 +6,7 @@ use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Notifications\Notifiable; use Illuminate\Support\Facades\Hash; +use App\Enums\UserRolesEnum; class User extends Authenticatable { @@ -45,6 +46,14 @@ class User extends Authenticatable 'email_verified_at' => 'datetime', ]; + /** + * cast enum + * @var string[] + */ + protected $enumCasts = [ + 'role' => UserRolesEnum::class + ]; + /** * Perform any actions required after the model boots. * diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index b4b23c2..5e10ac8 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -2,6 +2,7 @@ namespace App\Providers; +use Illuminate\Http\Resources\Json\JsonResource; use Illuminate\Support\Carbon; use Illuminate\Support\Facades\App; use Illuminate\Support\Facades\URL; @@ -36,5 +37,7 @@ class AppServiceProvider extends ServiceProvider \strtoupper(config('app.locale')) )); Carbon::setLocale(config('app.locale')); + + JsonResource::withoutWrapping(); } } diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php index 0a1d664..32fdd2e 100644 --- a/app/Providers/RouteServiceProvider.php +++ b/app/Providers/RouteServiceProvider.php @@ -4,6 +4,7 @@ namespace App\Providers; use App\Models\AppUser; use App\Models\Document; +use App\Models\Tag; use Illuminate\Cache\RateLimiting\Limit; use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; use Illuminate\Http\Request; @@ -36,10 +37,16 @@ class RouteServiceProvider extends ServiceProvider Route::middleware('web') ->namespace($this->namespace) ->group(base_path('routes/web-bo.php')); + + Route::prefix('api') + ->middleware('api') + ->namespace($this->namespace) + ->group(base_path('routes/api.php')); }); Route::model('appuser', AppUser::class); Route::model('document', Document::class); + Route::model('tag', Tag::class); } /** diff --git a/composer.json b/composer.json index fd761c8..cdbe90a 100644 --- a/composer.json +++ b/composer.json @@ -1,12 +1,7 @@ { - "name": "laravel/laravel", + "name": "uwil/com-app-bo", "version": "1.0.0", - "type": "project", - "time": "2023-03-02", - "description": "The Laravel Framework.", - "support": { - "email": "equipe.web@ldc.fr" - }, + "description": "Back-Office for Commercial App", "keywords": [ "framework", "laravel" @@ -15,7 +10,9 @@ "require": { "php": "^7.3|^8.0", "diglactic/laravel-breadcrumbs": "^6.1", + "erusev/parsedown": "^1.7", "fruitcake/laravel-cors": "^2.0", + "google/cloud-vision": "^0.25.0", "guzzlehttp/guzzle": "^7.0.1", "kwaadpepper/enum": "^2.1", "kwaadpepper/image-resizer": "^0.1.2", @@ -28,7 +25,8 @@ "mews/purifier": "^3.3", "pion/laravel-chunk-upload": "^1.3", "sentry/sentry-laravel": "^3.2", - "spatie/laravel-mix-preload": "^1.3" + "spatie/laravel-mix-preload": "^1.3", + "usmanhalalit/laracsv": "^2.0" }, "require-dev": { "facade/ignition": "^2.5", @@ -41,7 +39,7 @@ "slevomat/coding-standard": "^8.8" }, "repositories": { - "lab.s-web.fr/23": { + "lab.s-web.fr": { "type": "composer", "url": "https://lab.s-web.fr/api/v4/group/23/-/packages/composer/packages.json" } diff --git a/composer.lock b/composer.lock index 5570c60..e7e3bc9 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "e4d55d87b73a5b31ed2ede4aae62895a", + "content-hash": "50a250d6179ffe72463976367de14dc8", "packages": [ { "name": "asm89/stack-cors", @@ -345,28 +345,28 @@ }, { "name": "doctrine/inflector", - "version": "2.0.6", + "version": "2.0.8", "source": { "type": "git", "url": "https://github.com/doctrine/inflector.git", - "reference": "d9d313a36c872fd6ee06d9a6cbcf713eaa40f024" + "reference": "f9301a5b2fb1216b2b08f02ba04dc45423db6bff" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/inflector/zipball/d9d313a36c872fd6ee06d9a6cbcf713eaa40f024", - "reference": "d9d313a36c872fd6ee06d9a6cbcf713eaa40f024", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/f9301a5b2fb1216b2b08f02ba04dc45423db6bff", + "reference": "f9301a5b2fb1216b2b08f02ba04dc45423db6bff", "shasum": "" }, "require": { "php": "^7.2 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^10", + "doctrine/coding-standard": "^11.0", "phpstan/phpstan": "^1.8", "phpstan/phpstan-phpunit": "^1.1", "phpstan/phpstan-strict-rules": "^1.3", "phpunit/phpunit": "^8.5 || ^9.5", - "vimeo/psalm": "^4.25" + "vimeo/psalm": "^4.25 || ^5.4" }, "type": "library", "autoload": { @@ -416,7 +416,7 @@ ], "support": { "issues": "https://github.com/doctrine/inflector/issues", - "source": "https://github.com/doctrine/inflector/tree/2.0.6" + "source": "https://github.com/doctrine/inflector/tree/2.0.8" }, "funding": [ { @@ -432,7 +432,7 @@ "type": "tidelift" } ], - "time": "2022-10-20T09:10:12+00:00" + "time": "2023-06-16T13:40:37+00:00" }, { "name": "doctrine/lexer", @@ -639,6 +639,56 @@ ], "time": "2020-12-29T14:50:06+00:00" }, + { + "name": "erusev/parsedown", + "version": "1.7.4", + "source": { + "type": "git", + "url": "https://github.com/erusev/parsedown.git", + "reference": "cb17b6477dfff935958ba01325f2e8a2bfa6dab3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/erusev/parsedown/zipball/cb17b6477dfff935958ba01325f2e8a2bfa6dab3", + "reference": "cb17b6477dfff935958ba01325f2e8a2bfa6dab3", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35" + }, + "type": "library", + "autoload": { + "psr-0": { + "Parsedown": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Emanuil Rusev", + "email": "hello@erusev.com", + "homepage": "http://erusev.com" + } + ], + "description": "Parser for Markdown.", + "homepage": "http://parsedown.org", + "keywords": [ + "markdown", + "parser" + ], + "support": { + "issues": "https://github.com/erusev/parsedown/issues", + "source": "https://github.com/erusev/parsedown/tree/1.7.x" + }, + "time": "2019-12-30T22:54:17+00:00" + }, { "name": "ezyang/htmlpurifier", "version": "v4.16.0", @@ -753,6 +803,69 @@ }, "time": "2020-10-16T08:27:54+00:00" }, + { + "name": "firebase/php-jwt", + "version": "v6.4.0", + "source": { + "type": "git", + "url": "https://github.com/firebase/php-jwt.git", + "reference": "4dd1e007f22a927ac77da5a3fbb067b42d3bc224" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/firebase/php-jwt/zipball/4dd1e007f22a927ac77da5a3fbb067b42d3bc224", + "reference": "4dd1e007f22a927ac77da5a3fbb067b42d3bc224", + "shasum": "" + }, + "require": { + "php": "^7.1||^8.0" + }, + "require-dev": { + "guzzlehttp/guzzle": "^6.5||^7.4", + "phpspec/prophecy-phpunit": "^1.1", + "phpunit/phpunit": "^7.5||^9.5", + "psr/cache": "^1.0||^2.0", + "psr/http-client": "^1.0", + "psr/http-factory": "^1.0" + }, + "suggest": { + "ext-sodium": "Support EdDSA (Ed25519) signatures", + "paragonie/sodium_compat": "Support EdDSA (Ed25519) signatures when libsodium is not present" + }, + "type": "library", + "autoload": { + "psr-4": { + "Firebase\\JWT\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Neuman Vong", + "email": "neuman+pear@twilio.com", + "role": "Developer" + }, + { + "name": "Anant Narayanan", + "email": "anant@php.net", + "role": "Developer" + } + ], + "description": "A simple library to encode and decode JSON Web Tokens (JWT) in PHP. Should conform to the current spec.", + "homepage": "https://github.com/firebase/php-jwt", + "keywords": [ + "jwt", + "php" + ], + "support": { + "issues": "https://github.com/firebase/php-jwt/issues", + "source": "https://github.com/firebase/php-jwt/tree/v6.4.0" + }, + "time": "2023-02-09T21:01:23+00:00" + }, { "name": "fruitcake/laravel-cors", "version": "v2.2.0", @@ -833,6 +946,426 @@ "abandoned": true, "time": "2022-02-23T14:25:13+00:00" }, + { + "name": "google/auth", + "version": "v1.26.0", + "source": { + "type": "git", + "url": "https://github.com/googleapis/google-auth-library-php.git", + "reference": "f1f0d0319e2e7750ebfaa523c78819792a9ed9f7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/googleapis/google-auth-library-php/zipball/f1f0d0319e2e7750ebfaa523c78819792a9ed9f7", + "reference": "f1f0d0319e2e7750ebfaa523c78819792a9ed9f7", + "shasum": "" + }, + "require": { + "firebase/php-jwt": "^5.5||^6.0", + "guzzlehttp/guzzle": "^6.2.1|^7.0", + "guzzlehttp/psr7": "^1.7|^2.0", + "php": "^7.1||^8.0", + "psr/cache": "^1.0|^2.0|^3.0", + "psr/http-message": "^1.0" + }, + "require-dev": { + "guzzlehttp/promises": "0.1.1|^1.3", + "kelvinmo/simplejwt": "0.7.0", + "phpseclib/phpseclib": "^2.0.31||^3.0", + "phpspec/prophecy-phpunit": "^1.1||^2.0", + "phpunit/phpunit": "^7.5||^9.0.0", + "sebastian/comparator": ">=1.2.3", + "squizlabs/php_codesniffer": "^3.5" + }, + "suggest": { + "phpseclib/phpseclib": "May be used in place of OpenSSL for signing strings or for token management. Please require version ^2." + }, + "type": "library", + "autoload": { + "psr-4": { + "Google\\Auth\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "description": "Google Auth Library for PHP", + "homepage": "http://github.com/google/google-auth-library-php", + "keywords": [ + "Authentication", + "google", + "oauth2" + ], + "support": { + "docs": "https://googleapis.github.io/google-auth-library-php/main/", + "issues": "https://github.com/googleapis/google-auth-library-php/issues", + "source": "https://github.com/googleapis/google-auth-library-php/tree/v1.26.0" + }, + "time": "2023-04-05T15:11:57+00:00" + }, + { + "name": "google/cloud-core", + "version": "v1.49.4", + "source": { + "type": "git", + "url": "https://github.com/googleapis/google-cloud-php-core.git", + "reference": "6723a3fde6cc7a307a21ddbf7fce9cf6fab61833" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/googleapis/google-cloud-php-core/zipball/6723a3fde6cc7a307a21ddbf7fce9cf6fab61833", + "reference": "6723a3fde6cc7a307a21ddbf7fce9cf6fab61833", + "shasum": "" + }, + "require": { + "google/auth": "^1.18", + "guzzlehttp/guzzle": "^5.3|^6.5.7|^7.4.4", + "guzzlehttp/promises": "^1.3", + "guzzlehttp/psr7": "^1.7|^2.0", + "monolog/monolog": "^1.1|^2.0|^3.0", + "php": ">=5.6", + "psr/http-message": "^1.0", + "rize/uri-template": "~0.3" + }, + "require-dev": { + "erusev/parsedown": "^1.6", + "google/cloud-common-protos": "^0.3", + "google/gax": "^1.9", + "opis/closure": "^3", + "phpdocumentor/reflection": "^3.0||^4.0||^5.3", + "phpspec/prophecy": "^1.10.3", + "phpunit/phpunit": "^4.8|^5.0|^8.0", + "squizlabs/php_codesniffer": "2.*", + "yoast/phpunit-polyfills": "^1.0" + }, + "suggest": { + "opis/closure": "May be used to serialize closures to process jobs in the batch daemon. Please require version ^3.", + "symfony/lock": "Required for the Spanner cached based session pool. Please require the following commit: 3.3.x-dev#1ba6ac9" + }, + "bin": [ + "bin/google-cloud-batch" + ], + "type": "library", + "extra": { + "component": { + "id": "cloud-core", + "target": "googleapis/google-cloud-php-core.git", + "path": "Core", + "entry": "src/ServiceBuilder.php" + } + }, + "autoload": { + "psr-4": { + "Google\\Cloud\\Core\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "description": "Google Cloud PHP shared dependency, providing functionality useful to all components.", + "support": { + "source": "https://github.com/googleapis/google-cloud-php-core/tree/v1.49.4" + }, + "time": "2023-04-07T21:48:59+00:00" + }, + { + "name": "google/cloud-vision", + "version": "v0.25.1", + "source": { + "type": "git", + "url": "https://github.com/googleapis/google-cloud-php-vision.git", + "reference": "810e555ab0f30723cd09b818afbc4185750ffe96" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/googleapis/google-cloud-php-vision/zipball/810e555ab0f30723cd09b818afbc4185750ffe96", + "reference": "810e555ab0f30723cd09b818afbc4185750ffe96", + "shasum": "" + }, + "require": { + "google/cloud-core": "^1.35", + "google/gax": "^1.1" + }, + "require-dev": { + "erusev/parsedown": "^1.6", + "google/cloud-storage": "^1.12", + "phpdocumentor/reflection": "^3.0", + "phpunit/phpunit": "^4.8|^5.0", + "squizlabs/php_codesniffer": "2.*" + }, + "suggest": { + "ext-grpc": "The gRPC extension enables use of the performant gRPC transport", + "ext-protobuf": "Provides a significant increase in throughput over the pure PHP protobuf implementation. See https://cloud.google.com/php/grpc for installation instructions.", + "google/cloud-storage": "Annotate images stored in Google Cloud Storage" + }, + "type": "library", + "extra": { + "component": { + "id": "cloud-vision", + "target": "googleapis/google-cloud-php-vision.git", + "path": "Vision", + "entry": "src/VisionClient.php" + } + }, + "autoload": { + "psr-4": { + "Google\\Cloud\\Vision\\": "src", + "GPBMetadata\\Google\\Cloud\\Vision\\": "metadata" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "description": "Cloud Vision Client for PHP", + "support": { + "source": "https://github.com/googleapis/google-cloud-php-vision/tree/v0.25.1" + }, + "time": "2020-03-13T00:24:10+00:00" + }, + { + "name": "google/common-protos", + "version": "v3.2.0", + "source": { + "type": "git", + "url": "https://github.com/googleapis/common-protos-php.git", + "reference": "57d4ad36cc48cc0369123042908013ef2a86bb98" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/googleapis/common-protos-php/zipball/57d4ad36cc48cc0369123042908013ef2a86bb98", + "reference": "57d4ad36cc48cc0369123042908013ef2a86bb98", + "shasum": "" + }, + "require": { + "google/protobuf": "^3.6.1" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.36||^8.5", + "sami/sami": "*" + }, + "type": "library", + "autoload": { + "psr-4": { + "Google\\Api\\": "src/Api", + "Google\\Iam\\": "src/Iam", + "Google\\Rpc\\": "src/Rpc", + "Google\\Type\\": "src/Type", + "Google\\Cloud\\": "src/Cloud", + "GPBMetadata\\Google\\Api\\": "metadata/Api", + "GPBMetadata\\Google\\Iam\\": "metadata/Iam", + "GPBMetadata\\Google\\Rpc\\": "metadata/Rpc", + "GPBMetadata\\Google\\Type\\": "metadata/Type", + "GPBMetadata\\Google\\Cloud\\": "metadata/Cloud", + "GPBMetadata\\Google\\Logging\\": "metadata/Logging" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "description": "Google API Common Protos for PHP", + "homepage": "https://github.com/googleapis/common-protos-php", + "keywords": [ + "google" + ], + "support": { + "issues": "https://github.com/googleapis/common-protos-php/issues", + "source": "https://github.com/googleapis/common-protos-php/tree/v3.2.0" + }, + "time": "2023-01-12T16:51:46+00:00" + }, + { + "name": "google/gax", + "version": "v1.19.1", + "source": { + "type": "git", + "url": "https://github.com/googleapis/gax-php.git", + "reference": "30f6b307faa9858bf58d967664467098dbbc354f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/googleapis/gax-php/zipball/30f6b307faa9858bf58d967664467098dbbc354f", + "reference": "30f6b307faa9858bf58d967664467098dbbc354f", + "shasum": "" + }, + "require": { + "google/auth": "1.19.1||^1.25.0", + "google/common-protos": "^1.3.1||^2.0||^3.0", + "google/grpc-gcp": "^0.2", + "google/longrunning": "^0.2", + "google/protobuf": "^3.21.4", + "grpc/grpc": "^1.13", + "guzzlehttp/promises": "^1.3", + "guzzlehttp/psr7": "^1.7.0||^2", + "php": ">=7.0" + }, + "conflict": { + "ext-protobuf": "<3.7.0" + }, + "require-dev": { + "phpspec/prophecy": "^1.10", + "phpunit/phpunit": "^5.5||^8.5", + "squizlabs/php_codesniffer": "3.*", + "yoast/phpunit-polyfills": "^1.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Google\\ApiCore\\": "src", + "GPBMetadata\\ApiCore\\": "metadata/ApiCore" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Google API Core for PHP", + "homepage": "https://github.com/googleapis/gax-php", + "keywords": [ + "google" + ], + "support": { + "issues": "https://github.com/googleapis/gax-php/issues", + "source": "https://github.com/googleapis/gax-php/tree/v1.19.1" + }, + "time": "2023-03-16T19:58:19+00:00" + }, + { + "name": "google/grpc-gcp", + "version": "v0.2.1", + "source": { + "type": "git", + "url": "https://github.com/GoogleCloudPlatform/grpc-gcp-php.git", + "reference": "899d0112812a812df7692617a59f4076f0d01719" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/GoogleCloudPlatform/grpc-gcp-php/zipball/899d0112812a812df7692617a59f4076f0d01719", + "reference": "899d0112812a812df7692617a59f4076f0d01719", + "shasum": "" + }, + "require": { + "google/auth": "^1.3", + "google/protobuf": "^v3.3.0", + "grpc/grpc": "^v1.13.0", + "php": ">=5.5.0", + "psr/cache": "^1.0.1||^2.0.0||^3.0.0" + }, + "require-dev": { + "google/cloud-spanner": "^1.7", + "phpunit/phpunit": "4.8.36" + }, + "type": "library", + "autoload": { + "psr-4": { + "Grpc\\Gcp\\": "src/" + }, + "classmap": [ + "src/generated/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "description": "gRPC GCP library for channel management", + "support": { + "issues": "https://github.com/GoogleCloudPlatform/grpc-gcp-php/issues", + "source": "https://github.com/GoogleCloudPlatform/grpc-gcp-php/tree/v0.2.1" + }, + "time": "2022-10-11T15:54:47+00:00" + }, + { + "name": "google/longrunning", + "version": "v0.2.6", + "source": { + "type": "git", + "url": "https://github.com/googleapis/php-longrunning.git", + "reference": "9689b4db54cf4cf8186118d9d59aa9ba35bb5842" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/googleapis/php-longrunning/zipball/9689b4db54cf4cf8186118d9d59aa9ba35bb5842", + "reference": "9689b4db54cf4cf8186118d9d59aa9ba35bb5842", + "shasum": "" + }, + "require-dev": { + "google/gax": "^1.13.0", + "phpunit/phpunit": "^9.0" + }, + "type": "library", + "extra": { + "component": { + "id": "longrunning", + "path": "LongRunning", + "entry": null, + "target": "googleapis/php-longrunning" + } + }, + "autoload": { + "psr-4": { + "Google\\LongRunning\\": "src/LongRunning", + "Google\\ApiCore\\LongRunning\\": "src/ApiCore/LongRunning", + "GPBMetadata\\Google\\Longrunning\\": "metadata/Longrunning" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "description": "Google LongRunning Client for PHP", + "support": { + "source": "https://github.com/googleapis/php-longrunning/tree/v0.2.6" + }, + "time": "2023-04-21T14:12:59+00:00" + }, + { + "name": "google/protobuf", + "version": "v3.23.4", + "source": { + "type": "git", + "url": "https://github.com/protocolbuffers/protobuf-php.git", + "reference": "fa784054760eec532fe8dd1919d3a0a11f5cef1f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/fa784054760eec532fe8dd1919d3a0a11f5cef1f", + "reference": "fa784054760eec532fe8dd1919d3a0a11f5cef1f", + "shasum": "" + }, + "require": { + "php": ">=7.0.0" + }, + "require-dev": { + "phpunit/phpunit": ">=5.0.0" + }, + "suggest": { + "ext-bcmath": "Need to support JSON deserialization" + }, + "type": "library", + "autoload": { + "psr-4": { + "Google\\Protobuf\\": "src/Google/Protobuf", + "GPBMetadata\\Google\\Protobuf\\": "src/GPBMetadata/Google/Protobuf" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "proto library for PHP", + "homepage": "https://developers.google.com/protocol-buffers/", + "keywords": [ + "proto" + ], + "support": { + "source": "https://github.com/protocolbuffers/protobuf-php/tree/v3.23.4" + }, + "time": "2023-07-06T18:51:48+00:00" + }, { "name": "graham-campbell/result-type", "version": "v1.1.1", @@ -896,23 +1429,67 @@ "time": "2023-02-25T20:23:15+00:00" }, { - "name": "guzzlehttp/guzzle", - "version": "7.5.0", + "name": "grpc/grpc", + "version": "1.52.0", "source": { "type": "git", - "url": "https://github.com/guzzle/guzzle.git", - "reference": "b50a2a1251152e43f6a37f0fa053e730a67d25ba" + "url": "https://github.com/grpc/grpc-php.git", + "reference": "98394cd601a587ca68294e6209bd713856969105" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/b50a2a1251152e43f6a37f0fa053e730a67d25ba", - "reference": "b50a2a1251152e43f6a37f0fa053e730a67d25ba", + "url": "https://api.github.com/repos/grpc/grpc-php/zipball/98394cd601a587ca68294e6209bd713856969105", + "reference": "98394cd601a587ca68294e6209bd713856969105", + "shasum": "" + }, + "require": { + "php": ">=7.0.0" + }, + "require-dev": { + "google/auth": "^v1.3.0" + }, + "suggest": { + "ext-protobuf": "For better performance, install the protobuf C extension.", + "google/protobuf": "To get started using grpc quickly, install the native protobuf library." + }, + "type": "library", + "autoload": { + "psr-4": { + "Grpc\\": "src/lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "description": "gRPC library for PHP", + "homepage": "https://grpc.io", + "keywords": [ + "rpc" + ], + "support": { + "source": "https://github.com/grpc/grpc-php/tree/v1.52.0" + }, + "time": "2023-02-25T05:20:08+00:00" + }, + { + "name": "guzzlehttp/guzzle", + "version": "7.7.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "fb7566caccf22d74d1ab270de3551f72a58399f5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/fb7566caccf22d74d1ab270de3551f72a58399f5", + "reference": "fb7566caccf22d74d1ab270de3551f72a58399f5", "shasum": "" }, "require": { "ext-json": "*", - "guzzlehttp/promises": "^1.5", - "guzzlehttp/psr7": "^1.9 || ^2.4", + "guzzlehttp/promises": "^1.5.3 || ^2.0", + "guzzlehttp/psr7": "^1.9.1 || ^2.4.5", "php": "^7.2.5 || ^8.0", "psr/http-client": "^1.0", "symfony/deprecation-contracts": "^2.2 || ^3.0" @@ -923,7 +1500,8 @@ "require-dev": { "bamarni/composer-bin-plugin": "^1.8.1", "ext-curl": "*", - "php-http/client-integration-tests": "^3.0", + "php-http/client-integration-tests": "dev-master#2c025848417c1135031fdf9c728ee53d0a7ceaee as 3.0.999", + "php-http/message-factory": "^1.1", "phpunit/phpunit": "^8.5.29 || ^9.5.23", "psr/log": "^1.1 || ^2.0 || ^3.0" }, @@ -937,9 +1515,6 @@ "bamarni-bin": { "bin-links": true, "forward-command": false - }, - "branch-alias": { - "dev-master": "7.5-dev" } }, "autoload": { @@ -1005,7 +1580,7 @@ ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/7.5.0" + "source": "https://github.com/guzzle/guzzle/tree/7.7.0" }, "funding": [ { @@ -1021,20 +1596,20 @@ "type": "tidelift" } ], - "time": "2022-08-28T15:39:27+00:00" + "time": "2023-05-21T14:04:53+00:00" }, { "name": "guzzlehttp/promises", - "version": "1.5.2", + "version": "1.5.3", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "b94b2807d85443f9719887892882d0329d1e2598" + "reference": "67ab6e18aaa14d753cc148911d273f6e6cb6721e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/b94b2807d85443f9719887892882d0329d1e2598", - "reference": "b94b2807d85443f9719887892882d0329d1e2598", + "url": "https://api.github.com/repos/guzzle/promises/zipball/67ab6e18aaa14d753cc148911d273f6e6cb6721e", + "reference": "67ab6e18aaa14d753cc148911d273f6e6cb6721e", "shasum": "" }, "require": { @@ -1044,11 +1619,6 @@ "symfony/phpunit-bridge": "^4.4 || ^5.1" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.5-dev" - } - }, "autoload": { "files": [ "src/functions_include.php" @@ -1089,7 +1659,7 @@ ], "support": { "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/1.5.2" + "source": "https://github.com/guzzle/promises/tree/1.5.3" }, "funding": [ { @@ -1105,26 +1675,26 @@ "type": "tidelift" } ], - "time": "2022-08-28T14:55:35+00:00" + "time": "2023-05-21T12:31:43+00:00" }, { "name": "guzzlehttp/psr7", - "version": "2.4.4", + "version": "2.5.0", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "3cf1b6d4f0c820a2cf8bcaec39fc698f3443b5cf" + "reference": "b635f279edd83fc275f822a1188157ffea568ff6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/3cf1b6d4f0c820a2cf8bcaec39fc698f3443b5cf", - "reference": "3cf1b6d4f0c820a2cf8bcaec39fc698f3443b5cf", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/b635f279edd83fc275f822a1188157ffea568ff6", + "reference": "b635f279edd83fc275f822a1188157ffea568ff6", "shasum": "" }, "require": { "php": "^7.2.5 || ^8.0", "psr/http-factory": "^1.0", - "psr/http-message": "^1.0", + "psr/http-message": "^1.1 || ^2.0", "ralouphie/getallheaders": "^3.0" }, "provide": { @@ -1144,9 +1714,6 @@ "bamarni-bin": { "bin-links": true, "forward-command": false - }, - "branch-alias": { - "dev-master": "2.4-dev" } }, "autoload": { @@ -1208,7 +1775,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/2.4.4" + "source": "https://github.com/guzzle/psr7/tree/2.5.0" }, "funding": [ { @@ -1224,7 +1791,7 @@ "type": "tidelift" } ], - "time": "2023-03-09T13:19:02+00:00" + "time": "2023-04-17T16:11:26+00:00" }, { "name": "http-interop/http-factory-guzzle", @@ -1556,16 +2123,16 @@ }, { "name": "kwaadpepper/image-resizer", - "version": "0.1.2", + "version": "0.1.3", "source": { "type": "git", "url": "https://github.com/Kwaadpepper/image-resizer.git", - "reference": "5af71cf1c40ca15c061b32166e606dfddc39da0a" + "reference": "24b95e15360711b5fa62fdd34d14e1d22469af16" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Kwaadpepper/image-resizer/zipball/5af71cf1c40ca15c061b32166e606dfddc39da0a", - "reference": "5af71cf1c40ca15c061b32166e606dfddc39da0a", + "url": "https://api.github.com/repos/Kwaadpepper/image-resizer/zipball/24b95e15360711b5fa62fdd34d14e1d22469af16", + "reference": "24b95e15360711b5fa62fdd34d14e1d22469af16", "shasum": "" }, "require": { @@ -1613,9 +2180,9 @@ ], "support": { "issues": "https://github.com/Kwaadpepper/image-resizer/issues", - "source": "https://github.com/Kwaadpepper/image-resizer/tree/0.1.2" + "source": "https://github.com/Kwaadpepper/image-resizer/tree/0.1.3" }, - "time": "2022-10-17T16:05:21+00:00" + "time": "2023-04-07T13:15:30+00:00" }, { "name": "laravel/framework", @@ -2045,16 +2612,16 @@ }, { "name": "ldc/web-status-checker", - "version": "1.0.2", + "version": "1.1.0", "source": { "type": "git", "url": "https://lab.s-web.fr/ldc-web/projets/ldc-web-status-checker.git", - "reference": "70a4f96a272f42f9caaf8f614190a3e061273bc8" + "reference": "7ce62449f3eb052de2d7bfa2e32d37d4524d60b0" }, "dist": { "type": "zip", - "url": "https://lab.s-web.fr/api/v4/projects/21/packages/composer/archives/ldc/web-status-checker.zip?sha=70a4f96a272f42f9caaf8f614190a3e061273bc8", - "reference": "70a4f96a272f42f9caaf8f614190a3e061273bc8", + "url": "https://lab.s-web.fr/api/v4/projects/21/packages/composer/archives/ldc/web-status-checker.zip?sha=7ce62449f3eb052de2d7bfa2e32d37d4524d60b0", + "reference": "7ce62449f3eb052de2d7bfa2e32d37d4524d60b0", "shasum": "" }, "require": { @@ -2090,28 +2657,25 @@ }, { "name": "ldc/web-status-checker-laravel", - "version": "1.0.3", + "version": "1.1.0", "source": { "type": "git", "url": "https://lab.s-web.fr/ldc-web/projets/ldc-web-status-checker-laravel.git", - "reference": "32965e7425060c4167b40e5c0868c438ea94c14f" + "reference": "3918891846f1e8440ba54b23dc47422f005070b9" }, "dist": { "type": "zip", - "url": "https://lab.s-web.fr/api/v4/projects/22/packages/composer/archives/ldc/web-status-checker-laravel.zip?sha=32965e7425060c4167b40e5c0868c438ea94c14f", - "reference": "32965e7425060c4167b40e5c0868c438ea94c14f", + "url": "https://lab.s-web.fr/api/v4/projects/22/packages/composer/archives/ldc/web-status-checker-laravel.zip?sha=3918891846f1e8440ba54b23dc47422f005070b9", + "reference": "3918891846f1e8440ba54b23dc47422f005070b9", "shasum": "" }, "require": { - "illuminate/support": "~8|~9", - "laravel/framework": "~8|~9", - "ldc/web-status-checker": "^1.0", + "illuminate/support": "~8|~9|~10", + "laravel/framework": "~8|~9|~10", + "ldc/web-status-checker": "^1.1.0", "php": "~7.3|7.4|~8" }, "require-dev": { - "orchestra/testbench": "^6.24", - "phpunit/php-code-coverage": "^9.2", - "phpunit/phpunit": "~9.0", "slevomat/coding-standard": "^7.0", "squizlabs/php_codesniffer": "^3.5" }, @@ -2246,6 +2810,90 @@ ], "time": "2022-01-13T17:18:13+00:00" }, + { + "name": "league/csv", + "version": "9.7.4", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/csv.git", + "reference": "002f55f649e7511710dc7154ff44c7be32c8195c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/csv/zipball/002f55f649e7511710dc7154ff44c7be32c8195c", + "reference": "002f55f649e7511710dc7154ff44c7be32c8195c", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-mbstring": "*", + "php": "^7.3 || ^8.0" + }, + "require-dev": { + "ext-curl": "*", + "ext-dom": "*", + "friendsofphp/php-cs-fixer": "^3.0", + "phpstan/phpstan": "^1.0", + "phpstan/phpstan-phpunit": "^1.0.0", + "phpstan/phpstan-strict-rules": "^1.0", + "phpunit/phpunit": "^9.5" + }, + "suggest": { + "ext-dom": "Required to use the XMLConverter and or the HTMLConverter classes", + "ext-iconv": "Needed to ease transcoding CSV using iconv stream filters" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.x-dev" + } + }, + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "League\\Csv\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ignace Nyamagana Butera", + "email": "nyamsprod@gmail.com", + "homepage": "https://github.com/nyamsprod/", + "role": "Developer" + } + ], + "description": "CSV data manipulation made easy in PHP", + "homepage": "http://csv.thephpleague.com", + "keywords": [ + "convert", + "csv", + "export", + "filter", + "import", + "read", + "transform", + "write" + ], + "support": { + "docs": "https://csv.thephpleague.com", + "issues": "https://github.com/thephpleague/csv/issues", + "rss": "https://github.com/thephpleague/csv/releases.atom", + "source": "https://github.com/thephpleague/csv" + }, + "funding": [ + { + "url": "https://github.com/sponsors/nyamsprod", + "type": "github" + } + ], + "time": "2021-11-30T07:09:34+00:00" + }, { "name": "league/flysystem", "version": "1.1.10", @@ -2903,16 +3551,16 @@ }, { "name": "nesbot/carbon", - "version": "2.66.0", + "version": "2.68.1", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "496712849902241f04902033b0441b269effe001" + "reference": "4f991ed2a403c85efbc4f23eb4030063fdbe01da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/496712849902241f04902033b0441b269effe001", - "reference": "496712849902241f04902033b0441b269effe001", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/4f991ed2a403c85efbc4f23eb4030063fdbe01da", + "reference": "4f991ed2a403c85efbc4f23eb4030063fdbe01da", "shasum": "" }, "require": { @@ -3001,20 +3649,20 @@ "type": "tidelift" } ], - "time": "2023-01-29T18:53:47+00:00" + "time": "2023-06-20T18:29:04+00:00" }, { "name": "nikic/php-parser", - "version": "v4.15.4", + "version": "v4.16.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "6bb5176bc4af8bcb7d926f88718db9b96a2d4290" + "reference": "19526a33fb561ef417e822e85f08a00db4059c17" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/6bb5176bc4af8bcb7d926f88718db9b96a2d4290", - "reference": "6bb5176bc4af8bcb7d926f88718db9b96a2d4290", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/19526a33fb561ef417e822e85f08a00db4059c17", + "reference": "19526a33fb561ef417e822e85f08a00db4059c17", "shasum": "" }, "require": { @@ -3055,44 +3703,45 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.4" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.16.0" }, - "time": "2023-03-05T19:49:14+00:00" + "time": "2023-06-25T14:52:30+00:00" }, { "name": "nyholm/psr7", - "version": "1.5.1", + "version": "1.8.0", "source": { "type": "git", "url": "https://github.com/Nyholm/psr7.git", - "reference": "f734364e38a876a23be4d906a2a089e1315be18a" + "reference": "3cb4d163b58589e47b35103e8e5e6a6a475b47be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Nyholm/psr7/zipball/f734364e38a876a23be4d906a2a089e1315be18a", - "reference": "f734364e38a876a23be4d906a2a089e1315be18a", + "url": "https://api.github.com/repos/Nyholm/psr7/zipball/3cb4d163b58589e47b35103e8e5e6a6a475b47be", + "reference": "3cb4d163b58589e47b35103e8e5e6a6a475b47be", "shasum": "" }, "require": { - "php": ">=7.1", - "php-http/message-factory": "^1.0", + "php": ">=7.2", "psr/http-factory": "^1.0", - "psr/http-message": "^1.0" + "psr/http-message": "^1.1 || ^2.0" }, "provide": { + "php-http/message-factory-implementation": "1.0", "psr/http-factory-implementation": "1.0", "psr/http-message-implementation": "1.0" }, "require-dev": { "http-interop/http-factory-tests": "^0.9", + "php-http/message-factory": "^1.0", "php-http/psr7-integration-tests": "^1.0", - "phpunit/phpunit": "^7.5 || 8.5 || 9.4", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.4", "symfony/error-handler": "^4.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "1.8-dev" } }, "autoload": { @@ -3122,7 +3771,7 @@ ], "support": { "issues": "https://github.com/Nyholm/psr7/issues", - "source": "https://github.com/Nyholm/psr7/tree/1.5.1" + "source": "https://github.com/Nyholm/psr7/tree/1.8.0" }, "funding": [ { @@ -3134,7 +3783,7 @@ "type": "github" } ], - "time": "2022-06-22T07:13:36+00:00" + "time": "2023-05-02T11:26:24+00:00" }, { "name": "opis/closure", @@ -3203,26 +3852,25 @@ }, { "name": "php-http/client-common", - "version": "2.6.0", + "version": "2.7.0", "source": { "type": "git", "url": "https://github.com/php-http/client-common.git", - "reference": "45db684cd4e186dcdc2b9c06b22970fe123796c0" + "reference": "880509727a447474d2a71b7d7fa5d268ddd3db4b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/client-common/zipball/45db684cd4e186dcdc2b9c06b22970fe123796c0", - "reference": "45db684cd4e186dcdc2b9c06b22970fe123796c0", + "url": "https://api.github.com/repos/php-http/client-common/zipball/880509727a447474d2a71b7d7fa5d268ddd3db4b", + "reference": "880509727a447474d2a71b7d7fa5d268ddd3db4b", "shasum": "" }, "require": { "php": "^7.1 || ^8.0", "php-http/httplug": "^2.0", "php-http/message": "^1.6", - "php-http/message-factory": "^1.0", "psr/http-client": "^1.0", "psr/http-factory": "^1.0", - "psr/http-message": "^1.0", + "psr/http-message": "^1.0 || ^2.0", "symfony/options-resolver": "~4.0.15 || ~4.1.9 || ^4.2.1 || ^5.0 || ^6.0", "symfony/polyfill-php80": "^1.17" }, @@ -3232,7 +3880,7 @@ "nyholm/psr7": "^1.2", "phpspec/phpspec": "^5.1 || ^6.3 || ^7.1", "phpspec/prophecy": "^1.10.2", - "phpunit/phpunit": "^7.5.15 || ^8.5 || ^9.3" + "phpunit/phpunit": "^7.5.20 || ^8.5.33 || ^9.6.7" }, "suggest": { "ext-json": "To detect JSON responses with the ContentTypePlugin", @@ -3242,11 +3890,6 @@ "php-http/stopwatch-plugin": "Symfony Stopwatch plugin" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.3.x-dev" - } - }, "autoload": { "psr-4": { "Http\\Client\\Common\\": "src/" @@ -3272,22 +3915,22 @@ ], "support": { "issues": "https://github.com/php-http/client-common/issues", - "source": "https://github.com/php-http/client-common/tree/2.6.0" + "source": "https://github.com/php-http/client-common/tree/2.7.0" }, - "time": "2022-09-29T09:59:43+00:00" + "time": "2023-05-17T06:46:59+00:00" }, { "name": "php-http/discovery", - "version": "1.15.2", + "version": "1.19.1", "source": { "type": "git", "url": "https://github.com/php-http/discovery.git", - "reference": "5cc428320191ac1d0b6520034c2dc0698628ced5" + "reference": "57f3de01d32085fea20865f9b16fb0e69347c39e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/discovery/zipball/5cc428320191ac1d0b6520034c2dc0698628ced5", - "reference": "5cc428320191ac1d0b6520034c2dc0698628ced5", + "url": "https://api.github.com/repos/php-http/discovery/zipball/57f3de01d32085fea20865f9b16fb0e69347c39e", + "reference": "57f3de01d32085fea20865f9b16fb0e69347c39e", "shasum": "" }, "require": { @@ -3295,7 +3938,8 @@ "php": "^7.1 || ^8.0" }, "conflict": { - "nyholm/psr7": "<1.0" + "nyholm/psr7": "<1.0", + "zendframework/zend-diactoros": "*" }, "provide": { "php-http/async-client-implementation": "*", @@ -3320,7 +3964,10 @@ "autoload": { "psr-4": { "Http\\Discovery\\": "src/" - } + }, + "exclude-from-classmap": [ + "src/Composer/Plugin.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -3346,40 +3993,35 @@ ], "support": { "issues": "https://github.com/php-http/discovery/issues", - "source": "https://github.com/php-http/discovery/tree/1.15.2" + "source": "https://github.com/php-http/discovery/tree/1.19.1" }, - "time": "2023-02-11T08:28:41+00:00" + "time": "2023-07-11T07:02:26+00:00" }, { "name": "php-http/httplug", - "version": "2.3.0", + "version": "2.4.0", "source": { "type": "git", "url": "https://github.com/php-http/httplug.git", - "reference": "f640739f80dfa1152533976e3c112477f69274eb" + "reference": "625ad742c360c8ac580fcc647a1541d29e257f67" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/httplug/zipball/f640739f80dfa1152533976e3c112477f69274eb", - "reference": "f640739f80dfa1152533976e3c112477f69274eb", + "url": "https://api.github.com/repos/php-http/httplug/zipball/625ad742c360c8ac580fcc647a1541d29e257f67", + "reference": "625ad742c360c8ac580fcc647a1541d29e257f67", "shasum": "" }, "require": { "php": "^7.1 || ^8.0", "php-http/promise": "^1.1", "psr/http-client": "^1.0", - "psr/http-message": "^1.0" + "psr/http-message": "^1.0 || ^2.0" }, "require-dev": { - "friends-of-phpspec/phpspec-code-coverage": "^4.1", - "phpspec/phpspec": "^5.1 || ^6.0" + "friends-of-phpspec/phpspec-code-coverage": "^4.1 || ^5.0 || ^6.0", + "phpspec/phpspec": "^5.1 || ^6.0 || ^7.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.x-dev" - } - }, "autoload": { "psr-4": { "Http\\Client\\": "src/" @@ -3408,29 +4050,28 @@ ], "support": { "issues": "https://github.com/php-http/httplug/issues", - "source": "https://github.com/php-http/httplug/tree/2.3.0" + "source": "https://github.com/php-http/httplug/tree/2.4.0" }, - "time": "2022-02-21T09:52:22+00:00" + "time": "2023-04-14T15:10:03+00:00" }, { "name": "php-http/message", - "version": "1.13.0", + "version": "1.16.0", "source": { "type": "git", "url": "https://github.com/php-http/message.git", - "reference": "7886e647a30a966a1a8d1dad1845b71ca8678361" + "reference": "47a14338bf4ebd67d317bf1144253d7db4ab55fd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/message/zipball/7886e647a30a966a1a8d1dad1845b71ca8678361", - "reference": "7886e647a30a966a1a8d1dad1845b71ca8678361", + "url": "https://api.github.com/repos/php-http/message/zipball/47a14338bf4ebd67d317bf1144253d7db4ab55fd", + "reference": "47a14338bf4ebd67d317bf1144253d7db4ab55fd", "shasum": "" }, "require": { "clue/stream-filter": "^1.5", - "php": "^7.1 || ^8.0", - "php-http/message-factory": "^1.0.2", - "psr/http-message": "^1.0" + "php": "^7.2 || ^8.0", + "psr/http-message": "^1.1 || ^2.0" }, "provide": { "php-http/message-factory-implementation": "1.0" @@ -3438,8 +4079,9 @@ "require-dev": { "ergebnis/composer-normalize": "^2.6", "ext-zlib": "*", - "guzzlehttp/psr7": "^1.0", - "laminas/laminas-diactoros": "^2.0", + "guzzlehttp/psr7": "^1.0 || ^2.0", + "laminas/laminas-diactoros": "^2.0 || ^3.0", + "php-http/message-factory": "^1.0.2", "phpspec/phpspec": "^5.1 || ^6.3 || ^7.1", "slim/slim": "^3.0" }, @@ -3450,11 +4092,6 @@ "slim/slim": "Used with Slim Framework PSR-7 implementation" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.10-dev" - } - }, "autoload": { "files": [ "src/filters.php" @@ -3482,32 +4119,32 @@ ], "support": { "issues": "https://github.com/php-http/message/issues", - "source": "https://github.com/php-http/message/tree/1.13.0" + "source": "https://github.com/php-http/message/tree/1.16.0" }, - "time": "2022-02-11T13:41:14+00:00" + "time": "2023-05-17T06:43:38+00:00" }, { "name": "php-http/message-factory", - "version": "v1.0.2", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/php-http/message-factory.git", - "reference": "a478cb11f66a6ac48d8954216cfed9aa06a501a1" + "reference": "4d8778e1c7d405cbb471574821c1ff5b68cc8f57" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/message-factory/zipball/a478cb11f66a6ac48d8954216cfed9aa06a501a1", - "reference": "a478cb11f66a6ac48d8954216cfed9aa06a501a1", + "url": "https://api.github.com/repos/php-http/message-factory/zipball/4d8778e1c7d405cbb471574821c1ff5b68cc8f57", + "reference": "4d8778e1c7d405cbb471574821c1ff5b68cc8f57", "shasum": "" }, "require": { "php": ">=5.4", - "psr/http-message": "^1.0" + "psr/http-message": "^1.0 || ^2.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "1.x-dev" } }, "autoload": { @@ -3536,9 +4173,10 @@ ], "support": { "issues": "https://github.com/php-http/message-factory/issues", - "source": "https://github.com/php-http/message-factory/tree/master" + "source": "https://github.com/php-http/message-factory/tree/1.1.0" }, - "time": "2015-12-19T14:08:53+00:00" + "abandoned": "psr/http-factory", + "time": "2023-04-14T14:16:17+00:00" }, { "name": "php-http/promise", @@ -3843,6 +4481,55 @@ ], "time": "2023-03-15T21:02:42+00:00" }, + { + "name": "psr/cache", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/cache.git", + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8", + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for caching libraries", + "keywords": [ + "cache", + "psr", + "psr-6" + ], + "support": { + "source": "https://github.com/php-fig/cache/tree/master" + }, + "time": "2016-08-06T20:24:11+00:00" + }, { "name": "psr/container", "version": "1.1.1", @@ -3943,21 +4630,21 @@ }, { "name": "psr/http-client", - "version": "1.0.1", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/php-fig/http-client.git", - "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621" + "reference": "0955afe48220520692d2d09f7ab7e0f93ffd6a31" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-client/zipball/2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", - "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/0955afe48220520692d2d09f7ab7e0f93ffd6a31", + "reference": "0955afe48220520692d2d09f7ab7e0f93ffd6a31", "shasum": "" }, "require": { "php": "^7.0 || ^8.0", - "psr/http-message": "^1.0" + "psr/http-message": "^1.0 || ^2.0" }, "type": "library", "extra": { @@ -3977,7 +4664,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interface for HTTP clients", @@ -3989,27 +4676,27 @@ "psr-18" ], "support": { - "source": "https://github.com/php-fig/http-client/tree/master" + "source": "https://github.com/php-fig/http-client/tree/1.0.2" }, - "time": "2020-06-29T06:28:15+00:00" + "time": "2023-04-10T20:12:12+00:00" }, { "name": "psr/http-factory", - "version": "1.0.1", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/php-fig/http-factory.git", - "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be" + "reference": "e616d01114759c4c489f93b099585439f795fe35" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-factory/zipball/12ac7fcd07e5b077433f5f2bee95b3a771bf61be", - "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/e616d01114759c4c489f93b099585439f795fe35", + "reference": "e616d01114759c4c489f93b099585439f795fe35", "shasum": "" }, "require": { "php": ">=7.0.0", - "psr/http-message": "^1.0" + "psr/http-message": "^1.0 || ^2.0" }, "type": "library", "extra": { @@ -4029,7 +4716,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interfaces for PSR-7 HTTP message factories", @@ -4044,31 +4731,31 @@ "response" ], "support": { - "source": "https://github.com/php-fig/http-factory/tree/master" + "source": "https://github.com/php-fig/http-factory/tree/1.0.2" }, - "time": "2019-04-30T12:38:16+00:00" + "time": "2023-04-10T20:10:41+00:00" }, { "name": "psr/http-message", - "version": "1.0.1", + "version": "1.1", "source": { "type": "git", "url": "https://github.com/php-fig/http-message.git", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/cb6ce4845ce34a8ad9e68117c10ee90a29919eba", + "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": "^7.2 || ^8.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.1.x-dev" } }, "autoload": { @@ -4097,9 +4784,9 @@ "response" ], "support": { - "source": "https://github.com/php-fig/http-message/tree/master" + "source": "https://github.com/php-fig/http-message/tree/1.1" }, - "time": "2016-08-06T14:39:51+00:00" + "time": "2023-04-04T09:50:52+00:00" }, { "name": "psr/log", @@ -4204,16 +4891,16 @@ }, { "name": "psy/psysh", - "version": "v0.11.14", + "version": "v0.11.18", "source": { "type": "git", "url": "https://github.com/bobthecow/psysh.git", - "reference": "8c2e264def7a8263a68ef6f0b55ce90b77d41e17" + "reference": "4f00ee9e236fa6a48f4560d1300b9c961a70a7ec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bobthecow/psysh/zipball/8c2e264def7a8263a68ef6f0b55ce90b77d41e17", - "reference": "8c2e264def7a8263a68ef6f0b55ce90b77d41e17", + "url": "https://api.github.com/repos/bobthecow/psysh/zipball/4f00ee9e236fa6a48f4560d1300b9c961a70a7ec", + "reference": "4f00ee9e236fa6a48f4560d1300b9c961a70a7ec", "shasum": "" }, "require": { @@ -4274,9 +4961,9 @@ ], "support": { "issues": "https://github.com/bobthecow/psysh/issues", - "source": "https://github.com/bobthecow/psysh/tree/v0.11.14" + "source": "https://github.com/bobthecow/psysh/tree/v0.11.18" }, - "time": "2023-03-28T03:41:01+00:00" + "time": "2023-05-23T02:31:11+00:00" }, { "name": "ralouphie/getallheaders", @@ -4500,22 +5187,84 @@ "time": "2021-09-25T23:10:38+00:00" }, { - "name": "sentry/sdk", - "version": "3.3.0", + "name": "rize/uri-template", + "version": "0.3.5", "source": { "type": "git", - "url": "https://github.com/getsentry/sentry-php-sdk.git", - "reference": "d0678fc7274dbb03046ed05cb24eb92945bedf8e" + "url": "https://github.com/rize/UriTemplate.git", + "reference": "5ed4ba8ea34af84485dea815d4b6b620794d1168" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/getsentry/sentry-php-sdk/zipball/d0678fc7274dbb03046ed05cb24eb92945bedf8e", - "reference": "d0678fc7274dbb03046ed05cb24eb92945bedf8e", + "url": "https://api.github.com/repos/rize/UriTemplate/zipball/5ed4ba8ea34af84485dea815d4b6b620794d1168", + "reference": "5ed4ba8ea34af84485dea815d4b6b620794d1168", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.8.36" + }, + "type": "library", + "autoload": { + "psr-4": { + "Rize\\": "src/Rize" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marut K", + "homepage": "http://twitter.com/rezigned" + } + ], + "description": "PHP URI Template (RFC 6570) supports both expansion & extraction", + "keywords": [ + "RFC 6570", + "template", + "uri" + ], + "support": { + "issues": "https://github.com/rize/UriTemplate/issues", + "source": "https://github.com/rize/UriTemplate/tree/0.3.5" + }, + "funding": [ + { + "url": "https://www.paypal.me/rezigned", + "type": "custom" + }, + { + "url": "https://github.com/rezigned", + "type": "github" + }, + { + "url": "https://opencollective.com/rize-uri-template", + "type": "open_collective" + } + ], + "time": "2022-10-12T17:22:51+00:00" + }, + { + "name": "sentry/sdk", + "version": "3.5.0", + "source": { + "type": "git", + "url": "https://github.com/getsentry/sentry-php-sdk.git", + "reference": "cd91b752f07c4bab9fb3b173f81af68a78a78d6d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/getsentry/sentry-php-sdk/zipball/cd91b752f07c4bab9fb3b173f81af68a78a78d6d", + "reference": "cd91b752f07c4bab9fb3b173f81af68a78a78d6d", "shasum": "" }, "require": { "http-interop/http-factory-guzzle": "^1.0", - "sentry/sentry": "^3.9", + "sentry/sentry": "^3.19", "symfony/http-client": "^4.3|^5.0|^6.0" }, "type": "metapackage", @@ -4542,7 +5291,7 @@ ], "support": { "issues": "https://github.com/getsentry/sentry-php-sdk/issues", - "source": "https://github.com/getsentry/sentry-php-sdk/tree/3.3.0" + "source": "https://github.com/getsentry/sentry-php-sdk/tree/3.5.0" }, "funding": [ { @@ -4554,26 +5303,26 @@ "type": "custom" } ], - "time": "2022-10-11T09:05:00+00:00" + "time": "2023-06-12T17:50:36+00:00" }, { "name": "sentry/sentry", - "version": "3.17.0", + "version": "3.20.1", "source": { "type": "git", "url": "https://github.com/getsentry/sentry-php.git", - "reference": "95d2e932383cf684f77acff0d2a5aef5ad2f1933" + "reference": "644ad9768c18139a80ac510090fad000d9ffd8a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/getsentry/sentry-php/zipball/95d2e932383cf684f77acff0d2a5aef5ad2f1933", - "reference": "95d2e932383cf684f77acff0d2a5aef5ad2f1933", + "url": "https://api.github.com/repos/getsentry/sentry-php/zipball/644ad9768c18139a80ac510090fad000d9ffd8a4", + "reference": "644ad9768c18139a80ac510090fad000d9ffd8a4", "shasum": "" }, "require": { "ext-json": "*", "ext-mbstring": "*", - "guzzlehttp/promises": "^1.4", + "guzzlehttp/promises": "^1.5.3|^2.0", "jean85/pretty-package-versions": "^1.5|^2.0.4", "php": "^7.2|^8.0", "php-http/async-client-implementation": "^1.0", @@ -4581,6 +5330,7 @@ "php-http/discovery": "^1.15", "php-http/httplug": "^1.1|^2.0", "php-http/message": "^1.5", + "php-http/message-factory": "^1.1", "psr/http-factory": "^1.0", "psr/http-factory-implementation": "^1.0", "psr/log": "^1.0|^2.0|^3.0", @@ -4646,7 +5396,7 @@ ], "support": { "issues": "https://github.com/getsentry/sentry-php/issues", - "source": "https://github.com/getsentry/sentry-php/tree/3.17.0" + "source": "https://github.com/getsentry/sentry-php/tree/3.20.1" }, "funding": [ { @@ -4658,33 +5408,30 @@ "type": "custom" } ], - "time": "2023-03-26T21:54:06+00:00" + "time": "2023-06-26T11:01:40+00:00" }, { "name": "sentry/sentry-laravel", - "version": "3.3.2", + "version": "3.6.1", "source": { "type": "git", "url": "https://github.com/getsentry/sentry-laravel.git", - "reference": "c502e8b9005990d03f5ec5cc852e98a27c26056d" + "reference": "eb94a52b88794d0c108dc46ca1a680531c3a8bad" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/getsentry/sentry-laravel/zipball/c502e8b9005990d03f5ec5cc852e98a27c26056d", - "reference": "c502e8b9005990d03f5ec5cc852e98a27c26056d", + "url": "https://api.github.com/repos/getsentry/sentry-laravel/zipball/eb94a52b88794d0c108dc46ca1a680531c3a8bad", + "reference": "eb94a52b88794d0c108dc46ca1a680531c3a8bad", "shasum": "" }, "require": { "illuminate/support": "^6.0 | ^7.0 | ^8.0 | ^9.0 | ^10.0", "nyholm/psr7": "^1.0", "php": "^7.2 | ^8.0", - "sentry/sdk": "^3.3", - "sentry/sentry": "^3.16", + "sentry/sdk": "^3.4", + "sentry/sentry": "^3.20", "symfony/psr-http-message-bridge": "^1.0 | ^2.0" }, - "conflict": { - "laravel/lumen-framework": "*" - }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.11", "laravel/framework": "^6.0 | ^7.0 | ^8.0 | ^9.0 | ^10.0", @@ -4739,7 +5486,7 @@ ], "support": { "issues": "https://github.com/getsentry/sentry-laravel/issues", - "source": "https://github.com/getsentry/sentry-laravel/tree/3.3.2" + "source": "https://github.com/getsentry/sentry-laravel/tree/3.6.1" }, "funding": [ { @@ -4751,7 +5498,7 @@ "type": "custom" } ], - "time": "2023-03-22T10:51:03+00:00" + "time": "2023-07-04T10:30:42+00:00" }, { "name": "spatie/laravel-mix-preload", @@ -4899,16 +5646,16 @@ }, { "name": "symfony/console", - "version": "v5.4.22", + "version": "v5.4.24", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "3cd51fd2e6c461ca678f84d419461281bd87a0a8" + "reference": "560fc3ed7a43e6d30ea94a07d77f9a60b8ed0fb8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/3cd51fd2e6c461ca678f84d419461281bd87a0a8", - "reference": "3cd51fd2e6c461ca678f84d419461281bd87a0a8", + "url": "https://api.github.com/repos/symfony/console/zipball/560fc3ed7a43e6d30ea94a07d77f9a60b8ed0fb8", + "reference": "560fc3ed7a43e6d30ea94a07d77f9a60b8ed0fb8", "shasum": "" }, "require": { @@ -4978,7 +5725,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.22" + "source": "https://github.com/symfony/console/tree/v5.4.24" }, "funding": [ { @@ -4994,7 +5741,7 @@ "type": "tidelift" } ], - "time": "2023-03-25T09:27:28+00:00" + "time": "2023-05-26T05:13:16+00:00" }, { "name": "symfony/css-selector", @@ -5131,16 +5878,16 @@ }, { "name": "symfony/error-handler", - "version": "v5.4.21", + "version": "v5.4.24", "source": { "type": "git", "url": "https://github.com/symfony/error-handler.git", - "reference": "56a94aa8cb5a5fbc411551d8d014a296b5456549" + "reference": "c1b9be3b8a6f60f720bec28c4ffb6fb5b00a8946" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/error-handler/zipball/56a94aa8cb5a5fbc411551d8d014a296b5456549", - "reference": "56a94aa8cb5a5fbc411551d8d014a296b5456549", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/c1b9be3b8a6f60f720bec28c4ffb6fb5b00a8946", + "reference": "c1b9be3b8a6f60f720bec28c4ffb6fb5b00a8946", "shasum": "" }, "require": { @@ -5182,7 +5929,7 @@ "description": "Provides tools to manage errors and ease debugging PHP code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/error-handler/tree/v5.4.21" + "source": "https://github.com/symfony/error-handler/tree/v5.4.24" }, "funding": [ { @@ -5198,7 +5945,7 @@ "type": "tidelift" } ], - "time": "2023-02-14T08:03:56+00:00" + "time": "2023-05-02T16:13:31+00:00" }, { "name": "symfony/event-dispatcher", @@ -5429,16 +6176,16 @@ }, { "name": "symfony/http-client", - "version": "v5.4.22", + "version": "v5.4.25", "source": { "type": "git", "url": "https://github.com/symfony/http-client.git", - "reference": "4cd1b7e7ee846c8b22cb47cbc435344af9b2a8bf" + "reference": "ccbb572627466f03a3d7aa1b23483787f5969afc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client/zipball/4cd1b7e7ee846c8b22cb47cbc435344af9b2a8bf", - "reference": "4cd1b7e7ee846c8b22cb47cbc435344af9b2a8bf", + "url": "https://api.github.com/repos/symfony/http-client/zipball/ccbb572627466f03a3d7aa1b23483787f5969afc", + "reference": "ccbb572627466f03a3d7aa1b23483787f5969afc", "shasum": "" }, "require": { @@ -5464,6 +6211,7 @@ "guzzlehttp/promises": "^1.4", "nyholm/psr7": "^1.0", "php-http/httplug": "^1.0|^2.0", + "php-http/message-factory": "^1.0", "psr/http-client": "^1.0", "symfony/dependency-injection": "^4.4|^5.0|^6.0", "symfony/http-kernel": "^4.4.13|^5.1.5|^6.0", @@ -5499,7 +6247,7 @@ "http" ], "support": { - "source": "https://github.com/symfony/http-client/tree/v5.4.22" + "source": "https://github.com/symfony/http-client/tree/v5.4.25" }, "funding": [ { @@ -5515,7 +6263,7 @@ "type": "tidelift" } ], - "time": "2023-03-24T15:16:26+00:00" + "time": "2023-06-21T14:44:30+00:00" }, { "name": "symfony/http-client-contracts", @@ -5597,16 +6345,16 @@ }, { "name": "symfony/http-foundation", - "version": "v5.4.22", + "version": "v5.4.25", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "05cd1acdd0e3ce8473aaba1d86c188321d85f313" + "reference": "f66be2706075c5f6325d2fe2b743a57fb5d23f6b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/05cd1acdd0e3ce8473aaba1d86c188321d85f313", - "reference": "05cd1acdd0e3ce8473aaba1d86c188321d85f313", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/f66be2706075c5f6325d2fe2b743a57fb5d23f6b", + "reference": "f66be2706075c5f6325d2fe2b743a57fb5d23f6b", "shasum": "" }, "require": { @@ -5653,7 +6401,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v5.4.22" + "source": "https://github.com/symfony/http-foundation/tree/v5.4.25" }, "funding": [ { @@ -5669,20 +6417,20 @@ "type": "tidelift" } ], - "time": "2023-03-28T07:28:17+00:00" + "time": "2023-06-22T08:06:06+00:00" }, { "name": "symfony/http-kernel", - "version": "v5.4.22", + "version": "v5.4.25", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "2d3a8be2c756353627398827c409af6f126c096d" + "reference": "f6c92fe64bbdad7616cb90663c24f6350f3ca464" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/2d3a8be2c756353627398827c409af6f126c096d", - "reference": "2d3a8be2c756353627398827c409af6f126c096d", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/f6c92fe64bbdad7616cb90663c24f6350f3ca464", + "reference": "f6c92fe64bbdad7616cb90663c24f6350f3ca464", "shasum": "" }, "require": { @@ -5765,7 +6513,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v5.4.22" + "source": "https://github.com/symfony/http-kernel/tree/v5.4.25" }, "funding": [ { @@ -5781,20 +6529,20 @@ "type": "tidelift" } ], - "time": "2023-03-31T11:54:37+00:00" + "time": "2023-06-26T05:58:08+00:00" }, { "name": "symfony/mime", - "version": "v5.4.21", + "version": "v5.4.23", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", - "reference": "ef57d9fb9cdd5e6b2ffc567d109865d10b6920cd" + "reference": "ae0a1032a450a3abf305ee44fc55ed423fbf16e3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/ef57d9fb9cdd5e6b2ffc567d109865d10b6920cd", - "reference": "ef57d9fb9cdd5e6b2ffc567d109865d10b6920cd", + "url": "https://api.github.com/repos/symfony/mime/zipball/ae0a1032a450a3abf305ee44fc55ed423fbf16e3", + "reference": "ae0a1032a450a3abf305ee44fc55ed423fbf16e3", "shasum": "" }, "require": { @@ -5849,7 +6597,7 @@ "mime-type" ], "support": { - "source": "https://github.com/symfony/mime/tree/v5.4.21" + "source": "https://github.com/symfony/mime/tree/v5.4.23" }, "funding": [ { @@ -5865,7 +6613,7 @@ "type": "tidelift" } ], - "time": "2023-02-21T19:46:44+00:00" + "time": "2023-04-19T09:49:13+00:00" }, { "name": "symfony/options-resolver", @@ -6755,16 +7503,16 @@ }, { "name": "symfony/process", - "version": "v5.4.22", + "version": "v5.4.24", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "4b850da0cc3a2a9181c1ed407adbca4733dc839b" + "reference": "e3c46cc5689c8782944274bb30702106ecbe3b64" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/4b850da0cc3a2a9181c1ed407adbca4733dc839b", - "reference": "4b850da0cc3a2a9181c1ed407adbca4733dc839b", + "url": "https://api.github.com/repos/symfony/process/zipball/e3c46cc5689c8782944274bb30702106ecbe3b64", + "reference": "e3c46cc5689c8782944274bb30702106ecbe3b64", "shasum": "" }, "require": { @@ -6797,7 +7545,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v5.4.22" + "source": "https://github.com/symfony/process/tree/v5.4.24" }, "funding": [ { @@ -6813,36 +7561,36 @@ "type": "tidelift" } ], - "time": "2023-03-06T21:29:33+00:00" + "time": "2023-05-17T11:26:05+00:00" }, { "name": "symfony/psr-http-message-bridge", - "version": "v2.1.4", + "version": "v2.2.0", "source": { "type": "git", "url": "https://github.com/symfony/psr-http-message-bridge.git", - "reference": "a125b93ef378c492e274f217874906fb9babdebb" + "reference": "28a732c05bbad801304ad5a5c674cf2970508993" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/psr-http-message-bridge/zipball/a125b93ef378c492e274f217874906fb9babdebb", - "reference": "a125b93ef378c492e274f217874906fb9babdebb", + "url": "https://api.github.com/repos/symfony/psr-http-message-bridge/zipball/28a732c05bbad801304ad5a5c674cf2970508993", + "reference": "28a732c05bbad801304ad5a5c674cf2970508993", "shasum": "" }, "require": { - "php": ">=7.1", - "psr/http-message": "^1.0", - "symfony/http-foundation": "^4.4 || ^5.0 || ^6.0" + "php": ">=7.2.5", + "psr/http-message": "^1.0 || ^2.0", + "symfony/http-foundation": "^5.4 || ^6.0" }, "require-dev": { "nyholm/psr7": "^1.1", "psr/log": "^1.1 || ^2 || ^3", - "symfony/browser-kit": "^4.4 || ^5.0 || ^6.0", - "symfony/config": "^4.4 || ^5.0 || ^6.0", - "symfony/event-dispatcher": "^4.4 || ^5.0 || ^6.0", - "symfony/framework-bundle": "^4.4 || ^5.0 || ^6.0", - "symfony/http-kernel": "^4.4 || ^5.0 || ^6.0", - "symfony/phpunit-bridge": "^5.4@dev || ^6.0" + "symfony/browser-kit": "^5.4 || ^6.0", + "symfony/config": "^5.4 || ^6.0", + "symfony/event-dispatcher": "^5.4 || ^6.0", + "symfony/framework-bundle": "^5.4 || ^6.0", + "symfony/http-kernel": "^5.4 || ^6.0", + "symfony/phpunit-bridge": "^6.2" }, "suggest": { "nyholm/psr7": "For a super lightweight PSR-7/17 implementation" @@ -6850,7 +7598,7 @@ "type": "symfony-bridge", "extra": { "branch-alias": { - "dev-main": "2.1-dev" + "dev-main": "2.2-dev" } }, "autoload": { @@ -6885,7 +7633,7 @@ ], "support": { "issues": "https://github.com/symfony/psr-http-message-bridge/issues", - "source": "https://github.com/symfony/psr-http-message-bridge/tree/v2.1.4" + "source": "https://github.com/symfony/psr-http-message-bridge/tree/v2.2.0" }, "funding": [ { @@ -6901,20 +7649,20 @@ "type": "tidelift" } ], - "time": "2022-11-28T22:46:34+00:00" + "time": "2023-04-21T08:40:19+00:00" }, { "name": "symfony/routing", - "version": "v5.4.22", + "version": "v5.4.25", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "c2ac11eb34947999b7c38fb4c835a57306907e6d" + "reference": "56bfc1394f7011303eb2e22724f9b422d3f14649" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/c2ac11eb34947999b7c38fb4c835a57306907e6d", - "reference": "c2ac11eb34947999b7c38fb4c835a57306907e6d", + "url": "https://api.github.com/repos/symfony/routing/zipball/56bfc1394f7011303eb2e22724f9b422d3f14649", + "reference": "56bfc1394f7011303eb2e22724f9b422d3f14649", "shasum": "" }, "require": { @@ -6975,7 +7723,7 @@ "url" ], "support": { - "source": "https://github.com/symfony/routing/tree/v5.4.22" + "source": "https://github.com/symfony/routing/tree/v5.4.25" }, "funding": [ { @@ -6991,7 +7739,7 @@ "type": "tidelift" } ], - "time": "2023-03-14T14:59:20+00:00" + "time": "2023-06-05T14:18:47+00:00" }, { "name": "symfony/service-contracts", @@ -7164,16 +7912,16 @@ }, { "name": "symfony/translation", - "version": "v5.4.22", + "version": "v5.4.24", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "9a401392f01bc385aa42760eff481d213a0cc2ba" + "reference": "de237e59c5833422342be67402d487fbf50334ff" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/9a401392f01bc385aa42760eff481d213a0cc2ba", - "reference": "9a401392f01bc385aa42760eff481d213a0cc2ba", + "url": "https://api.github.com/repos/symfony/translation/zipball/de237e59c5833422342be67402d487fbf50334ff", + "reference": "de237e59c5833422342be67402d487fbf50334ff", "shasum": "" }, "require": { @@ -7241,7 +7989,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v5.4.22" + "source": "https://github.com/symfony/translation/tree/v5.4.24" }, "funding": [ { @@ -7257,7 +8005,7 @@ "type": "tidelift" } ], - "time": "2023-03-27T16:07:23+00:00" + "time": "2023-05-19T12:34:17+00:00" }, { "name": "symfony/translation-contracts", @@ -7339,16 +8087,16 @@ }, { "name": "symfony/var-dumper", - "version": "v5.4.22", + "version": "v5.4.25", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "e2edac9ce47e6df07e38143c7cfa6bdbc1a6dcc4" + "reference": "82269f73c0f0f9859ab9b6900eebacbe54954ede" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/e2edac9ce47e6df07e38143c7cfa6bdbc1a6dcc4", - "reference": "e2edac9ce47e6df07e38143c7cfa6bdbc1a6dcc4", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/82269f73c0f0f9859ab9b6900eebacbe54954ede", + "reference": "82269f73c0f0f9859ab9b6900eebacbe54954ede", "shasum": "" }, "require": { @@ -7357,7 +8105,6 @@ "symfony/polyfill-php80": "^1.16" }, "conflict": { - "phpunit/phpunit": "<5.4.3", "symfony/console": "<4.4" }, "require-dev": { @@ -7408,7 +8155,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v5.4.22" + "source": "https://github.com/symfony/var-dumper/tree/v5.4.25" }, "funding": [ { @@ -7424,7 +8171,7 @@ "type": "tidelift" } ], - "time": "2023-03-25T09:27:28+00:00" + "time": "2023-06-20T20:56:26+00:00" }, { "name": "tijsverkoyen/css-to-inline-styles", @@ -7479,6 +8226,66 @@ }, "time": "2023-01-03T09:29:04+00:00" }, + { + "name": "usmanhalalit/laracsv", + "version": "2.1.0", + "source": { + "type": "git", + "url": "https://github.com/usmanhalalit/laracsv.git", + "reference": "98016abe4c55e7ed3c97a3e0b930cbac58374f57" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/usmanhalalit/laracsv/zipball/98016abe4c55e7ed3c97a3e0b930cbac58374f57", + "reference": "98016abe4c55e7ed3c97a3e0b930cbac58374f57", + "shasum": "" + }, + "require": { + "illuminate/database": ">=5.2", + "league/csv": "^9.0", + "php": ">=7.1" + }, + "require-dev": { + "fzaninotto/faker": "^1.8", + "phpunit/phpunit": "^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Laracsv\\": "src/Laracsv/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Muhammad Usman", + "email": "hi@usman.it", + "role": "Developer" + } + ], + "description": "A Laravel package to easily generate CSV files from Eloquent model.", + "homepage": "https://github.com/usmanhalalit/laracsv", + "keywords": [ + "csv", + "eloquent", + "export", + "laravel" + ], + "support": { + "issues": "https://github.com/usmanhalalit/laracsv/issues", + "source": "https://github.com/usmanhalalit/laracsv/tree/master" + }, + "funding": [ + { + "url": "https://github.com/usmanhalalit", + "type": "github" + } + ], + "time": "2020-06-19T09:31:32+00:00" + }, { "name": "vlucas/phpdotenv", "version": "v5.5.0", @@ -7981,25 +8788,29 @@ }, { "name": "doctrine/deprecations", - "version": "v1.0.0", + "version": "v1.1.1", "source": { "type": "git", "url": "https://github.com/doctrine/deprecations.git", - "reference": "0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de" + "reference": "612a3ee5ab0d5dd97b7cf3874a6efe24325efac3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/deprecations/zipball/0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de", - "reference": "0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/612a3ee5ab0d5dd97b7cf3874a6efe24325efac3", + "reference": "612a3ee5ab0d5dd97b7cf3874a6efe24325efac3", "shasum": "" }, "require": { - "php": "^7.1|^8.0" + "php": "^7.1 || ^8.0" }, "require-dev": { "doctrine/coding-standard": "^9", - "phpunit/phpunit": "^7.5|^8.5|^9.5", - "psr/log": "^1|^2|^3" + "phpstan/phpstan": "1.4.10 || 1.10.15", + "phpstan/phpstan-phpunit": "^1.0", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "psalm/plugin-phpunit": "0.18.4", + "psr/log": "^1 || ^2 || ^3", + "vimeo/psalm": "4.30.0 || 5.12.0" }, "suggest": { "psr/log": "Allows logging deprecations via PSR-3 logger implementation" @@ -8018,9 +8829,9 @@ "homepage": "https://www.doctrine-project.org/", "support": { "issues": "https://github.com/doctrine/deprecations/issues", - "source": "https://github.com/doctrine/deprecations/tree/v1.0.0" + "source": "https://github.com/doctrine/deprecations/tree/v1.1.1" }, - "time": "2022-05-02T15:47:09+00:00" + "time": "2023-06-03T09:27:29+00:00" }, { "name": "doctrine/event-manager", @@ -8396,16 +9207,16 @@ }, { "name": "filp/whoops", - "version": "2.15.1", + "version": "2.15.2", "source": { "type": "git", "url": "https://github.com/filp/whoops.git", - "reference": "e864ac957acd66e1565f25efda61e37791a5db0b" + "reference": "aac9304c5ed61bf7b1b7a6064bf9806ab842ce73" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filp/whoops/zipball/e864ac957acd66e1565f25efda61e37791a5db0b", - "reference": "e864ac957acd66e1565f25efda61e37791a5db0b", + "url": "https://api.github.com/repos/filp/whoops/zipball/aac9304c5ed61bf7b1b7a6064bf9806ab842ce73", + "reference": "aac9304c5ed61bf7b1b7a6064bf9806ab842ce73", "shasum": "" }, "require": { @@ -8455,7 +9266,7 @@ ], "support": { "issues": "https://github.com/filp/whoops/issues", - "source": "https://github.com/filp/whoops/tree/2.15.1" + "source": "https://github.com/filp/whoops/tree/2.15.2" }, "funding": [ { @@ -8463,7 +9274,7 @@ "type": "github" } ], - "time": "2023-03-06T18:09:13+00:00" + "time": "2023-04-12T12:00:00+00:00" }, { "name": "hamcrest/hamcrest-php", @@ -8982,22 +9793,24 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "1.16.1", + "version": "1.22.1", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "e27e92d939e2e3636f0a1f0afaba59692c0bf571" + "reference": "65c39594fbd8c67abfc68bb323f86447bab79cc0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/e27e92d939e2e3636f0a1f0afaba59692c0bf571", - "reference": "e27e92d939e2e3636f0a1f0afaba59692c0bf571", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/65c39594fbd8c67abfc68bb323f86447bab79cc0", + "reference": "65c39594fbd8c67abfc68bb323f86447bab79cc0", "shasum": "" }, "require": { "php": "^7.2 || ^8.0" }, "require-dev": { + "doctrine/annotations": "^2.0", + "nikic/php-parser": "^4.15", "php-parallel-lint/php-parallel-lint": "^1.2", "phpstan/extension-installer": "^1.0", "phpstan/phpstan": "^1.5", @@ -9021,9 +9834,9 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/1.16.1" + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.22.1" }, - "time": "2023-02-07T18:11:17+00:00" + "time": "2023-06-29T20:46:06+00:00" }, { "name": "phpunit/php-code-coverage", @@ -9345,16 +10158,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.6.6", + "version": "9.6.10", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "b65d59a059d3004a040c16a82e07bbdf6cfdd115" + "reference": "a6d351645c3fe5a30f5e86be6577d946af65a328" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b65d59a059d3004a040c16a82e07bbdf6cfdd115", - "reference": "b65d59a059d3004a040c16a82e07bbdf6cfdd115", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a6d351645c3fe5a30f5e86be6577d946af65a328", + "reference": "a6d351645c3fe5a30f5e86be6577d946af65a328", "shasum": "" }, "require": { @@ -9428,7 +10241,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.6" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.10" }, "funding": [ { @@ -9444,56 +10257,7 @@ "type": "tidelift" } ], - "time": "2023-03-27T11:43:46+00:00" - }, - { - "name": "psr/cache", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/php-fig/cache.git", - "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8", - "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Cache\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for caching libraries", - "keywords": [ - "cache", - "psr", - "psr-6" - ], - "support": { - "source": "https://github.com/php-fig/cache/tree/master" - }, - "time": "2016-08-06T20:24:11+00:00" + "time": "2023-07-10T04:04:23+00:00" }, { "name": "sebastian/cli-parser", @@ -9795,16 +10559,16 @@ }, { "name": "sebastian/diff", - "version": "4.0.4", + "version": "4.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d" + "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d", - "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/74be17022044ebaaecfdf0c5cd504fc9cd5a7131", + "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131", "shasum": "" }, "require": { @@ -9849,7 +10613,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/4.0.4" + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.5" }, "funding": [ { @@ -9857,7 +10621,7 @@ "type": "github" } ], - "time": "2020-10-26T13:10:38+00:00" + "time": "2023-05-07T05:35:17+00:00" }, { "name": "sebastian/environment", @@ -10461,32 +11225,32 @@ }, { "name": "slevomat/coding-standard", - "version": "8.9.1", + "version": "8.13.1", "source": { "type": "git", "url": "https://github.com/slevomat/coding-standard.git", - "reference": "3d4fe0c803ae15829ef72d90d3d4eee3dd9f79b2" + "reference": "a13c15e20f2d307a1ca8dec5313ec462a4466470" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/3d4fe0c803ae15829ef72d90d3d4eee3dd9f79b2", - "reference": "3d4fe0c803ae15829ef72d90d3d4eee3dd9f79b2", + "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/a13c15e20f2d307a1ca8dec5313ec462a4466470", + "reference": "a13c15e20f2d307a1ca8dec5313ec462a4466470", "shasum": "" }, "require": { "dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7 || ^1.0", "php": "^7.2 || ^8.0", - "phpstan/phpdoc-parser": ">=1.16.0 <1.17.0", + "phpstan/phpdoc-parser": "^1.22.0", "squizlabs/php_codesniffer": "^3.7.1" }, "require-dev": { "phing/phing": "2.17.4", "php-parallel-lint/php-parallel-lint": "1.3.2", - "phpstan/phpstan": "1.4.10|1.10.8", + "phpstan/phpstan": "1.10.21", "phpstan/phpstan-deprecation-rules": "1.1.3", - "phpstan/phpstan-phpunit": "1.0.0|1.3.10", - "phpstan/phpstan-strict-rules": "1.5.0", - "phpunit/phpunit": "7.5.20|8.5.21|9.6.5" + "phpstan/phpstan-phpunit": "1.3.13", + "phpstan/phpstan-strict-rules": "1.5.1", + "phpunit/phpunit": "7.5.20|8.5.21|9.6.8|10.2.2" }, "type": "phpcodesniffer-standard", "extra": { @@ -10510,7 +11274,7 @@ ], "support": { "issues": "https://github.com/slevomat/coding-standard/issues", - "source": "https://github.com/slevomat/coding-standard/tree/8.9.1" + "source": "https://github.com/slevomat/coding-standard/tree/8.13.1" }, "funding": [ { @@ -10522,7 +11286,7 @@ "type": "tidelift" } ], - "time": "2023-03-27T11:00:16+00:00" + "time": "2023-06-25T12:52:34+00:00" }, { "name": "squizlabs/php_codesniffer", diff --git a/config/app.php b/config/app.php index 8bd5c75..1316f9a 100644 --- a/config/app.php +++ b/config/app.php @@ -2,6 +2,8 @@ return [ + 'BRAND' => env('BRAND', 'LDC'), + /* |-------------------------------------------------------------------------- | Application Name diff --git a/config/auth.php b/config/auth.php index 7bd569a..7540dba 100644 --- a/config/auth.php +++ b/config/auth.php @@ -13,6 +13,8 @@ return [ | */ + 'API_TOKEN' => env('API_TOKEN'), + 'defaults' => [ 'guard' => 'frontend', 'passwords' => 'users', diff --git a/database/factories/DirectoryFactory.php b/database/factories/DirectoryFactory.php index 3e136f9..88d7a88 100644 --- a/database/factories/DirectoryFactory.php +++ b/database/factories/DirectoryFactory.php @@ -33,6 +33,7 @@ class DirectoryFactory extends Factory ], 'directory_id' => null, 'needAuthorization' => $this->faker->boolean(50), + 'is_system' => 0, ]; } } diff --git a/database/factories/TagFactory.php b/database/factories/TagFactory.php new file mode 100644 index 0000000..4c23234 --- /dev/null +++ b/database/factories/TagFactory.php @@ -0,0 +1,34 @@ + + */ +final class TagFactory extends Factory +{ + /** + * The name of the factory's corresponding model. + * + * @var string + */ + protected $model = Tag::class; + + /** + * Define the model's default state. + * + * @return array + */ + public function definition() + { + $name = $this->faker->unique()->word; + return [ + 'name' => $name, + 'slug' => Str::slug($name), + ]; + } +} diff --git a/database/migrations/2023_03_14_152416_create_failed_jobs_table.php b/database/migrations/2023_03_14_152416_create_failed_jobs_table.php index 6aa6d74..e39723c 100644 --- a/database/migrations/2023_03_14_152416_create_failed_jobs_table.php +++ b/database/migrations/2023_03_14_152416_create_failed_jobs_table.php @@ -14,7 +14,7 @@ class CreateFailedJobsTable extends Migration public function up() { Schema::create('failed_jobs', function (Blueprint $table) { - $table->id(); + $table->bigIncrements('id'); $table->string('uuid')->unique(); $table->text('connection'); $table->text('queue'); diff --git a/database/migrations/2023_03_14_171940_update_role_app_users_table.php b/database/migrations/2023_03_14_171940_update_role_app_users_table.php deleted file mode 100644 index 13b4e68..0000000 --- a/database/migrations/2023_03_14_171940_update_role_app_users_table.php +++ /dev/null @@ -1,34 +0,0 @@ -where('role', 'USER')->update(['role' => AppUserRolesEnum::user()->value]); - DB::table('app_users')->where('role', 'TOTAL')->update(['role' => AppUserRolesEnum::total()->value]); - - DB::statement("ALTER TABLE app_users CHANGE COLUMN role role TINYINT NOT NULL"); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - DB::statement("ALTER TABLE app_users CHANGE COLUMN role role VARCHAR(50) NOT NULL"); - - DB::table('app_users')->where('role', strval(AppUserRolesEnum::user()->value))->update(['role' => 'USER']); - DB::table('app_users')->where('role', strval(AppUserRolesEnum::total()->value))->update(['role' => 'TOTAL']); - } -} diff --git a/database/migrations/2023_03_15_093018_update_password_app_users_table.php b/database/migrations/2023_03_15_093018_update_password_app_users_table.php deleted file mode 100644 index 25d23ad..0000000 --- a/database/migrations/2023_03_15_093018_update_password_app_users_table.php +++ /dev/null @@ -1,27 +0,0 @@ -renameColumn('surname', 'lastname'); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('app_users', function (Blueprint $table) { - $table->renameColumn('lastname', 'surname'); - }); - } -} diff --git a/database/migrations/2023_03_20_105223_update_directory_table.php b/database/migrations/2023_03_20_105223_update_directory_table.php new file mode 100644 index 0000000..8add158 --- /dev/null +++ b/database/migrations/2023_03_20_105223_update_directory_table.php @@ -0,0 +1,55 @@ +UPDATED_AT + //phpcs:ignore Generic.Files.LineLength.TooLong + DB::statement('ALTER TABLE `directories` CHANGE `updated_at` `updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'); + + Schema::table('directories', function (Blueprint $table) { + $table->renameColumn('parent', 'directory_id'); + $table->json('name')->change(); + $table->boolean('is_system')->after('needAuthorization')->comment('Le dossier est-il administrable ?'); + $table->dateTime('created_at')->default('CURRENT_TIMESTAMP')->nullable()->change(); + }); + + Directory::each(function (Directory $model) { + if ($model->name['fr'] === "Le Salon") { + $model->is_system = 1; + $model->saveOrFail(); + } + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + // * APP_USER->CREATED_AT + //phpcs:ignore Generic.Files.LineLength.TooLong + DB::statement('ALTER TABLE `directories` CHANGE `created_at` `created_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'); + + Schema::table('directories', function (Blueprint $table) { + $table->renameColumn('directory_id', 'parent'); + $table->string('name')->change(); + $table->dropColumn('is_system'); + $table->dateTime('updated_at')->default('0000-00-00 00:00:00')->nullable()->change(); + }); + } +} diff --git a/database/migrations/2023_03_31_110635_add_pivot_directory_table.php b/database/migrations/2023_03_20_110635_add_pivot_directory_table.php similarity index 66% rename from database/migrations/2023_03_31_110635_add_pivot_directory_table.php rename to database/migrations/2023_03_20_110635_add_pivot_directory_table.php index 4d9f868..c3809f2 100644 --- a/database/migrations/2023_03_31_110635_add_pivot_directory_table.php +++ b/database/migrations/2023_03_20_110635_add_pivot_directory_table.php @@ -13,10 +13,10 @@ class AddPivotDirectoryTable extends Migration */ public function up() { - Schema::create('taggables', function (Blueprint $table) { + Schema::create('directorables', function (Blueprint $table) { $table->foreignId('directory_id')->references('id')->on('directories'); - $table->bigInteger('taggable_id')->comment('Id du model associé'); - $table->string('taggable_type', 60)->comment('Type du model associé'); + $table->bigInteger('directorable_id')->comment('Id du model associé'); + $table->string('directorable_type', 60)->comment('Type du model associé'); }); } @@ -27,6 +27,6 @@ class AddPivotDirectoryTable extends Migration */ public function down() { - Schema::dropIfExists('taggables'); + Schema::dropIfExists('directorables'); } } diff --git a/database/migrations/2023_03_24_171035_update_app_users_table.php b/database/migrations/2023_03_24_171035_update_app_users_table.php new file mode 100644 index 0000000..213f0f7 --- /dev/null +++ b/database/migrations/2023_03_24_171035_update_app_users_table.php @@ -0,0 +1,86 @@ +UPDATED_AT + //phpcs:ignore Generic.Files.LineLength.TooLong + DB::statement('ALTER TABLE `app_users` CHANGE `updated_at` `updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'); + + // * APP_USER->ROLE + DB::table('app_users')->where('role', 'USER')->update(['role' => AppUserRolesEnum::user()->value]); + DB::table('app_users')->where('role', 'TOTAL')->update(['role' => AppUserRolesEnum::total()->value]); + DB::statement("ALTER TABLE app_users CHANGE COLUMN role role TINYINT NOT NULL"); + + // * APP_USER->PASSWORD + DB::statement("ALTER TABLE app_users CHANGE COLUMN password password VARCHAR(255) NOT NULL"); + + $appUsersOld = AppUser::get(); + + // * OTHERS + Schema::table('app_users', function (Blueprint $table) { + $table->dropUnique('email'); + $table->unique(['email']); + $table->renameColumn('surname', 'lastname'); + $table->renameColumn('activated', 'status'); + $table->integer('order')->after('role')->comment('Ordonnance des utilisateurs de l\'applications.'); + $table->dropColumn('authorizedFolders'); + $table->dateTime('created_at')->default('CURRENT_TIMESTAMP')->nullable()->change(); + }); + + AppUser::each(function (AppUser $appUserModel, int $key) use ($appUsersOld) { + foreach (json_decode($appUsersOld[$key]->authorizedFolders) as $directory) { + Directory::each(function (Directory $directoryModel) use ($appUserModel, $directory) { + if ($directoryModel->id == $directory->id) { + $appUserModel->directories()->save($directoryModel); + } + }); + } + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + // * APP_USER->ROLE + DB::statement("ALTER TABLE app_users CHANGE COLUMN role role VARCHAR(50) NOT NULL"); + DB::table('app_users')->where('role', strval(AppUserRolesEnum::user()->value))->update(['role' => 'USER']); + DB::table('app_users')->where('role', strval(AppUserRolesEnum::total()->value))->update(['role' => 'TOTAL']); + + // * APP_USER->CREATED_AT + //phpcs:ignore Generic.Files.LineLength.TooLong + DB::statement('ALTER TABLE `app_users` CHANGE `created_at` `created_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'); + + // * APP_USER->PASSWORD + DB::statement("ALTER TABLE app_users CHANGE COLUMN password password BLOB NOT NULL"); + + // * OTHERS + Schema::table('app_users', function (Blueprint $table) { + $table->dropUnique(['email']); + $table->unique('email'); + $table->renameColumn('lastname', 'surname'); + $table->renameColumn('status', 'activated'); + $table->dropColumn('order'); + $table->text('authorizedFolders')->nullable(); + $table->dateTime('updated_at')->default('0000-00-00 00:00:00')->nullable()->change(); + }); + } +} diff --git a/database/migrations/2023_03_27_112237_update_users_table.php b/database/migrations/2023_03_27_112237_update_users_table.php index 6303d50..016f71a 100644 --- a/database/migrations/2023_03_27_112237_update_users_table.php +++ b/database/migrations/2023_03_27_112237_update_users_table.php @@ -1,7 +1,9 @@ renameColumn('name', 'firstname'); - $table->string('lastname')->after('name'); + $table->string('lastname')->nullable()->after('name'); + $table->dateTime('created_at')->default('CURRENT_TIMESTAMP')->nullable()->change(); }); + + $usersNew = User::get(); + foreach ($usersNew as $key => $userNew) { + $userName = explode(" ", $usersOld[$key]->name); + $userNew->firstname = $userName[0]; + $userNew->lastname = $userName[1] ?? null; + $userNew->saveOrFail(); + } } /** @@ -26,9 +41,22 @@ class UpdateUsersTable extends Migration */ public function down() { + // * APP_USER->CREATED_AT + //phpcs:ignore Generic.Files.LineLength.TooLong + DB::statement('ALTER TABLE `users` CHANGE `created_at` `created_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'); + + $usersOld = User::get(); + Schema::table('users', function (Blueprint $table) { $table->renameColumn('firstname', 'name'); $table->dropColumn('lastname'); + $table->dateTime('updated_at')->default('0000-00-00 00:00:00')->nullable()->change(); }); + + $usersNew = User::get(); + foreach ($usersNew as $key => $userNew) { + $userNew->name = $usersOld[$key]->firstname . " " . $userNew[$key]->lastname; + $userNew->saveOrFail(); + } } } diff --git a/database/migrations/2023_03_29_125343_update_app_users_table.php b/database/migrations/2023_03_29_125343_update_app_users_table.php deleted file mode 100644 index 62d015c..0000000 --- a/database/migrations/2023_03_29_125343_update_app_users_table.php +++ /dev/null @@ -1,34 +0,0 @@ -integer('order')->after('role')->comment('Ordonnance des utilisateurs de l\'applications.'); - $table->dropColumn('authorizedFolders'); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('app_users', function (Blueprint $table) { - $table->dropColumn('order'); - $table->text('authorizedFolders')->nullable(); - }); - } -} diff --git a/database/migrations/2023_03_31_105223_update_directory_table.php b/database/migrations/2023_03_31_105223_update_directory_table.php deleted file mode 100644 index ea4da77..0000000 --- a/database/migrations/2023_03_31_105223_update_directory_table.php +++ /dev/null @@ -1,40 +0,0 @@ -dropForeign('directories_parent_foreign'); - $table->dropColumn('parent'); - $table->unsignedBigInteger('directory_id')->index()->nullable()->after('id'); - $table->foreign(['directory_id'])->references(['id'])->on('directories'); - $table->json('name')->change(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('directories', function (Blueprint $table) { - $table->dropForeign('directories_directory_id_foreign'); - $table->dropColumn('directory_id'); - $table->unsignedBigInteger('parent')->nullable()->index(); - $table->foreign(['parent'])->references('id')->on('directories'); - $table->string('name')->change(); - }); - } -} diff --git a/database/migrations/2023_04_05_093932_update_document_table.php b/database/migrations/2023_04_05_093932_update_document_table.php index 6b34f37..e658f80 100644 --- a/database/migrations/2023_04_05_093932_update_document_table.php +++ b/database/migrations/2023_04_05_093932_update_document_table.php @@ -1,11 +1,26 @@ documentsOld = Document::get(); + $this->documentsNew = Document::get(); + + // * APP_USER->UPDATED_AT + //phpcs:ignore Generic.Files.LineLength.TooLong + DB::statement('ALTER TABLE `documents` CHANGE `updated_at` `updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'); + + self::updateData(); Schema::table('documents', function (Blueprint $table) { - $table->dropForeign('documents_directory_foreign'); - $table->dropColumn('directory'); - $table->unsignedBigInteger('directory_id')->index()->nullable()->after('id'); - $table->foreign(['directory_id'])->references(['id'])->on('directories'); + $table->bigInteger('parent')->unsigned()->change(); + $table->renameColumn('directory', 'directory_id'); $table->dropColumn('parent'); - $table->unsignedBigInteger('document_id')->index()->nullable()->after('directory_id'); + $table->unsignedBigInteger('document_id')->index()->nullable()->after('directory'); $table->foreign(['document_id'])->references(['id'])->on('documents')->constrained(); $table->integer('order')->after('published')->comment('Ordonnance des documents.'); $table->string('type', 255)->change(); - $table->dropColumn('published'); + $table->integer('lang')->nullable()->change(); + $table->renameColumn('published', 'status'); + $table->dateTime('created_at')->default('CURRENT_TIMESTAMP')->nullable()->change(); }); + foreach ($this->documentsNew as $key => $documentNew) { + $documentNew->document_id = + ($this->documentsOld[$key]->parent !== null) ? intval($this->documentsOld[$key]->parent) : null; + $documentNew->saveOrFail(); + } } /** @@ -34,18 +62,65 @@ class UpdateDocumentTable extends Migration */ public function down() { + $documentsOld = Document::get(); + + // * APP_USER->CREATED_AT + //phpcs:ignore Generic.Files.LineLength.TooLong + DB::statement('ALTER TABLE `documents` CHANGE `created_at` `created_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'); + Schema::table('documents', function (Blueprint $table) { - $table->dropForeign('documents_directory_id_foreign'); - $table->dropColumn('directory_id'); - $table->unsignedBigInteger('directory')->index(); - $table->foreign(['directory'])->references(['id'])->on('directories'); - $table->dropForeign('documents_document_id_foreign'); - $table->dropColumn('document_id'); - $table->unsignedBigInteger('parent')->index(); - $table->foreign(['parent'])->references(['id'])->on('documents'); + $table->renameColumn('directory_id', 'directory'); + $table->renameColumn('document_id', 'parent'); $table->dropColumn('order'); $table->string('type', 3)->change(); - $table->boolean('published'); + $table->renameColumn('status', 'published'); + $table->dateTime('updated_at')->default('0000-00-00 00:00:00')->nullable()->change(); }); + + $documentsNew = Document::get(); + foreach ($documentsNew as $key => $documentNew) { + switch ($documentNew->lang) { + case LangEnum::fr()->value: + $documentNew->lang = 'fr'; + break; + case LangEnum::en()->value: + $documentNew->lang = 'en'; + break; + case LangEnum::de()->value: + $documentNew->lang = 'de'; + break; + case LangEnum::nl()->value: + $documentNew->lang = 'nl'; + break; + } + $documentNew->parent = strval($documentsOld[$key]->document_id); + $documentNew->saveOrFail(); + } + } + + /** + * Update data migrations. + * + * @return void + */ + public function updateData() + { + foreach ($this->documentsNew as $documentNew) { + switch ($documentNew->lang) { + case "fr": + $documentNew->lang = LangEnum::fr()->value; + break; + case "en": + $documentNew->lang = LangEnum::en()->value; + break; + case "de": + $documentNew->lang = LangEnum::de()->value; + break; + case "nl": + $documentNew->lang = LangEnum::nl()->value; + break; + } + $documentNew->saveOrFail(); + } } } diff --git a/database/migrations/2023_04_18_144609_update_settings_table.php b/database/migrations/2023_04_18_144609_update_settings_table.php new file mode 100644 index 0000000..788f782 --- /dev/null +++ b/database/migrations/2023_04_18_144609_update_settings_table.php @@ -0,0 +1,84 @@ +UPDATED_AT + //phpcs:ignore Generic.Files.LineLength.TooLong + DB::statement('ALTER TABLE `settings` CHANGE `updated_at` `updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'); + + Schema::table('settings', function (Blueprint $table) { + $table->dropUnique('data_key_unique'); + $table->unique(['key']); + $table->text('value')->nullable()->default(null)->change(); + $table->dateTime('created_at')->default('CURRENT_TIMESTAMP')->nullable()->change(); + }); + + $settings = Setting::get(); + foreach ($settings as $key => $setting) { + if ($setting->key === "ShowIsActive") { + $setting->type = 5; + } elseif ($setting->key === "MainColor") { + $setting->type = 6; + } elseif ($setting->key === "Button1" || $setting->key === "Button2" || $setting->key === "Button3") { + $setting->type = 7; + } elseif ( + $setting->key === "FormSelect1" || + $setting->key === "FormSelect2" || + $setting->key === "FormCheck" + ) { + $setting->type = 4; + } + $setting->saveOrFail(); + } + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + // * APP_USER->CREATED_AT + //phpcs:ignore Generic.Files.LineLength.TooLong + DB::statement('ALTER TABLE `settings` CHANGE `created_at` `created_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'); + + Schema::table('settings', function (Blueprint $table) { + $table->dropUnique('settings_key_unique'); + $table->unique('data_key_unique'); + $table->text('value')->change(); + $table->dateTime('updated_at')->default('0000-00-00 00:00:00')->nullable()->change(); + }); + + $settings = Setting::get(); + foreach ($settings as $key => $setting) { + if ($setting->key === "ShowIsActive") { + $setting->type = 2; + } elseif ($setting->key === "MainColor") { + $setting->type = 1; + } elseif ($setting->key === "Button1" || $setting->key === "Button2" || $setting->key === "Button3") { + $setting->type = 2; + } elseif ( + $setting->key === "FormSelect1" || + $setting->key === "FormSelect2" || + $setting->key === "FormCheck" + ) { + $setting->type = 1; + } + $setting->saveOrFail(); + } + } +} diff --git a/database/migrations/2023_04_18_153753_create_tags_table.php b/database/migrations/2023_04_18_153753_create_tags_table.php new file mode 100644 index 0000000..d2d1a99 --- /dev/null +++ b/database/migrations/2023_04_18_153753_create_tags_table.php @@ -0,0 +1,34 @@ +id(); + $table->string('slug')->unique()->comment('Slug du nom de l\'étiquette.'); + $table->string('name')->comment('Nom du tag qui sera unique.'); + $table->integer('order')->comment('L\'ordre des étiquette.'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('tags'); + } +} diff --git a/database/migrations/2023_03_14_171035_rename_activated_app_users_table.php b/database/migrations/2023_04_18_153812_create_taggables_table.php similarity index 51% rename from database/migrations/2023_03_14_171035_rename_activated_app_users_table.php rename to database/migrations/2023_04_18_153812_create_taggables_table.php index c9b8af6..afd2dac 100644 --- a/database/migrations/2023_03_14_171035_rename_activated_app_users_table.php +++ b/database/migrations/2023_04_18_153812_create_taggables_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -class RenameActivatedAppUsersTable extends Migration +class CreateTaggablesTable extends Migration { /** * Run the migrations. @@ -13,8 +13,10 @@ class RenameActivatedAppUsersTable extends Migration */ public function up() { - Schema::table('app_users', function (Blueprint $table) { - $table->renameColumn('activated', 'status'); + Schema::create('taggables', function (Blueprint $table) { + $table->foreignId('tag_id')->references('id')->on('tags'); + $table->foreignId('taggable_id')->references('id')->on('documents'); + $table->string('taggable_type', 60); }); } @@ -25,8 +27,6 @@ class RenameActivatedAppUsersTable extends Migration */ public function down() { - Schema::table('app_users', function (Blueprint $table) { - $table->renameColumn('status', 'activated'); - }); + Schema::dropIfExists('taggables'); } } diff --git a/database/migrations/2023_04_18_172743_update_contacts_table.php b/database/migrations/2023_04_18_172743_update_contacts_table.php new file mode 100644 index 0000000..3b1c5ee --- /dev/null +++ b/database/migrations/2023_04_18_172743_update_contacts_table.php @@ -0,0 +1,45 @@ +UPDATED_AT + //phpcs:ignore Generic.Files.LineLength.TooLong + DB::statement('ALTER TABLE `contacts` CHANGE `updated_at` `updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'); + + Schema::table('contacts', function (Blueprint $table) { + $table->renameColumn('user_id', 'app_user_id'); + $table->renameColumn('name', 'lastname'); + $table->dateTime('created_at')->default('CURRENT_TIMESTAMP')->nullable()->change(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + // * APP_USER->CREATED_AT + //phpcs:ignore Generic.Files.LineLength.TooLong + DB::statement('ALTER TABLE `contacts` CHANGE `created_at` `created_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'); + + Schema::table('contacts', function (Blueprint $table) { + $table->renameColumn('app_user_id', 'user_id'); + $table->renameColumn('lastname', 'name'); + $table->dateTime('updated_at')->default('0000-00-00 00:00:00')->nullable()->change(); + }); + } +} diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php index c4e5b3c..9654c22 100644 --- a/database/seeders/DatabaseSeeder.php +++ b/database/seeders/DatabaseSeeder.php @@ -17,6 +17,7 @@ class DatabaseSeeder extends Seeder AppUserSeeder::class, DirectorySeeder::class, SettingSeeder::class, + TagSeeder::class, ]); } } diff --git a/database/seeders/DirectorySeeder.php b/database/seeders/DirectorySeeder.php index 64a5139..da5db9c 100644 --- a/database/seeders/DirectorySeeder.php +++ b/database/seeders/DirectorySeeder.php @@ -5,6 +5,7 @@ namespace Database\Seeders; use App\Models\AppUser; use App\Models\Directory; use Illuminate\Database\Seeder; +use Illuminate\Support\Facades\DB; class DirectorySeeder extends Seeder { @@ -15,8 +16,22 @@ class DirectorySeeder extends Seeder */ public function run() { - $i = 1; - Directory::factory(15)->make()->each(function (Directory $directory) use (&$i) { + + $directory = new Directory(); + $directory->name = [ + "fr" => "Salon", + "en" => "Salon", + "de" => "Wohnzimmer", + "nl" => "Tentoonstelling", + ]; + $directory->directory_id = null; + $directory->needAuthorization = 0; + $directory->is_system = 1; + $directory->order = 1; + $directory->saveOrFail(); + + $i = 2; + Directory::factory(14)->make()->each(function (Directory $directory) use (&$i) { $directory->order = $i; $directory->saveOrFail(); $i = $i + 1; @@ -25,11 +40,9 @@ class DirectorySeeder extends Seeder // Seeder for directory_authorizations table. $directories = Directory::query()->where('needAuthorization', true)->get(); AppUser::each(function (AppUser $model) use ($directories) { - $offset = rand(1, 15); + $offset = rand(DB::table('directories')->min('id') ?? 1, DB::table('directories')->max('id') ?? 15); $length = rand(1, 2); - if (Directory::query()->where('id', $offset)->firstOrFail()->needAuthorization) { - $model->directories()->saveMany($directories->slice($offset, $length)); - } + $model->directories()->saveMany($directories->slice($offset, $length)); }); } } diff --git a/database/seeders/MigrationSeeder.php b/database/seeders/MigrationSeeder.php new file mode 100644 index 0000000..5c2ef1e --- /dev/null +++ b/database/seeders/MigrationSeeder.php @@ -0,0 +1,31 @@ +truncate(); + DB::table('migrations')->insert([ + ['id' => 1, 'migration' => '2023_03_14_150900_create_app_users_table', 'batch' => 1], + ['id' => 2, 'migration' => '2023_03_14_150900_create_contacts_table', 'batch' => 1], + ['id' => 3, 'migration' => '2023_03_14_150900_create_directories_table', 'batch' => 1], + ['id' => 4, 'migration' => '2023_03_14_150900_create_documents_table', 'batch' => 1], + ['id' => 5, 'migration' => '2023_03_14_150900_create_settings_table', 'batch' => 1], + ['id' => 6, 'migration' => '2023_03_14_150900_create_users_table', 'batch' => 1], + ['id' => 7, 'migration' => '2023_03_14_150901_add_foreign_keys_to_contacts_table', 'batch' => 1], + ['id' => 8, 'migration' => '2023_03_14_150901_add_foreign_keys_to_directories_table', 'batch' => 1], + ['id' => 9, 'migration' => '2023_03_14_150901_add_foreign_keys_to_documents_table', 'batch' => 1] + ]); + $this->command->warn('Seeding default Migration table.'); + } +} diff --git a/database/seeders/TagSeeder.php b/database/seeders/TagSeeder.php new file mode 100644 index 0000000..fc93018 --- /dev/null +++ b/database/seeders/TagSeeder.php @@ -0,0 +1,24 @@ +make()->each(function (Tag $tag) use (&$i) { + $tag->order = $i; + $tag->saveOrFail(); + $i = $i + 1; + }); + } +} diff --git a/resources/lang/en/models.php b/resources/lang/en/models.php index d4b57f9..a6ed6a6 100644 --- a/resources/lang/en/models.php +++ b/resources/lang/en/models.php @@ -7,6 +7,7 @@ return [ 'directories' => 'Directories', 'documents' => 'Documents', 'users' => 'Users', - 'settings' => 'Settings' + 'settings' => 'Settings', + 'tags' => 'Tags' ] ]; diff --git a/resources/lang/fr/models.php b/resources/lang/fr/models.php index 58596f5..68f4dd9 100644 --- a/resources/lang/fr/models.php +++ b/resources/lang/fr/models.php @@ -7,6 +7,7 @@ return [ 'directories' => 'Dossiers', 'documents' => 'Documents', 'users' => 'Utilisateurs', - 'settings' => 'Paramètres' + 'settings' => 'Paramètres', + 'tags' => 'Étiquettes' ] ]; diff --git a/resources/ts/bo/components/BelongsToManyDropdownComponent.vue b/resources/ts/bo/components/BelongsToManyDropdownComponent.vue index d2edfb2..0f70e30 100644 --- a/resources/ts/bo/components/BelongsToManyDropdownComponent.vue +++ b/resources/ts/bo/components/BelongsToManyDropdownComponent.vue @@ -3,7 +3,7 @@

{{ message }}

@@ -249,10 +249,6 @@ export default defineComponent({ } } - .message { - color: #ff0000; - } - .fade-enter-active, .fade-leave-active { transition: opacity 0.5s ease; diff --git a/resources/ts/bo/components/CrudDocumentInputComponent.vue b/resources/ts/bo/components/CrudDocumentInputComponent.vue index 39113b4..839ec8e 100644 --- a/resources/ts/bo/components/CrudDocumentInputComponent.vue +++ b/resources/ts/bo/components/CrudDocumentInputComponent.vue @@ -20,6 +20,7 @@ v-for="(language, languageIndex) in intLanguages" :key="languageIndex" :value="language.value" + :selected="Number(intModel?.lang) === language.value ? true : false" > {{ language.label }} @@ -105,12 +106,16 @@ -

+

{{ __("Aucun documents français n'est disponible") }}

@@ -125,7 +130,7 @@ > {{ __("Document à ajouter") }} * -
+
{ @@ -351,9 +357,9 @@ export default defineComponent({ this.intDocumentDatas.path = file.fileName; this.intDocumentDatas.uuid = result.uid; if (file.file.type === "application/pdf") { - this.intDocumentDatas.type = ".pdf"; + this.intDocumentDatas.type = "pdf"; } else { - this.intDocumentDatas.type = ".mp4"; + this.intDocumentDatas.type = "mp4"; } this.intSuccess = true; this.intMessage = "Fichier chargé."; diff --git a/resources/ts/bo/components/DirectoriesComponent.vue b/resources/ts/bo/components/DirectoriesComponent.vue index 6e16df0..4680c0a 100644 --- a/resources/ts/bo/components/DirectoriesComponent.vue +++ b/resources/ts/bo/components/DirectoriesComponent.vue @@ -1,5 +1,21 @@ +
+
+ + {{ __("form.image_input_viewer_loading") }} + +
+
@@ -133,6 +138,7 @@ import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome"; import { Tooltip } from "bootstrap"; import route from "../../modules/route"; import trans from "../../modules/trans"; +import sweetalertConfirm from "../../modules/sweetalertConfirm"; type DirectoryObject = { id: number; @@ -153,13 +159,15 @@ export default defineComponent({ VueNestableHandle, FontAwesomeIcon, }, - mixins: [route, trans], + mixins: [route, trans, sweetalertConfirm], data(): { intCsrf: string | null | undefined; intId: String; intDirectories: DirectoryObject[]; + intMessage: object | object[] | null; intDisplay: boolean[]; - tooltipList: HTMLButtonElement[]; + intLoading: boolean; + intTooltipList: HTMLButtonElement[]; } { return { intCsrf: document @@ -167,8 +175,10 @@ export default defineComponent({ ?.getAttribute("content"), intId: "", intDirectories: [], + intMessage: null, intDisplay: [], - tooltipList: [], + intLoading: false, + intTooltipList: [], }; }, mounted() { @@ -277,30 +287,16 @@ export default defineComponent({ return route; }, /** - * Return destroy route for a directory. + * Return edit route for a directory. * @param id * @return string */ - getDestroyDirectoryRoute(id: number): string { - const route = this.route("bo.directories.destroy", { + getEditButtonRoute(id: number): string { + const route = this.route("bo.settings.edit", { ID: id, }); if (!route) { - throw new Error("Undefined route bo.directories.destroy"); - } - return route; - }, - /** - * Return authorization route for a directory. - * @param id - * @return string - */ - getAuthorizationDirectoryRoute(id: number): string { - const route = this.route("bo.directories.need-authorization", { - ID: id, - }); - if (!route) { - throw new Error("Undefined route bo.directories.need-authorization"); + throw new Error("Undefined route bo.settings.edit"); } return route; }, @@ -317,6 +313,101 @@ export default defineComponent({ this.updateBootstrapTooltip(); }); }, + /** + * Update authorization for a specific directory. + * @param LaravelModel model + */ + updateAuthorization(model: LaravelModel) { + this.intLoading = true; + const route = this.route("bo.directories.need-authorization", { + ID: model.id as number, + }); + if (!route) { + throw new Error("Undefined route bo.directories.need-authorization"); + } + window.axios + .post(route, { id: model.id }) + .then((reponse) => { + this.intDirectories.forEach((directory, directoryindex) => { + if (directory.id === reponse.data.id) { + this.intDirectories[directoryindex] = reponse.data; + } + }); + this.intLoading = false; + this.$nextTick(() => { + this.updateBootstrapTooltip(); + }); + }) + .catch((error) => { + if (error.response) { + console.error(error.response.data); + } else if (error.request) { + console.error(error.request); + } else { + // Something happened in setting up the request that triggered an Error. + console.error("Error", error.message); + } + }); + }, + /** + * Update authorization for a specific directory. + * @param LaravelModel model + */ + deleteDirectory(e: Event, model: LaravelModel) { + const btnConfirmDelete = this.$refs.confirmDelete as HTMLButtonElement; + (async () => { + const promise = new Promise((resolve: (value: boolean) => void) => { + sweetalertConfirm.methods.confirm( + "Confirmez", + "Êtes vous sure ?", + btnConfirmDelete, + function (response) { + resolve(response.isConfirmed); + }, + { icon: "warning" } + ); + return false; + }); + if (await promise) { + this.intLoading = true; + const route = this.route("bo.directories.destroy", { + ID: model.id as number, + }); + if (!route) { + throw new Error("Undefined route bo.directories.destroy"); + } + window.axios + .post(route, { id: model.id, _method: "DELETE" }) + .then((reponse) => { + if (reponse.data[0] !== undefined) { + this.intDirectories = this.recursiveDir(reponse.data); + } else { + this.intMessage = reponse.data; + setTimeout(() => { + this.intMessage = null; + this.$nextTick(() => { + this.updateBootstrapTooltip(); + }); + }, 6000); + } + this.intLoading = false; + this.$nextTick(() => { + this.updateBootstrapTooltip(); + }); + }) + .catch((error) => { + if (error.response) { + console.error(error.response.data); + } else if (error.request) { + console.error(error.request); + } else { + // Something happened in setting up the request that triggered an Error. + console.error("Error", error.message); + } + }); + } + })(); + }, /** * Update Bootstrap tooltips. */ @@ -326,18 +417,18 @@ export default defineComponent({ ".directories-" + this.intId + " [data-bs=\"tooltip\"]" ) ) as HTMLButtonElement[]; - let tmp = newTooltipList.filter((x) => !this.tooltipList.includes(x)); + let tmp = newTooltipList.filter((x) => !this.intTooltipList.includes(x)); tmp.map((tooltip) => { return new Tooltip(tooltip); }); this.closeBootstrapTooltip(); - this.tooltipList = newTooltipList; + this.intTooltipList = newTooltipList; }, /** * Close all Bootstrap tooltips. */ closeBootstrapTooltip() { - this.tooltipList.forEach((tooltip) => { + this.intTooltipList.forEach((tooltip) => { tooltip.blur(); Tooltip.getInstance(tooltip)?.hide(); }); @@ -345,3 +436,19 @@ export default defineComponent({ }, }); + diff --git a/resources/ts/utilities/fontawesome.ts b/resources/ts/utilities/fontawesome.ts index e2b30cb..680b19b 100644 --- a/resources/ts/utilities/fontawesome.ts +++ b/resources/ts/utilities/fontawesome.ts @@ -40,6 +40,8 @@ import { faCircleCheck, faCircleXmark, faFloppyDisk, + faVideo, + faFile, } from "@fortawesome/free-solid-svg-icons"; config.autoReplaceSvg = false; @@ -79,6 +81,8 @@ library.add(faLockOpen); library.add(faCircleCheck); library.add(faCircleXmark); library.add(faFloppyDisk); +library.add(faFile); +library.add(faVideo); // Front library.add(faChevronLeft); diff --git a/resources/views/bo/layout.blade.php b/resources/views/bo/layout.blade.php index ef242bb..3505608 100644 --- a/resources/views/bo/layout.blade.php +++ b/resources/views/bo/layout.blade.php @@ -7,14 +7,14 @@ @include('bo.layouts.header') -
+
@include('modules.flash-message')
-
+
@include('modules.breadcrumb.breadcrumb-body')
diff --git a/resources/views/bo/layouts/header.blade.php b/resources/views/bo/layouts/header.blade.php index 0884889..a0516fd 100644 --- a/resources/views/bo/layouts/header.blade.php +++ b/resources/views/bo/layouts/header.blade.php @@ -1,4 +1,4 @@ -
-
+ @csrf - @method('PUT') @include('bo.pages.app-users.form')
diff --git a/resources/views/bo/pages/app-users/edit.blade.php b/resources/views/bo/pages/app-users/edit.blade.php index 6215128..003e1a1 100644 --- a/resources/views/bo/pages/app-users/edit.blade.php +++ b/resources/views/bo/pages/app-users/edit.blade.php @@ -44,7 +44,7 @@
- + @csrf @method('PUT') @include('bo.pages.app-users.form', ['model' => $app_userModel]) diff --git a/resources/views/bo/pages/app-users/index-list.blade.php b/resources/views/bo/pages/app-users/index-list.blade.php index 984d069..ccb5291 100644 --- a/resources/views/bo/pages/app-users/index-list.blade.php +++ b/resources/views/bo/pages/app-users/index-list.blade.php @@ -20,21 +20,21 @@ {{ $app_usersModel->lastname }} - + {{ $app_usersModel->firstname }} - + {{ $app_usersModel->email }} @if(!$noOrder or $rst) - + @csrf @@ -45,7 +45,7 @@ @csrf @@ -79,7 +79,7 @@ @endforeach @else - + {{ __('Aucun résultat pour les :models', ['models' => __('models.classes.users')]) }} diff --git a/resources/views/bo/pages/app-users/index.blade.php b/resources/views/bo/pages/app-users/index.blade.php index e643867..2574e81 100644 --- a/resources/views/bo/pages/app-users/index.blade.php +++ b/resources/views/bo/pages/app-users/index.blade.php @@ -19,9 +19,13 @@ action="{{ route('bo.app-users.import') }}" method="POST" enctype="multipart/form-data"> - + @csrf - @@ -38,18 +42,13 @@
@include('bo.modules.search-bar') -
-
- {{ $app_users->withQueryString()->onEachSide(1)->links() }} -
-
-
+
@include('bo.pages.app-users.index-list')
-
+
{{ $app_users->withQueryString()->onEachSide(1)->links() }}
diff --git a/resources/views/bo/pages/dashboard.blade.php b/resources/views/bo/pages/dashboard.blade.php index b7546b7..80433b3 100644 --- a/resources/views/bo/pages/dashboard.blade.php +++ b/resources/views/bo/pages/dashboard.blade.php @@ -5,11 +5,42 @@ @section('breadcrumb', 'no') @section('content') -
-
-
+ @csrf @method('PUT') @include('bo.pages.directories.form', ['model' => $directoryModel]) diff --git a/resources/views/bo/pages/directories/form.blade.php b/resources/views/bo/pages/directories/form.blade.php index afe1ee2..5f68050 100644 --- a/resources/views/bo/pages/directories/form.blade.php +++ b/resources/views/bo/pages/directories/form.blade.php @@ -10,7 +10,7 @@ 'label' => __('Nom du :model en français', ['model' => Str::singular(__('models.classes.directories'))]), 'hasWordCounter' => true, 'name' => 'name[fr]', - 'value' => $directoryModel->name['fr'], + 'value' => $directoryModel->name['fr'] ?? "", 'required' => true, 'model' => $directoryModel ?? null, 'helper' => __('Doit posséder 3 caractères minimum, 255 maximum.'), @@ -31,7 +31,7 @@ 'label' => __('Nom du :model en anglais', ['model' => Str::singular(__('models.classes.directories'))]), 'hasWordCounter' => true, 'name' => 'name[en]', - 'value' => $directoryModel->name['en'], + 'value' => $directoryModel->name['en'] ?? "", 'required' => true, 'model' => $directoryModel ?? null, 'helper' => __('Doit posséder 3 caractères minimum, 255 maximum.'), @@ -52,7 +52,7 @@ 'label' => __('Nom du :model en allemand', ['model' => Str::singular(__('models.classes.directories'))]), 'hasWordCounter' => true, 'name' => 'name[de]', - 'value' => $directoryModel->name['de'], + 'value' => $directoryModel->name['de'] ?? "", 'required' => true, 'model' => $directoryModel ?? null, 'helper' => __('Doit posséder 3 caractères minimum, 255 maximum.'), @@ -73,7 +73,7 @@ 'label' => __('Nom du :model en néerlandais', ['model' => Str::singular(__('models.classes.directories'))]), 'hasWordCounter' => true, 'name' => 'name[nl]', - 'value' => $directoryModel->name['nl'], + 'value' => $directoryModel->name['nl'] ?? "", 'required' => true, 'model' => $directoryModel ?? null, 'helper' => __('Doit posséder 3 caractères minimum, 255 maximum.'), diff --git a/resources/views/bo/pages/directories/index.blade.php b/resources/views/bo/pages/directories/index.blade.php index 5ffaa37..cb8e1e0 100644 --- a/resources/views/bo/pages/directories/index.blade.php +++ b/resources/views/bo/pages/directories/index.blade.php @@ -20,14 +20,12 @@
+ method="POST"> @csrf - @method('PUT')
@include('modules.input-error', [ - 'inputName' => "name", + 'inputName' => "name.fr", 'helperId' => 'directoryNameHelp', 'helper' => __('Doit posséder 3 caractères minimum, 255 maximum.'), ]) diff --git a/resources/views/bo/pages/documents/create.blade.php b/resources/views/bo/pages/documents/create.blade.php index d007db5..d4a2938 100644 --- a/resources/views/bo/pages/documents/create.blade.php +++ b/resources/views/bo/pages/documents/create.blade.php @@ -33,7 +33,7 @@
- + @csrf @method('PUT') @include('bo.pages.documents.form') diff --git a/resources/views/bo/pages/documents/edit.blade.php b/resources/views/bo/pages/documents/edit.blade.php index 92ffd4e..ae1b114 100644 --- a/resources/views/bo/pages/documents/edit.blade.php +++ b/resources/views/bo/pages/documents/edit.blade.php @@ -27,7 +27,7 @@ @method('DELETE') @csrf
- + @csrf @method('PUT') @include('bo.pages.documents.form', ['model' => $documentModel]) diff --git a/resources/views/bo/pages/documents/form.blade.php b/resources/views/bo/pages/documents/form.blade.php index 2b207e5..678b637 100644 --- a/resources/views/bo/pages/documents/form.blade.php +++ b/resources/views/bo/pages/documents/form.blade.php @@ -16,6 +16,43 @@
+ {{-- TAGS --}} +
+
+ {{ __('Étiquettes') }} +
+
+ @include('bo.partials.inputs.pivot-belongs-to-many', [ + 'id' => 'app_userAuthorizedFolders', + 'name' => 'tags', + 'label' => __('Étiquettes associées'), + 'model' => $documentModel ?? null, + 'itemsList' => $tags, + 'itemLimit' => [0,5], + 'placeholder' => __('Recherchez une étiquette'), + 'helper' => __('Sélectionner des étiquettes parmis la liste (0 minimum et 5 maximum).'), + ]) +
+
+
+
+ {{-- STATUS --}} +
+
+ {{ __('Publication') }} +
+
+ @include('bo.partials.inputs.boolean-switch', [ + 'id' => 'documentStatus', + 'name' => 'status', + 'label' => __('État de publication'), + 'model' => $documentModel ?? null, + 'helper' => __('Le document est publié ou non.') + ]) +
+
+
+
@push('scripts') diff --git a/resources/views/bo/pages/documents/index-list.blade.php b/resources/views/bo/pages/documents/index-list.blade.php index b875036..5ac1861 100644 --- a/resources/views/bo/pages/documents/index-list.blade.php +++ b/resources/views/bo/pages/documents/index-list.blade.php @@ -4,59 +4,85 @@ @php $rst = !is_null(request()->rst); $routeName = request()->route()->getName(); - $noOrder = Session::get("$routeName.sort_col") !== 'order' and (Session::has("$routeName.sort_col") or Session::has("$routeName.sort_way")); $noOrder = Session::get("$routeName.sort_col") !== '' and (Session::has("$routeName.sort_col") or Session::has("$routeName.sort_way")); - $cols = ['title' => __('Title'), 'directory_id' => __('Dossier'), 'order' => __('Order')]; + $cols = ['title' => __('Title'), 'directory_id' => __('Dossier'), 'document_id' => __('Document'), 'type' => __('Type'), 'order' => __('Order')]; @endphp @include('bo.modules.table-col-sorter', [ 'cols' => $cols, - 'mobileHide' => [], + 'mobileHide' => [] ]) @if ($documents->count()) @foreach ($documents as $documentModel) - + {{ $documentModel->title }} - - @if(!$documentModel->directory->is_system) + + @if(isset($documentModel->directory->is_system) && !$documentModel->directory->is_system) @endif + + @if(isset($documentModel->document_id)) + + + + @endif + + + @switch($documentModel->type) + @case("mp4") + + + + @break + @case("pdf") + + + + @break + @endswitch + @if(!$noOrder or $rst) - -
- - @csrf - - - -
+ + + @endif @@ -65,7 +91,7 @@ @method('DELETE') @csrf
@include('bo.modules.search-bar') -
-
- {{ $documents->withQueryString()->onEachSide(1)->links() }} -
-
-
+
@include('bo.pages.documents.index-list')
-
+
{{ $documents->withQueryString()->onEachSide(1)->links() }}
diff --git a/resources/views/bo/pages/settings/index-list.blade.php b/resources/views/bo/pages/settings/index-list.blade.php index 49dbcab..725e0fd 100644 --- a/resources/views/bo/pages/settings/index-list.blade.php +++ b/resources/views/bo/pages/settings/index-list.blade.php @@ -58,6 +58,7 @@ ]) @break @case(\App\Enums\SettingTypesEnum::directory()) + @if ($settingModel->value != null)
-
-
- {{ $settings->withQueryString()->onEachSide(1)->links() }} -
-
@endsection diff --git a/resources/views/bo/pages/tags/create.blade.php b/resources/views/bo/pages/tags/create.blade.php new file mode 100644 index 0000000..88cc768 --- /dev/null +++ b/resources/views/bo/pages/tags/create.blade.php @@ -0,0 +1,53 @@ +@extends('bo.layout') + +@section('title', sprintf('%s - %s', Str::singular(__('models.classes.tags')), Str::ucfirst(__('création')))) +@section('description', __('Page de création d\'un nouveau tag de l\'application.')) + +@section('breadcrumb', request()->route()->getName()) + +@section('content') +
+
+
+
+

+ + + + {{ Str::singular(__('models.classes.tags')) }} {{ Str::ucfirst(__('création')) }} +

+
+
+ +
+
+
+
+
+ @csrf + @include('bo.pages.tags.form') +
+
+ +
+
+
+
+
+@endsection diff --git a/resources/views/bo/pages/tags/edit.blade.php b/resources/views/bo/pages/tags/edit.blade.php new file mode 100644 index 0000000..54322fc --- /dev/null +++ b/resources/views/bo/pages/tags/edit.blade.php @@ -0,0 +1,65 @@ +@extends('bo.layout', ['brParam' => $tagModel]) + +@section('title', sprintf('%s - %s %s', Str::singular(__('models.classes.tags')), Str::ucfirst(__('édition')), $tagModel->title)) +@section('description', __('Page d\'édition d\'un tag de l\'application.')) + +@section('breadcrumb', request()->route()->getName()) + +@section('content') +
+
+
+
+

+ + + + {{ Str::singular(__('models.classes.tags')) }} {{ Str::ucfirst(__('édition')) }} +

+
+
+
+ @method('DELETE') + @csrf +
+ + +
+
+
+
+
+
+
+ @csrf + @method('PUT') + @include('bo.pages.tags.form', ['model' => $tagModel]) +
+
+ +
+
+
+
+
+@endsection diff --git a/resources/views/bo/pages/tags/form.blade.php b/resources/views/bo/pages/tags/form.blade.php new file mode 100644 index 0000000..6dd6ec9 --- /dev/null +++ b/resources/views/bo/pages/tags/form.blade.php @@ -0,0 +1,36 @@ +
+ {{-- NAME --}} +
+
+ {{ __('Nom') }} +
+
+ @include('bo.partials.inputs.varchar', [ + 'id' => 'tagName', + 'label' => __('Nom de l\':model', ['model' => Str::singular(__('models.classes.tags'))]), + 'hasWordCounter' => true, + 'name' => 'name', + 'required' => true, + 'model' => $tagModel ?? null, + 'helper' => __('Doit posséder 3 caractères minimum, 255 maximum.'), + 'placeholder' => "Un beau nom" + ]) +
+
+
+
+
+ +@push('scripts') + +@endpush diff --git a/resources/views/bo/pages/tags/index-list.blade.php b/resources/views/bo/pages/tags/index-list.blade.php new file mode 100644 index 0000000..b6ada10 --- /dev/null +++ b/resources/views/bo/pages/tags/index-list.blade.php @@ -0,0 +1,84 @@ +
+ + + @php + $rst = !is_null(request()->rst); + $routeName = request()->route()->getName(); + $noOrder = Session::get("$routeName.sort_col") !== '' and (Session::has("$routeName.sort_col") or Session::has("$routeName.sort_way")); + $cols = ['name' => __('Nom'), 'order' => __('Order')]; + @endphp + @include('bo.modules.table-col-sorter', [ + 'cols' => $cols, + 'mobileHide' => [], + ]) + + + @if ($tags->count()) + @foreach ($tags as $tagModel) + + + @if(!$noOrder or $rst) + + @endif + + + @endforeach + @else + + + + @endif + +
+ {{ $tagModel->name }} + + + + +
+
+ @method('DELETE') + @csrf +
+ + + + +
+
+
+
+ + {{ __('Aucun résultat pour les :models', ['models' => __('models.classes.tags')]) }} + +
+
diff --git a/resources/views/bo/pages/tags/index.blade.php b/resources/views/bo/pages/tags/index.blade.php new file mode 100644 index 0000000..0b948e4 --- /dev/null +++ b/resources/views/bo/pages/tags/index.blade.php @@ -0,0 +1,43 @@ +@extends('bo.layout') + +@section('title', sprintf('%s - %s', __('models.classes.tags'), Str::ucfirst(__('liste')))) +@section('description', __('Page de contôle sur tous les tags de l\'application.')) + +@section('breadcrumb', request()->route()->getName()) + +@section('content') +
+
+
+
+

+ {{ __('models.classes.tags') }} {{ Str::ucfirst(__('liste')) }} +

+
+
+
+ + + +
+
+
+
+
+ @include('bo.modules.search-bar') +
+
+ @include('bo.pages.tags.index-list') +
+
+
+
+ {{ $tags->withQueryString()->onEachSide(1)->links() }} +
+
+
+
+@endsection diff --git a/resources/views/bo/partials/inputs/bigint-foreign-id.blade.php b/resources/views/bo/partials/inputs/bigint-foreign-id.blade.php index a36d13b..3601a6d 100644 --- a/resources/views/bo/partials/inputs/bigint-foreign-id.blade.php +++ b/resources/views/bo/partials/inputs/bigint-foreign-id.blade.php @@ -2,14 +2,15 @@ @endif @include('modules.input-error', [ 'inputName' => $name, - 'helperId' => "{{ $id }}Help", + 'helperId' => $id . "Help", 'helper' => $helper ]) diff --git a/resources/views/bo/partials/inputs/pivot-belongs-to-many.blade.php b/resources/views/bo/partials/inputs/pivot-belongs-to-many.blade.php index 159094b..35c4698 100644 --- a/resources/views/bo/partials/inputs/pivot-belongs-to-many.blade.php +++ b/resources/views/bo/partials/inputs/pivot-belongs-to-many.blade.php @@ -7,8 +7,8 @@ $data = [ 'name' => $name, 'value' => old($name, $model->{$name} ?? []) ?? [], - 'placeholder' => $placeholder, - 'itemsList' => $itemsList, + 'placeholder' => $placeholder ?? "", + 'itemsList' => $itemsList ?? [], 'itemLimit' => $itemLimit ?? null, 'errors' => $errors->getBag('default')->getMessages() ?? [] ]; @@ -16,6 +16,6 @@ $data = [
@include('modules.input-error', [ 'inputName' => $name, - 'helperId' => "{$id}Help", + 'helperId' => $id . "Help", 'helper' => $helper, ]) diff --git a/resources/views/modules/breadcrumb/layout.blade.php b/resources/views/modules/breadcrumb/layout.blade.php index 09528c9..518003e 100644 --- a/resources/views/modules/breadcrumb/layout.blade.php +++ b/resources/views/modules/breadcrumb/layout.blade.php @@ -1,6 +1,6 @@ @if (isset($breadcrumbs)) @unless ($breadcrumbs->isEmpty()) -