From aed37bfad3cb604a9bf56010e6f62f7702a423da Mon Sep 17 00:00:00 2001 From: Vincent BRIDIER Date: Thu, 29 Sep 2022 10:09:43 +0200 Subject: [PATCH] phpcbf --- app/Console/Commands/UserCreate.php | 12 +- app/Console/Kernel.php | 9 +- app/Http/Controllers/API/SyncController.php | 138 +++---- .../Auth/ConfirmPasswordController.php | 17 +- .../Auth/ForgotPasswordController.php | 17 +- app/Http/Controllers/Auth/LoginController.php | 17 +- .../Controllers/Auth/RegisterController.php | 21 +- .../Auth/ResetPasswordController.php | 17 +- .../Auth/VerificationController.php | 17 +- app/Http/Controllers/Controller.php | 4 +- app/Http/Controllers/DocumentsController.php | 50 +-- app/Http/Controllers/FoldersController.php | 55 +-- app/Http/Controllers/HomeController.php | 13 +- app/Http/Controllers/SettingController.php | 10 +- app/Http/Controllers/ShowController.php | 12 +- app/Http/Controllers/UsersController.php | 17 +- app/Http/Middleware/Authenticate.php | 2 +- app/Http/Middleware/CheckApiToken.php | 6 +- .../Middleware/CheckForMaintenanceMode.php | 3 +- app/Http/Middleware/EncryptCookies.php | 3 +- .../Middleware/RedirectIfAuthenticated.php | 6 +- app/Http/Middleware/TrustProxies.php | 2 +- app/Http/Middleware/VerifyCsrfToken.php | 2 +- app/Http/Requests/Setting/UpdateRequest.php | 2 +- app/Http/Requests/Users/ImportRequest.php | 2 +- app/Http/Requests/Users/StoreRequest.php | 2 +- app/Http/Requests/Users/UpdateRequest.php | 2 +- app/Http/Resources/AppUsersCollection.php | 2 +- app/Http/Resources/ContactsCollection.php | 2 +- app/Http/Resources/DirectoriesCollection.php | 2 +- app/Http/Resources/DocumentsCollection.php | 2 +- app/Imports/UsersImport.php | 10 +- app/Mail/AccountCreated.php | 5 +- app/Mail/SendFlyer.php | 6 +- app/Mail/SendFlyerFailed.php | 8 +- app/Models/AppUser.php | 2 +- app/Models/Contacts.php | 4 +- app/Models/Directories.php | 8 +- app/Models/Document.php | 3 +- app/Providers/AppServiceProvider.php | 1 - app/Providers/EventServiceProvider.php | 3 - app/Providers/RouteServiceProvider.php | 3 - app/User.php | 5 +- composer.json | 6 +- composer.lock | 239 +++++++++++- config/app.php | 176 ++++----- config/auth.php | 116 +++--- config/broadcasting.php | 36 +- config/cache.php | 56 +-- config/database.php | 76 ++-- config/excel.php | 342 +++++++++--------- config/filesystems.php | 54 +-- config/hashing.php | 52 +-- config/logging.php | 40 +- config/mail.php | 150 ++++---- config/queue.php | 52 +-- config/services.php | 18 +- config/session.php | 236 ++++++------ config/view.php | 32 +- database/factories/UserFactory.php | 19 +- routes/api.php | 31 +- routes/channels.php | 18 +- routes/console.php | 16 +- routes/web.php | 16 +- tests/CreatesApplication.php | 2 +- tests/Feature/ExampleTest.php | 1 - 66 files changed, 1284 insertions(+), 1024 deletions(-) diff --git a/app/Console/Commands/UserCreate.php b/app/Console/Commands/UserCreate.php index 1b31c1e..b44ef7d 100644 --- a/app/Console/Commands/UserCreate.php +++ b/app/Console/Commands/UserCreate.php @@ -35,17 +35,17 @@ class UserCreate extends Command /** * Execute the console command. * - * @return int + * @return integer */ public function handle() { - $name = $this->ask('What is the name?'); + $name = $this->ask('What is the name?'); $email = $this->ask('What is the mail?'); - $pwd = $this->secret('What is the password?'); + $pwd = $this->secret('What is the password?'); - $user = new User(); - $user->name = $name; - $user->email = $email; + $user = new User(); + $user->name = $name; + $user->email = $email; $user->password = Hash::make($pwd); $user->save(); diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index a8c5158..a3d0163 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -13,19 +13,18 @@ class Kernel extends ConsoleKernel * @var array */ protected $commands = [ - // - ]; + ]; /** * Define the application's command schedule. * - * @param \Illuminate\Console\Scheduling\Schedule $schedule + * @param \Illuminate\Console\Scheduling\Schedule $schedule * @return void */ protected function schedule(Schedule $schedule) { // $schedule->command('inspire') - // ->hourly(); + // ->hourly(); } /** @@ -35,7 +34,7 @@ class Kernel extends ConsoleKernel */ protected function commands() { - $this->load(__DIR__.'/Commands'); + $this->load(__DIR__ . '/Commands'); require base_path('routes/console.php'); } diff --git a/app/Http/Controllers/API/SyncController.php b/app/Http/Controllers/API/SyncController.php index 172e34a..37c3c91 100644 --- a/app/Http/Controllers/API/SyncController.php +++ b/app/Http/Controllers/API/SyncController.php @@ -17,41 +17,46 @@ use Google\Cloud\Vision\V1\ImageAnnotatorClient; class SyncController extends Controller { - public function getUsers(Request $request) { + public function getUsers(Request $request) + { return new \App\Http\Resources\AppUserCollection(\App\Models\AppUser::where('activated', 1)->get()); } - public function getContacts(Request $request) { + public function getContacts(Request $request) + { $userId = $request->userId; $this->syncContacts($request->contacts, $userId); return new \App\Http\Resources\ContactsCollection(\App\Models\Contacts::where('user_id', $userId)->get()); } - public function getDirectories(Request $request) { + public function getDirectories(Request $request) + { return new \App\Http\Resources\DirectoriesCollection(\App\Models\Directories::all()); } - public function getDocuments(Request $request) { + public function getDocuments(Request $request) + { return new \App\Http\Resources\DocumentsCollection(\App\Models\Document::where('published', 1)->get()); } - 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(); + 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); + $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); - //echo $response->getStatusCode(); - //echo $response->getHeaderLine('content-type'); - $body = $response->getBody(); + // echo $response->getStatusCode(); + // echo $response->getHeaderLine('content-type'); + $body = $response->getBody(); $storeVersion = json_decode($body)->version; } catch (ClientException $e) { - //var_dump($e->getRequest()); - //var_dump($e->getResponse()->getStatusCode()); + // var_dump($e->getRequest()); + // var_dump($e->getResponse()->getStatusCode()); $storeVersion = $app_version; } @@ -64,25 +69,28 @@ class SyncController extends Controller return ['version' => $version->version, 'ShowIsActive' => $ShowIsActive->ShowIsActive, 'newApp' => $newApp]; } - public function SendFlyer(Request $request) { + public function SendFlyer(Request $request) + { $emails = json_decode($request->emails); foreach ($emails as $datas) { - $email = $datas->email; + $email = $datas->email; $subject = $datas->subject; $message = $datas->message; $user_id = $datas->user_id; - $docs = json_decode($datas->documents); + $docs = json_decode($datas->documents); $user = AppUser::find($user_id); - $attach = []; + $attach = []; $filesName = []; - $noExists = []; + $noExists = []; foreach ($docs as $doc) { $exists = Storage::disk('public')->exists('docs/' . $doc->uuid . '.' . $doc->type); if ($exists) { array_push($attach, URL::temporarySignedRoute( - 'docs.download', now()->addDays(30), ['uuid' => $doc->uuid] + 'docs.download', + now()->addDays(30), + ['uuid' => $doc->uuid] )); array_push($filesName, $doc->title); } else { @@ -95,7 +103,7 @@ class SyncController extends Controller 'body' => $message, 'from' => $user->email, 'fromName' => $user->surname . ' ' . $user->firstname, - 'subject' => '['. config('app.BRAND') .'] - '. $subject, + 'subject' => '[' . config('app.BRAND') . '] - ' . $subject, 'attach' => $attach, 'filesName' => $filesName, ]); @@ -114,13 +122,14 @@ class SyncController extends Controller Mail::to($user->email) ->queue($message); - } - } + }//end if + }//end foreach return 'OK'; } - private function syncContacts($contacts, $userId) { - $contacts = json_decode (json_encode ($contacts), FALSE); + private function syncContacts($contacts, $userId) + { + $contacts = json_decode(json_encode($contacts), false); foreach ($contacts as $contact) { if ($contact->to_delete === true) { $tmp = Contacts::where([ @@ -145,65 +154,64 @@ class SyncController extends Controller ['user_id', '=', $contact->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->name = $contact->name; + $tmp->email = $contact->email; + $tmp->type = $contact->type; + $tmp->other = $contact->other; + $tmp->select1 = $contact->select1; + $tmp->select2 = $contact->select2; + $tmp->name = $contact->name; $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->user_id = $contact->user_id; + $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->user_id = $contact->user_id; $tmp->save(); } else { - $tmp = new Contacts(); - $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->name = $contact->name; + $tmp = new Contacts(); + $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->name = $contact->name; $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->user_id = $contact->user_id; + $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->user_id = $contact->user_id; $tmp->save(); - } - } - } + }//end if + }//end if + }//end foreach } - public function processOCR(Request $request) { + public function processOCR(Request $request) + { - # instantiates a client + // instantiates a client $imageAnnotator = new ImageAnnotatorClient([ 'credentials' => public_path() . '/credentials.json' ]); - # the name of the image file to annotate + // the name of the image file to annotate $fileName = 'test.jpg'; - # prepare the image to be annotated + // prepare the image to be annotated $image = file_get_contents(public_path() . "/" . $fileName); - # performs label detection on the image file + // performs label detection on the image file $response = $imageAnnotator->textDetection($image); - $labels = $response->getTextAnnotations(); + $labels = $response->getTextAnnotations(); foreach ($labels as $label) { echo $label->getDescription() . "
"; } - } - } diff --git a/app/Http/Controllers/Auth/ConfirmPasswordController.php b/app/Http/Controllers/Auth/ConfirmPasswordController.php index 138c1f0..f6112b2 100644 --- a/app/Http/Controllers/Auth/ConfirmPasswordController.php +++ b/app/Http/Controllers/Auth/ConfirmPasswordController.php @@ -9,16 +9,15 @@ use Illuminate\Foundation\Auth\ConfirmsPasswords; class ConfirmPasswordController extends Controller { /* - |-------------------------------------------------------------------------- - | Confirm Password Controller - |-------------------------------------------------------------------------- - | - | This controller is responsible for handling password confirmations and - | uses a simple trait to include the behavior. You're free to explore - | this trait and override any functions that require customization. - | + |-------------------------------------------------------------------------- + | Confirm Password Controller + |-------------------------------------------------------------------------- + | + | This controller is responsible for handling password confirmations and + | uses a simple trait to include the behavior. You're free to explore + | this trait and override any functions that require customization. + | */ - use ConfirmsPasswords; /** diff --git a/app/Http/Controllers/Auth/ForgotPasswordController.php b/app/Http/Controllers/Auth/ForgotPasswordController.php index 465c39c..75ef4e6 100644 --- a/app/Http/Controllers/Auth/ForgotPasswordController.php +++ b/app/Http/Controllers/Auth/ForgotPasswordController.php @@ -8,15 +8,14 @@ use Illuminate\Foundation\Auth\SendsPasswordResetEmails; class ForgotPasswordController extends Controller { /* - |-------------------------------------------------------------------------- - | Password Reset Controller - |-------------------------------------------------------------------------- - | - | This controller is responsible for handling password reset emails and - | includes a trait which assists in sending these notifications from - | your application to your users. Feel free to explore this trait. - | + |-------------------------------------------------------------------------- + | Password Reset Controller + |-------------------------------------------------------------------------- + | + | This controller is responsible for handling password reset emails and + | includes a trait which assists in sending these notifications from + | your application to your users. Feel free to explore this trait. + | */ - use SendsPasswordResetEmails; } diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php index 18a0d08..cc5fba3 100644 --- a/app/Http/Controllers/Auth/LoginController.php +++ b/app/Http/Controllers/Auth/LoginController.php @@ -9,16 +9,15 @@ use Illuminate\Foundation\Auth\AuthenticatesUsers; class LoginController extends Controller { /* - |-------------------------------------------------------------------------- - | Login Controller - |-------------------------------------------------------------------------- - | - | This controller handles authenticating users for the application and - | redirecting them to your home screen. The controller uses a trait - | to conveniently provide its functionality to your applications. - | + |-------------------------------------------------------------------------- + | Login Controller + |-------------------------------------------------------------------------- + | + | This controller handles authenticating users for the application and + | redirecting them to your home screen. The controller uses a trait + | to conveniently provide its functionality to your applications. + | */ - use AuthenticatesUsers; /** diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index c6a6de6..1eddeb9 100644 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -12,16 +12,15 @@ use Illuminate\Support\Facades\Validator; class RegisterController extends Controller { /* - |-------------------------------------------------------------------------- - | Register Controller - |-------------------------------------------------------------------------- - | - | This controller handles the registration of new users as well as their - | validation and creation. By default this controller uses a trait to - | provide this functionality without requiring any additional code. - | + |-------------------------------------------------------------------------- + | Register Controller + |-------------------------------------------------------------------------- + | + | This controller handles the registration of new users as well as their + | validation and creation. By default this controller uses a trait to + | provide this functionality without requiring any additional code. + | */ - use RegistersUsers; /** @@ -44,7 +43,7 @@ class RegisterController extends Controller /** * Get a validator for an incoming registration request. * - * @param array $data + * @param array $data * @return \Illuminate\Contracts\Validation\Validator */ protected function validator(array $data) @@ -59,7 +58,7 @@ class RegisterController extends Controller /** * Create a new user instance after a valid registration. * - * @param array $data + * @param array $data * @return \App\User */ protected function create(array $data) diff --git a/app/Http/Controllers/Auth/ResetPasswordController.php b/app/Http/Controllers/Auth/ResetPasswordController.php index b1726a3..fa4081b 100644 --- a/app/Http/Controllers/Auth/ResetPasswordController.php +++ b/app/Http/Controllers/Auth/ResetPasswordController.php @@ -9,16 +9,15 @@ use Illuminate\Foundation\Auth\ResetsPasswords; class ResetPasswordController extends Controller { /* - |-------------------------------------------------------------------------- - | Password Reset Controller - |-------------------------------------------------------------------------- - | - | This controller is responsible for handling password reset requests - | and uses a simple trait to include this behavior. You're free to - | explore this trait and override any methods you wish to tweak. - | + |-------------------------------------------------------------------------- + | Password Reset Controller + |-------------------------------------------------------------------------- + | + | This controller is responsible for handling password reset requests + | and uses a simple trait to include this behavior. You're free to + | explore this trait and override any methods you wish to tweak. + | */ - use ResetsPasswords; /** diff --git a/app/Http/Controllers/Auth/VerificationController.php b/app/Http/Controllers/Auth/VerificationController.php index 5e749af..74ab841 100644 --- a/app/Http/Controllers/Auth/VerificationController.php +++ b/app/Http/Controllers/Auth/VerificationController.php @@ -9,16 +9,15 @@ use Illuminate\Foundation\Auth\VerifiesEmails; class VerificationController extends Controller { /* - |-------------------------------------------------------------------------- - | Email Verification Controller - |-------------------------------------------------------------------------- - | - | This controller is responsible for handling email verification for any - | user that recently registered with the application. Emails may also - | be re-sent if the user didn't receive the original email message. - | + |-------------------------------------------------------------------------- + | Email Verification Controller + |-------------------------------------------------------------------------- + | + | This controller is responsible for handling email verification for any + | user that recently registered with the application. Emails may also + | be re-sent if the user didn't receive the original email message. + | */ - use VerifiesEmails; /** diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index a0a2a8a..ce1176d 100644 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -9,5 +9,7 @@ use Illuminate\Routing\Controller as BaseController; class Controller extends BaseController { - use AuthorizesRequests, DispatchesJobs, ValidatesRequests; + use AuthorizesRequests; + use DispatchesJobs; + use ValidatesRequests; } diff --git a/app/Http/Controllers/DocumentsController.php b/app/Http/Controllers/DocumentsController.php index 4f0ffee..e38ea25 100644 --- a/app/Http/Controllers/DocumentsController.php +++ b/app/Http/Controllers/DocumentsController.php @@ -7,7 +7,6 @@ use App\Models\Document; use Illuminate\Http\UploadedFile; use Illuminate\Support\Facades\Storage; use Pion\Laravel\ChunkUpload\Exceptions\UploadMissingFileException; -use Pion\Laravel\ChunkUpload\Handler\AbstractHandler; use Pion\Laravel\ChunkUpload\Handler\HandlerFactory; use Pion\Laravel\ChunkUpload\Receiver\FileReceiver; use Illuminate\Http\Request; @@ -24,22 +23,23 @@ class DocumentsController extends Controller return view('document.create', ['folders' => Directories::all(), 'docsFR' => Document::where('lang', '=', 'fr')->orderBy('title', 'asc')->get()]); } - public function store(Request $request) { - $tmp = $request->document; - $doc = new Document(); - $doc->uuid = $tmp['uuid']; - $doc->title = $tmp['title']; - $doc->type = $tmp['type']; + public function store(Request $request) + { + $tmp = $request->document; + $doc = new Document(); + $doc->uuid = $tmp['uuid']; + $doc->title = $tmp['title']; + $doc->type = $tmp['type']; $doc->directory = $tmp['directory']; - $doc->path = $tmp['path']; - $doc->lang = $tmp['lang']; - $doc->parent = $tmp['parent']; - if ($tmp['published'] === true || $tmp['published'] === 1){ + $doc->path = $tmp['path']; + $doc->lang = $tmp['lang']; + $doc->parent = $tmp['parent']; + if ($tmp['published'] === true || $tmp['published'] === 1) { $doc->published = 1; - }else{ + } else { $doc->published = 0; } - if($doc->save()){ + if ($doc->save()) { return $doc->id; } return 'NOK'; @@ -52,15 +52,15 @@ class DocumentsController extends Controller public function update(Request $request, Document $document) { - $tmp = $request->document; - $document->uuid = $tmp['uuid']; - $document->title = $tmp['title']; - $document->type = $tmp['type']; + $tmp = $request->document; + $document->uuid = $tmp['uuid']; + $document->title = $tmp['title']; + $document->type = $tmp['type']; $document->directory = $tmp['directory']; - $document->path = $tmp['path']; - if ($tmp['published'] === true || $tmp['published'] === 1){ + $document->path = $tmp['path']; + if ($tmp['published'] === true || $tmp['published'] === 1) { $document->published = 1; - }else{ + } else { $document->published = 0; } $document->save(); @@ -75,10 +75,11 @@ class DocumentsController extends Controller return "OK"; } - public function upload(Request $request) { + public function upload(Request $request) + { if (isset($request->uuid)) { $uuid = $request->uuid; - }else{ + } else { $uuid = false; } // create the file receiver @@ -106,8 +107,9 @@ class DocumentsController extends Controller protected function saveFile(UploadedFile $file, $uuid) { - if ($uuid === false) + if ($uuid === false) { $uuid = sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x', mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0x0fff) | 0x4000, mt_rand(0, 0x3fff) | 0x8000, mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff)); + } $finalPath = storage_path('app/public/docs/'); // move the file name $file->move($finalPath, $uuid . '.' . $file->getClientOriginalExtension()); @@ -119,7 +121,7 @@ class DocumentsController extends Controller /** Download the document */ public function download(Request $request, $uuid) { - $doc = Document::where('uuid', $uuid)->firstOrFail(); + $doc = Document::where('uuid', $uuid)->firstOrFail(); $pathToFile = public_path() . Storage::url('docs/' . $doc->uuid . '.' . $doc->type); return response()->download($pathToFile, $doc->path); } diff --git a/app/Http/Controllers/FoldersController.php b/app/Http/Controllers/FoldersController.php index 2294826..ca657bb 100644 --- a/app/Http/Controllers/FoldersController.php +++ b/app/Http/Controllers/FoldersController.php @@ -7,18 +7,20 @@ use Illuminate\Http\Request; class FoldersController extends Controller { - public function index(Request $request) { + public function index(Request $request) + { $folders = Directories::all(); return view('folder.index', ['folders' => $folders]); } - public function toggleAuthorization(Request $request) { + public function toggleAuthorization(Request $request) + { $folderId = $request->id; - $folder = Directories::find($folderId); + $folder = Directories::find($folderId); if ($folder) { - if ($folder->needAuthorization === 0){ + if ($folder->needAuthorization === 0) { $folder->needAuthorization = 1; - }else{ + } else { $folder->needAuthorization = 0; } $folder->save(); @@ -26,33 +28,36 @@ class FoldersController extends Controller return Directories::all(); } - public function saveOrder(Request $request) { + public function saveOrder(Request $request) + { return $this->orderFolders($request->folders); } - public function saveName(Request $request) { + public function saveName(Request $request) + { $folder = Directories::find($request->id); - if($folder) { + if ($folder) { $folder->name = $request->name; $folder->save(); } return Directories::all(); } - public function add(Request $request) { - $folder = new Directories(); - $folder->name = $request->name; + public function add(Request $request) + { + $folder = new Directories(); + $folder->name = $request->name; $folder->order = $request->order; $folder->save(); return Directories::all(); } - public function delete(Request $request) { + public function delete(Request $request) + { $folder = Directories::find($request->id); - if($folder) { + if ($folder) { $count = $folder->documents->count(); - if ($count > 0) - { + if ($count > 0) { return ['status' => 'KO', 'error' => sprintf("Il y a %d document(s) lié(s).", $count)]; } $folder->delete(); @@ -60,27 +65,29 @@ class FoldersController extends Controller return ['status' => 'OK', 'directories' => Directories::all()]; } - private function orderFolders($folders){ + private function orderFolders($folders) + { foreach ($folders as $folder) { - $directory = Directories::where('id', $folder['id'])->first(); - $directory->order = $folder['order']; - $directory->parent = null; + $directory = Directories::where('id', $folder['id'])->first(); + $directory->order = $folder['order']; + $directory->parent = null; $directory->needAuthorization = 0; $directory->save(); - if(isset($folder['children']) && count($folder['children']) > 0 ){ + if (isset($folder['children']) && count($folder['children']) > 0) { $this->recordOrder($folder['children'], $folder['id']); } } return ['status' => 'OK', 'directories' => Directories::all()]; } - private function recordOrder($folders, $parentId) { + private function recordOrder($folders, $parentId) + { foreach ($folders as $k => $folder) { - $directory = Directories::where('id', $folder['id'])->first(); - $directory->order = $folder['order']; + $directory = Directories::where('id', $folder['id'])->first(); + $directory->order = $folder['order']; $directory->parent = $parentId; $directory->save(); - if(isset($folder['children']) && count($folder['children']) > 0 ){ + if (isset($folder['children']) && count($folder['children']) > 0) { $this->recordOrder($folder['children'], $folder['id']); } } diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index 4b20c06..cd0cc0a 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -20,8 +20,9 @@ class HomeController extends Controller return view('home', ['version' => $version->value]); } - public function newVersion(Request $request) { - $version = Setting::where('key', 'version')->first(); + public function newVersion(Request $request) + { + $version = Setting::where('key', 'version')->first(); $version->value = $version->value + 1; $version->save(); return redirect()->route('home'); @@ -30,11 +31,12 @@ class HomeController extends Controller /** * Récupérer les contacts (csv) et les fichiers */ - public function getContacts() { + public function getContacts() + { // generate csv - $csv_file = 'contact.csv'; + $csv_file = 'contact.csv'; $csvExporter = new \Laracsv\Export(); - $contacts = Contacts::all(); + $contacts = Contacts::all(); $csvExporter->beforeEach(function ($contact) { $contact->phone = "$contact->phone"; @@ -49,5 +51,4 @@ class HomeController extends Controller 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/SettingController.php b/app/Http/Controllers/SettingController.php index 30a8148..e3b568f 100644 --- a/app/Http/Controllers/SettingController.php +++ b/app/Http/Controllers/SettingController.php @@ -22,7 +22,7 @@ class SettingController extends Controller /** * Show the form for editing the specified resource. * - * @param \App\Models\Setting $setting + * @param \App\Models\Setting $setting * @return \Illuminate\Http\Response */ public function edit(Setting $setting) @@ -33,15 +33,15 @@ class SettingController extends Controller /** * Update the specified resource in storage. * - * @param \Illuminate\Http\Request $request - * @param \App\Models\Setting $setting + * @param \Illuminate\Http\Request $request + * @param \App\Models\Setting $setting * @return \Illuminate\Http\Response */ public function update(UpdateRequest $request, Setting $setting) { if ($setting->type->equals(SettingTypes::picture())) { - $file = $request->file('value'); - $path = $file->storeAs( + $file = $request->file('value'); + $path = $file->storeAs( 'public/setting_img', $setting->key . ".png" ); diff --git a/app/Http/Controllers/ShowController.php b/app/Http/Controllers/ShowController.php index 56194f8..09db77c 100644 --- a/app/Http/Controllers/ShowController.php +++ b/app/Http/Controllers/ShowController.php @@ -7,18 +7,20 @@ use Illuminate\Http\Request; class ShowController extends Controller { - public function index(Request $request) { + public function index(Request $request) + { $ShowIsActive = Setting::where('key', '=', 'ShowIsActive')->first(); return view('show.index', ['isActive' => $ShowIsActive->value]); } - public function updateStatus(Request $request) { - $status = $request->status; - $d = Setting::where('key', '=', 'ShowIsActive')->first(); + public function updateStatus(Request $request) + { + $status = $request->status; + $d = Setting::where('key', '=', 'ShowIsActive')->first(); $d->value = $status; $d->save(); - $version = Setting::where('key', 'version')->first(); + $version = Setting::where('key', 'version')->first(); $version->value = $version->value + 1; $version->save(); diff --git a/app/Http/Controllers/UsersController.php b/app/Http/Controllers/UsersController.php index 5faee3c..3e12631 100644 --- a/app/Http/Controllers/UsersController.php +++ b/app/Http/Controllers/UsersController.php @@ -5,14 +5,10 @@ namespace App\Http\Controllers; use App\Http\Requests\Users\StoreRequest; use App\Http\Requests\Users\ImportRequest; use App\Http\Requests\Users\UpdateRequest; - use App\Imports\UsersImport; - use App\Models\AppUser; use App\Models\Directories; - use Illuminate\Database\Eloquent\Collection; - use Maatwebsite\Excel\Facades\Excel; class UsersController extends Controller @@ -53,7 +49,7 @@ class UsersController extends Controller /** * Delete an app user - * + * * @param AppUser $app_user * @return response */ @@ -70,25 +66,26 @@ class UsersController extends Controller */ public function import(ImportRequest $request) { - Excel::import(new UsersImport, $request->import, null, \Maatwebsite\Excel\Excel::CSV); + Excel::import(new UsersImport(), $request->import, null, \Maatwebsite\Excel\Excel::CSV); return redirect()->route('app-users.index')->with('status', 'Import terminé.'); } /** * Render folders - * + * * @param Collection $folders * @return array */ private function renderFolders(Collection $folders) { foreach ($folders as $k => $folder) { - $name = ""; + $name = ""; $folders[$k]['parents'] = $folder->parents; - foreach ($folder->parents as $parent) + foreach ($folder->parents as $parent) { $name .= json_decode($parent->name)->fr . " / "; - $name .= json_decode($folder->name)->fr; + } + $name .= json_decode($folder->name)->fr; $folders[$k]['name'] = $name; } return $folders; diff --git a/app/Http/Middleware/Authenticate.php b/app/Http/Middleware/Authenticate.php index 704089a..aeb9d80 100644 --- a/app/Http/Middleware/Authenticate.php +++ b/app/Http/Middleware/Authenticate.php @@ -9,7 +9,7 @@ class Authenticate extends Middleware /** * Get the path the user should be redirected to when they are not authenticated. * - * @param \Illuminate\Http\Request $request + * @param \Illuminate\Http\Request $request * @return string|null */ protected function redirectTo($request) diff --git a/app/Http/Middleware/CheckApiToken.php b/app/Http/Middleware/CheckApiToken.php index c9ab0f7..17cc2f2 100644 --- a/app/Http/Middleware/CheckApiToken.php +++ b/app/Http/Middleware/CheckApiToken.php @@ -9,13 +9,13 @@ class CheckApiToken /** * Handle an incoming request. * - * @param \Illuminate\Http\Request $request - * @param \Closure $next + * @param \Illuminate\Http\Request $request + * @param \Closure $next * @return mixed */ public function handle($request, Closure $next) { - if (isset($request->token) && $request->token == config('auth.API_TOKEN')){ + if (isset($request->token) && $request->token == config('auth.API_TOKEN')) { return $next($request); } return response()->json(['message' => 'Nope'], 401); diff --git a/app/Http/Middleware/CheckForMaintenanceMode.php b/app/Http/Middleware/CheckForMaintenanceMode.php index 35b9824..9037ddf 100644 --- a/app/Http/Middleware/CheckForMaintenanceMode.php +++ b/app/Http/Middleware/CheckForMaintenanceMode.php @@ -12,6 +12,5 @@ class CheckForMaintenanceMode extends Middleware * @var array */ protected $except = [ - // - ]; + ]; } diff --git a/app/Http/Middleware/EncryptCookies.php b/app/Http/Middleware/EncryptCookies.php index 033136a..20c5039 100644 --- a/app/Http/Middleware/EncryptCookies.php +++ b/app/Http/Middleware/EncryptCookies.php @@ -12,6 +12,5 @@ class EncryptCookies extends Middleware * @var array */ protected $except = [ - // - ]; + ]; } diff --git a/app/Http/Middleware/RedirectIfAuthenticated.php b/app/Http/Middleware/RedirectIfAuthenticated.php index 2395ddc..c076008 100644 --- a/app/Http/Middleware/RedirectIfAuthenticated.php +++ b/app/Http/Middleware/RedirectIfAuthenticated.php @@ -11,9 +11,9 @@ class RedirectIfAuthenticated /** * Handle an incoming request. * - * @param \Illuminate\Http\Request $request - * @param \Closure $next - * @param string|null $guard + * @param \Illuminate\Http\Request $request + * @param \Closure $next + * @param string|null $guard * @return mixed */ public function handle($request, Closure $next, $guard = null) diff --git a/app/Http/Middleware/TrustProxies.php b/app/Http/Middleware/TrustProxies.php index d238d9a..7928c69 100644 --- a/app/Http/Middleware/TrustProxies.php +++ b/app/Http/Middleware/TrustProxies.php @@ -17,7 +17,7 @@ class TrustProxies extends Middleware /** * The headers that should be used to detect proxies. * - * @var int + * @var integer */ protected $headers = Request::HEADER_X_FORWARDED_ALL; } diff --git a/app/Http/Middleware/VerifyCsrfToken.php b/app/Http/Middleware/VerifyCsrfToken.php index 16ed36a..8a27664 100644 --- a/app/Http/Middleware/VerifyCsrfToken.php +++ b/app/Http/Middleware/VerifyCsrfToken.php @@ -9,7 +9,7 @@ class VerifyCsrfToken extends Middleware /** * Indicates whether the XSRF-TOKEN cookie should be set on the response. * - * @var bool + * @var boolean */ protected $addHttpCookie = true; diff --git a/app/Http/Requests/Setting/UpdateRequest.php b/app/Http/Requests/Setting/UpdateRequest.php index 2062646..f85d198 100644 --- a/app/Http/Requests/Setting/UpdateRequest.php +++ b/app/Http/Requests/Setting/UpdateRequest.php @@ -11,7 +11,7 @@ class UpdateRequest extends FormRequest /** * Determine if the user is authorized to make this request. * - * @return bool + * @return boolean */ public function authorize() { diff --git a/app/Http/Requests/Users/ImportRequest.php b/app/Http/Requests/Users/ImportRequest.php index 045b2ad..b923877 100644 --- a/app/Http/Requests/Users/ImportRequest.php +++ b/app/Http/Requests/Users/ImportRequest.php @@ -10,7 +10,7 @@ class ImportRequest extends FormRequest /** * Determine if the user is authorized to make this request. * - * @return bool + * @return boolean */ public function authorize() { diff --git a/app/Http/Requests/Users/StoreRequest.php b/app/Http/Requests/Users/StoreRequest.php index d727a21..2bbac05 100644 --- a/app/Http/Requests/Users/StoreRequest.php +++ b/app/Http/Requests/Users/StoreRequest.php @@ -9,7 +9,7 @@ class StoreRequest extends FormRequest /** * Determine if the user is authorized to make this request. * - * @return bool + * @return boolean */ public function authorize() { diff --git a/app/Http/Requests/Users/UpdateRequest.php b/app/Http/Requests/Users/UpdateRequest.php index fd4ca9f..2d58a63 100644 --- a/app/Http/Requests/Users/UpdateRequest.php +++ b/app/Http/Requests/Users/UpdateRequest.php @@ -10,7 +10,7 @@ class UpdateRequest extends FormRequest /** * Determine if the user is authorized to make this request. * - * @return bool + * @return boolean */ public function authorize() { diff --git a/app/Http/Resources/AppUsersCollection.php b/app/Http/Resources/AppUsersCollection.php index c455855..c6dac90 100644 --- a/app/Http/Resources/AppUsersCollection.php +++ b/app/Http/Resources/AppUsersCollection.php @@ -9,7 +9,7 @@ class AppUserCollection extends ResourceCollection /** * Transform the resource collection into an array. * - * @param \Illuminate\Http\Request $request + * @param \Illuminate\Http\Request $request * @return array */ public function toArray($request) diff --git a/app/Http/Resources/ContactsCollection.php b/app/Http/Resources/ContactsCollection.php index f53c9e5..d5102ad 100644 --- a/app/Http/Resources/ContactsCollection.php +++ b/app/Http/Resources/ContactsCollection.php @@ -9,7 +9,7 @@ class ContactsCollection extends ResourceCollection /** * Transform the resource collection into an array. * - * @param \Illuminate\Http\Request $request + * @param \Illuminate\Http\Request $request * @return array */ public function toArray($request) diff --git a/app/Http/Resources/DirectoriesCollection.php b/app/Http/Resources/DirectoriesCollection.php index eaa66be..83b2b31 100644 --- a/app/Http/Resources/DirectoriesCollection.php +++ b/app/Http/Resources/DirectoriesCollection.php @@ -9,7 +9,7 @@ class DirectoriesCollection extends ResourceCollection /** * Transform the resource collection into an array. * - * @param \Illuminate\Http\Request $request + * @param \Illuminate\Http\Request $request * @return array */ public function toArray($request) diff --git a/app/Http/Resources/DocumentsCollection.php b/app/Http/Resources/DocumentsCollection.php index b171739..6647935 100644 --- a/app/Http/Resources/DocumentsCollection.php +++ b/app/Http/Resources/DocumentsCollection.php @@ -9,7 +9,7 @@ class DocumentsCollection extends ResourceCollection /** * Transform the resource collection into an array. * - * @param \Illuminate\Http\Request $request + * @param \Illuminate\Http\Request $request * @return array */ public function toArray($request) diff --git a/app/Imports/UsersImport.php b/app/Imports/UsersImport.php index ca02084..a16791a 100644 --- a/app/Imports/UsersImport.php +++ b/app/Imports/UsersImport.php @@ -29,10 +29,10 @@ class UsersImport implements ToModel, WithUpserts, WithCustomCsvSettings } /** - * @param array $row - * - * @return \Illuminate\Database\Eloquent\Model|null - */ + * @param array $row + * + * @return \Illuminate\Database\Eloquent\Model|null + */ public function model(array $row) { if (!isset($row[0]) || !isset($row[1]) || !isset($row[2]) || !isset($row[3])) { @@ -50,7 +50,7 @@ class UsersImport implements ToModel, WithUpserts, WithCustomCsvSettings ]); if ($user) { - $password = Str::random(10); + $password = Str::random(10); $user->password = Hash::make($password); $user->save(); diff --git a/app/Mail/AccountCreated.php b/app/Mail/AccountCreated.php index b088913..92ae8db 100644 --- a/app/Mail/AccountCreated.php +++ b/app/Mail/AccountCreated.php @@ -9,7 +9,8 @@ use Illuminate\Queue\SerializesModels; class AccountCreated extends Mailable { - use Queueable, SerializesModels; + use Queueable; + use SerializesModels; /** * The app user instance @@ -30,7 +31,7 @@ class AccountCreated extends Mailable */ public function __construct(AppUser $user, string $password) { - $this->user = $user; + $this->user = $user; $this->password = $password; } diff --git a/app/Mail/SendFlyer.php b/app/Mail/SendFlyer.php index 129d0b7..7574e74 100644 --- a/app/Mail/SendFlyer.php +++ b/app/Mail/SendFlyer.php @@ -5,11 +5,11 @@ namespace App\Mail; use Illuminate\Bus\Queueable; use Illuminate\Mail\Mailable; use Illuminate\Queue\SerializesModels; -use Illuminate\Contracts\Queue\ShouldQueue; class SendFlyer extends Mailable { - use Queueable, SerializesModels; + use Queueable; + use SerializesModels; public $data; @@ -20,7 +20,7 @@ class SendFlyer extends Mailable */ public function __construct($data) { - $this->data = (object) $data; + $this->data = (object)$data; } /** diff --git a/app/Mail/SendFlyerFailed.php b/app/Mail/SendFlyerFailed.php index 4f60b90..34bf568 100644 --- a/app/Mail/SendFlyerFailed.php +++ b/app/Mail/SendFlyerFailed.php @@ -3,13 +3,13 @@ namespace App\Mail; use Illuminate\Bus\Queueable; -use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Mail\Mailable; use Illuminate\Queue\SerializesModels; class SendFlyerFailed extends Mailable { - use Queueable, SerializesModels; + use Queueable; + use SerializesModels; private $data; @@ -20,7 +20,7 @@ class SendFlyerFailed extends Mailable */ public function __construct($data) { - $this->data = (object) $data; + $this->data = (object)$data; } /** @@ -31,7 +31,7 @@ class SendFlyerFailed extends Mailable public function build() { return $this - ->from('noreply@ldc.fr', '[APP] '. config('app.name')) + ->from('noreply@ldc.fr', '[APP] ' . config('app.name')) ->subject('[MAIL] Une erreur est survenue') ->view('sendflyerfailed', ['data' => $this->data]); } diff --git a/app/Models/AppUser.php b/app/Models/AppUser.php index 4aff3e4..74d53c3 100644 --- a/app/Models/AppUser.php +++ b/app/Models/AppUser.php @@ -14,7 +14,7 @@ class AppUser extends Model parent::boot(); self::creating(function ($model) { - $model->password = Hash::make($model->password); + $model->password = Hash::make($model->password); $model->authorizedFolders = json_encode([]); }); diff --git a/app/Models/Contacts.php b/app/Models/Contacts.php index ec71a71..1b3756d 100644 --- a/app/Models/Contacts.php +++ b/app/Models/Contacts.php @@ -7,9 +7,11 @@ use Illuminate\Database\Eloquent\Model; class Contacts extends Model { public $incrementing = false; + protected $appends = ['owner_name']; - public function getOwnerNameAttribute() { + public function getOwnerNameAttribute() + { $owner = AppUser::find($this->user_id); return $owner->surname . " " . $owner->firstname; } diff --git a/app/Models/Directories.php b/app/Models/Directories.php index d5b0755..584145b 100644 --- a/app/Models/Directories.php +++ b/app/Models/Directories.php @@ -6,14 +6,16 @@ use Illuminate\Database\Eloquent\Model; class Directories extends Model { - public function getParentsAttribute() { + public function getParentsAttribute() + { return $this->constructParents($this->parent); } - private function constructParents($id, $parents = []) { + private function constructParents($id, $parents = []) + { $tmp = Directories::find($id); array_push($parents, $tmp); - if ($tmp->parent != NULL) { + if ($tmp->parent != null) { return $this->constructParents($tmp->parent, $parents); } return array_reverse($parents); diff --git a/app/Models/Document.php b/app/Models/Document.php index 74fd5cc..5b7c19d 100644 --- a/app/Models/Document.php +++ b/app/Models/Document.php @@ -6,7 +6,6 @@ use Illuminate\Database\Eloquent\Model; class Document extends Model { - public function getOthersLangAttribute() { return Document::where('parent', '=', $this->id)->get(); @@ -21,7 +20,7 @@ class Document extends Model { $tmp = Directories::find($id); array_push($parents, $tmp); - if ($tmp->parent != NULL) { + if ($tmp->parent != null) { return $this->constructParents($tmp->parent, $parents); } return array_reverse($parents); diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index d189437..023d3ba 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -14,7 +14,6 @@ class AppServiceProvider extends ServiceProvider */ public function register() { - // } /** diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php index 723a290..beda950 100644 --- a/app/Providers/EventServiceProvider.php +++ b/app/Providers/EventServiceProvider.php @@ -5,7 +5,6 @@ namespace App\Providers; use Illuminate\Auth\Events\Registered; use Illuminate\Auth\Listeners\SendEmailVerificationNotification; use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; -use Illuminate\Support\Facades\Event; class EventServiceProvider extends ServiceProvider { @@ -28,7 +27,5 @@ class EventServiceProvider extends ServiceProvider public function boot() { parent::boot(); - - // } } diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php index fd86f72..4261192 100644 --- a/app/Providers/RouteServiceProvider.php +++ b/app/Providers/RouteServiceProvider.php @@ -30,7 +30,6 @@ class RouteServiceProvider extends ServiceProvider */ public function boot() { - // parent::boot(); } @@ -45,8 +44,6 @@ class RouteServiceProvider extends ServiceProvider $this->mapApiRoutes(); $this->mapWebRoutes(); - - // } /** diff --git a/app/User.php b/app/User.php index 4b2fe9a..cd94337 100644 --- a/app/User.php +++ b/app/User.php @@ -9,7 +9,8 @@ use Kwaadpepper\Enum\Traits\CastsEnums; class User extends Authenticatable { - use Notifiable, CastsEnums; + use Notifiable; + use CastsEnums; /** * The attributes that are mass assignable. @@ -29,8 +30,6 @@ class User extends Authenticatable 'password', ]; - - protected $enumCasts = [ 'role' => Roles::class ]; diff --git a/composer.json b/composer.json index 0e80713..9010551 100644 --- a/composer.json +++ b/composer.json @@ -19,6 +19,7 @@ "laravel/ui": "^3.0", "maatwebsite/excel": "^3.1", "pion/laravel-chunk-upload": "^1.3", + "slevomat/coding-standard": "^8.5", "usmanhalalit/laracsv": "^2.0" }, "require-dev": { @@ -31,7 +32,10 @@ "config": { "optimize-autoloader": true, "preferred-install": "dist", - "sort-packages": true + "sort-packages": true, + "allow-plugins": { + "dealerdirect/phpcodesniffer-composer-installer": true + } }, "extra": { "laravel": { diff --git a/composer.lock b/composer.lock index 50ed363..3ad3f38 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": "e30b5e02d039c9551c76c1b35dfcd7ee", + "content-hash": "765fcc1c5f3641c6a6219a977bf86736", "packages": [ { "name": "brick/math", @@ -62,6 +62,81 @@ ], "time": "2021-01-20T22:51:39+00:00" }, + { + "name": "dealerdirect/phpcodesniffer-composer-installer", + "version": "v0.7.2", + "source": { + "type": "git", + "url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git", + "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", + "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0 || ^2.0", + "php": ">=5.3", + "squizlabs/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0" + }, + "require-dev": { + "composer/composer": "*", + "php-parallel-lint/php-parallel-lint": "^1.3.1", + "phpcompatibility/php-compatibility": "^9.0" + }, + "type": "composer-plugin", + "extra": { + "class": "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" + }, + "autoload": { + "psr-4": { + "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Franck Nijhof", + "email": "franck.nijhof@dealerdirect.com", + "homepage": "http://www.frenck.nl", + "role": "Developer / IT Manager" + }, + { + "name": "Contributors", + "homepage": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer/graphs/contributors" + } + ], + "description": "PHP_CodeSniffer Standards Composer Installer Plugin", + "homepage": "http://www.dealerdirect.com", + "keywords": [ + "PHPCodeSniffer", + "PHP_CodeSniffer", + "code quality", + "codesniffer", + "composer", + "installer", + "phpcbf", + "phpcs", + "plugin", + "qa", + "quality", + "standard", + "standards", + "style guide", + "stylecheck", + "tests" + ], + "support": { + "issues": "https://github.com/dealerdirect/phpcodesniffer-composer-installer/issues", + "source": "https://github.com/dealerdirect/phpcodesniffer-composer-installer" + }, + "time": "2022-02-04T12:51:07+00:00" + }, { "name": "doctrine/inflector", "version": "2.0.3", @@ -2852,6 +2927,51 @@ ], "time": "2020-07-20T17:29:33+00:00" }, + { + "name": "phpstan/phpdoc-parser", + "version": "1.8.0", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpdoc-parser.git", + "reference": "8dd908dd6156e974b9a0f8bb4cd5ad0707830f04" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/8dd908dd6156e974b9a0f8bb4cd5ad0707830f04", + "reference": "8dd908dd6156e974b9a0f8bb4cd5ad0707830f04", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^1.5", + "phpstan/phpstan-phpunit": "^1.1", + "phpstan/phpstan-strict-rules": "^1.0", + "phpunit/phpunit": "^9.5", + "symfony/process": "^5.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "PHPStan\\PhpDocParser\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "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.8.0" + }, + "time": "2022-09-04T18:59:06+00:00" + }, { "name": "pion/laravel-chunk-upload", "version": "v1.4.1", @@ -3660,6 +3780,123 @@ }, "time": "2021-02-22T15:03:38+00:00" }, + { + "name": "slevomat/coding-standard", + "version": "8.5.2", + "source": { + "type": "git", + "url": "https://github.com/slevomat/coding-standard.git", + "reference": "f32937dc41b587f3500efed1dbca2f82aa519373" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/f32937dc41b587f3500efed1dbca2f82aa519373", + "reference": "f32937dc41b587f3500efed1dbca2f82aa519373", + "shasum": "" + }, + "require": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7", + "php": "^7.2 || ^8.0", + "phpstan/phpdoc-parser": ">=1.7.0 <1.9.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.8.6", + "phpstan/phpstan-deprecation-rules": "1.0.0", + "phpstan/phpstan-phpunit": "1.0.0|1.1.1", + "phpstan/phpstan-strict-rules": "1.4.4", + "phpunit/phpunit": "7.5.20|8.5.21|9.5.25" + }, + "type": "phpcodesniffer-standard", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + } + }, + "autoload": { + "psr-4": { + "SlevomatCodingStandard\\": "SlevomatCodingStandard" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Slevomat Coding Standard for PHP_CodeSniffer complements Consistence Coding Standard by providing sniffs with additional checks.", + "support": { + "issues": "https://github.com/slevomat/coding-standard/issues", + "source": "https://github.com/slevomat/coding-standard/tree/8.5.2" + }, + "funding": [ + { + "url": "https://github.com/kukulich", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/slevomat/coding-standard", + "type": "tidelift" + } + ], + "time": "2022-09-27T16:45:37+00:00" + }, + { + "name": "squizlabs/php_codesniffer", + "version": "3.7.1", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "1359e176e9307e906dc3d890bcc9603ff6d90619" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/1359e176e9307e906dc3d890bcc9603ff6d90619", + "reference": "1359e176e9307e906dc3d890bcc9603ff6d90619", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + }, + "bin": [ + "bin/phpcs", + "bin/phpcbf" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "lead" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", + "keywords": [ + "phpcs", + "standards" + ], + "support": { + "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", + "source": "https://github.com/squizlabs/PHP_CodeSniffer", + "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" + }, + "time": "2022-06-18T07:21:10+00:00" + }, { "name": "swiftmailer/swiftmailer", "version": "v6.2.7", diff --git a/config/app.php b/config/app.php index 39a954c..dfd8123 100644 --- a/config/app.php +++ b/config/app.php @@ -5,53 +5,53 @@ return [ 'BRAND' => env('BRAND'), /* - |-------------------------------------------------------------------------- - | Application Name - |-------------------------------------------------------------------------- - | - | This value is the name of your application. This value is used when the - | framework needs to place the application's name in a notification or - | any other location as required by the application or its packages. - | + |-------------------------------------------------------------------------- + | Application Name + |-------------------------------------------------------------------------- + | + | This value is the name of your application. This value is used when the + | framework needs to place the application's name in a notification or + | any other location as required by the application or its packages. + | */ 'name' => env('APP_NAME', 'Laravel'), /* - |-------------------------------------------------------------------------- - | Application Environment - |-------------------------------------------------------------------------- - | - | This value determines the "environment" your application is currently - | running in. This may determine how you prefer to configure various - | services the application utilizes. Set this in your ".env" file. - | + |-------------------------------------------------------------------------- + | Application Environment + |-------------------------------------------------------------------------- + | + | This value determines the "environment" your application is currently + | running in. This may determine how you prefer to configure various + | services the application utilizes. Set this in your ".env" file. + | */ 'env' => env('APP_ENV', 'production'), /* - |-------------------------------------------------------------------------- - | Application Debug Mode - |-------------------------------------------------------------------------- - | - | When your application is in debug mode, detailed error messages with - | stack traces will be shown on every error that occurs within your - | application. If disabled, a simple generic error page is shown. - | + |-------------------------------------------------------------------------- + | Application Debug Mode + |-------------------------------------------------------------------------- + | + | When your application is in debug mode, detailed error messages with + | stack traces will be shown on every error that occurs within your + | application. If disabled, a simple generic error page is shown. + | */ 'debug' => env('APP_DEBUG', false), /* - |-------------------------------------------------------------------------- - | Application URL - |-------------------------------------------------------------------------- - | - | This URL is used by the console to properly generate URLs when using - | the Artisan command line tool. You should set this to the root of - | your application so that it is used when running Artisan tasks. - | + |-------------------------------------------------------------------------- + | Application URL + |-------------------------------------------------------------------------- + | + | This URL is used by the console to properly generate URLs when using + | the Artisan command line tool. You should set this to the root of + | your application so that it is used when running Artisan tasks. + | */ 'url' => env('APP_URL', 'http://localhost'), @@ -59,66 +59,66 @@ return [ 'asset_url' => env('ASSET_URL', null), /* - |-------------------------------------------------------------------------- - | Application Timezone - |-------------------------------------------------------------------------- - | - | Here you may specify the default timezone for your application, which - | will be used by the PHP date and date-time functions. We have gone - | ahead and set this to a sensible default for you out of the box. - | + |-------------------------------------------------------------------------- + | Application Timezone + |-------------------------------------------------------------------------- + | + | Here you may specify the default timezone for your application, which + | will be used by the PHP date and date-time functions. We have gone + | ahead and set this to a sensible default for you out of the box. + | */ 'timezone' => 'Europe/Paris', /* - |-------------------------------------------------------------------------- - | Application Locale Configuration - |-------------------------------------------------------------------------- - | - | The application locale determines the default locale that will be used - | by the translation service provider. You are free to set this value - | to any of the locales which will be supported by the application. - | + |-------------------------------------------------------------------------- + | Application Locale Configuration + |-------------------------------------------------------------------------- + | + | The application locale determines the default locale that will be used + | by the translation service provider. You are free to set this value + | to any of the locales which will be supported by the application. + | */ 'locale' => 'fr', /* - |-------------------------------------------------------------------------- - | Application Fallback Locale - |-------------------------------------------------------------------------- - | - | The fallback locale determines the locale to use when the current one - | is not available. You may change the value to correspond to any of - | the language folders that are provided through your application. - | + |-------------------------------------------------------------------------- + | Application Fallback Locale + |-------------------------------------------------------------------------- + | + | The fallback locale determines the locale to use when the current one + | is not available. You may change the value to correspond to any of + | the language folders that are provided through your application. + | */ 'fallback_locale' => 'en', /* - |-------------------------------------------------------------------------- - | Faker Locale - |-------------------------------------------------------------------------- - | - | This locale will be used by the Faker PHP library when generating fake - | data for your database seeds. For example, this will be used to get - | localized telephone numbers, street address information and more. - | + |-------------------------------------------------------------------------- + | Faker Locale + |-------------------------------------------------------------------------- + | + | This locale will be used by the Faker PHP library when generating fake + | data for your database seeds. For example, this will be used to get + | localized telephone numbers, street address information and more. + | */ 'faker_locale' => 'en_US', /* - |-------------------------------------------------------------------------- - | Encryption Key - |-------------------------------------------------------------------------- - | - | This key is used by the Illuminate encrypter service and should be set - | to a random, 32 character string, otherwise these encrypted strings - | will not be safe. Please do this before deploying an application! - | + |-------------------------------------------------------------------------- + | Encryption Key + |-------------------------------------------------------------------------- + | + | This key is used by the Illuminate encrypter service and should be set + | to a random, 32 character string, otherwise these encrypted strings + | will not be safe. Please do this before deploying an application! + | */ 'key' => env('APP_KEY'), @@ -126,14 +126,14 @@ return [ 'cipher' => 'AES-256-CBC', /* - |-------------------------------------------------------------------------- - | Autoloaded Service Providers - |-------------------------------------------------------------------------- - | - | The service providers listed here will be automatically loaded on the - | request to your application. Feel free to add your own services to - | this array to grant expanded functionality to your applications. - | + |-------------------------------------------------------------------------- + | Autoloaded Service Providers + |-------------------------------------------------------------------------- + | + | The service providers listed here will be automatically loaded on the + | request to your application. Feel free to add your own services to + | this array to grant expanded functionality to your applications. + | */ 'providers' => [ @@ -181,14 +181,14 @@ return [ ], /* - |-------------------------------------------------------------------------- - | Class Aliases - |-------------------------------------------------------------------------- - | - | This array of class aliases will be registered when this application - | is started. However, feel free to register as many as you wish as - | the aliases are "lazy" loaded so they don't hinder performance. - | + |-------------------------------------------------------------------------- + | Class Aliases + |-------------------------------------------------------------------------- + | + | This array of class aliases will be registered when this application + | is started. However, feel free to register as many as you wish as + | the aliases are "lazy" loaded so they don't hinder performance. + | */ 'aliases' => [ diff --git a/config/auth.php b/config/auth.php index 2ae556a..450dd3c 100644 --- a/config/auth.php +++ b/config/auth.php @@ -3,14 +3,14 @@ return [ /* - |-------------------------------------------------------------------------- - | Authentication Defaults - |-------------------------------------------------------------------------- - | - | This option controls the default authentication "guard" and password - | reset options for your application. You may change these defaults - | as required, but they're a perfect start for most applications. - | + |-------------------------------------------------------------------------- + | Authentication Defaults + |-------------------------------------------------------------------------- + | + | This option controls the default authentication "guard" and password + | reset options for your application. You may change these defaults + | as required, but they're a perfect start for most applications. + | */ 'API_TOKEN' => env('API_TOKEN'), @@ -21,20 +21,20 @@ return [ ], /* - |-------------------------------------------------------------------------- - | Authentication Guards - |-------------------------------------------------------------------------- - | - | Next, you may define every authentication guard for your application. - | Of course, a great default configuration has been defined for you - | here which uses session storage and the Eloquent user provider. - | - | All authentication drivers have a user provider. This defines how the - | users are actually retrieved out of your database or other storage - | mechanisms used by this application to persist your user's data. - | - | Supported: "session", "token" - | + |-------------------------------------------------------------------------- + | Authentication Guards + |-------------------------------------------------------------------------- + | + | Next, you may define every authentication guard for your application. + | Of course, a great default configuration has been defined for you + | here which uses session storage and the Eloquent user provider. + | + | All authentication drivers have a user provider. This defines how the + | users are actually retrieved out of your database or other storage + | mechanisms used by this application to persist your user's data. + | + | Supported: "session", "token" + | */ 'guards' => [ @@ -51,20 +51,20 @@ return [ ], /* - |-------------------------------------------------------------------------- - | User Providers - |-------------------------------------------------------------------------- - | - | All authentication drivers have a user provider. This defines how the - | users are actually retrieved out of your database or other storage - | mechanisms used by this application to persist your user's data. - | - | If you have multiple user tables or models you may configure multiple - | sources which represent each model / table. These sources may then - | be assigned to any extra authentication guards you have defined. - | - | Supported: "database", "eloquent" - | + |-------------------------------------------------------------------------- + | User Providers + |-------------------------------------------------------------------------- + | + | All authentication drivers have a user provider. This defines how the + | users are actually retrieved out of your database or other storage + | mechanisms used by this application to persist your user's data. + | + | If you have multiple user tables or models you may configure multiple + | sources which represent each model / table. These sources may then + | be assigned to any extra authentication guards you have defined. + | + | Supported: "database", "eloquent" + | */ 'providers' => [ @@ -74,24 +74,24 @@ return [ ], // 'users' => [ - // 'driver' => 'database', - // 'table' => 'users', + // 'driver' => 'database', + // 'table' => 'users', // ], ], /* - |-------------------------------------------------------------------------- - | Resetting Passwords - |-------------------------------------------------------------------------- - | - | You may specify multiple password reset configurations if you have more - | than one user table or model in the application and you want to have - | separate password reset settings based on the specific user types. - | - | The expire time is the number of minutes that the reset token should be - | considered valid. This security feature keeps tokens short-lived so - | they have less time to be guessed. You may change this as needed. - | + |-------------------------------------------------------------------------- + | Resetting Passwords + |-------------------------------------------------------------------------- + | + | You may specify multiple password reset configurations if you have more + | than one user table or model in the application and you want to have + | separate password reset settings based on the specific user types. + | + | The expire time is the number of minutes that the reset token should be + | considered valid. This security feature keeps tokens short-lived so + | they have less time to be guessed. You may change this as needed. + | */ 'passwords' => [ @@ -104,14 +104,14 @@ return [ ], /* - |-------------------------------------------------------------------------- - | Password Confirmation Timeout - |-------------------------------------------------------------------------- - | - | Here you may define the amount of seconds before a password confirmation - | times out and the user is prompted to re-enter their password via the - | confirmation screen. By default, the timeout lasts for three hours. - | + |-------------------------------------------------------------------------- + | Password Confirmation Timeout + |-------------------------------------------------------------------------- + | + | Here you may define the amount of seconds before a password confirmation + | times out and the user is prompted to re-enter their password via the + | confirmation screen. By default, the timeout lasts for three hours. + | */ 'password_timeout' => 10800, diff --git a/config/broadcasting.php b/config/broadcasting.php index 3bba110..758e391 100644 --- a/config/broadcasting.php +++ b/config/broadcasting.php @@ -3,29 +3,29 @@ return [ /* - |-------------------------------------------------------------------------- - | Default Broadcaster - |-------------------------------------------------------------------------- - | - | This option controls the default broadcaster that will be used by the - | framework when an event needs to be broadcast. You may set this to - | any of the connections defined in the "connections" array below. - | - | Supported: "pusher", "redis", "log", "null" - | + |-------------------------------------------------------------------------- + | Default Broadcaster + |-------------------------------------------------------------------------- + | + | This option controls the default broadcaster that will be used by the + | framework when an event needs to be broadcast. You may set this to + | any of the connections defined in the "connections" array below. + | + | Supported: "pusher", "redis", "log", "null" + | */ 'default' => env('BROADCAST_DRIVER', 'null'), /* - |-------------------------------------------------------------------------- - | Broadcast Connections - |-------------------------------------------------------------------------- - | - | Here you may define all of the broadcast connections that will be used - | to broadcast events to other systems or over websockets. Samples of - | each available type of connection are provided inside this array. - | + |-------------------------------------------------------------------------- + | Broadcast Connections + |-------------------------------------------------------------------------- + | + | Here you may define all of the broadcast connections that will be used + | to broadcast events to other systems or over websockets. Samples of + | each available type of connection are provided inside this array. + | */ 'connections' => [ diff --git a/config/cache.php b/config/cache.php index 46751e6..f765d26 100644 --- a/config/cache.php +++ b/config/cache.php @@ -5,30 +5,30 @@ use Illuminate\Support\Str; return [ /* - |-------------------------------------------------------------------------- - | Default Cache Store - |-------------------------------------------------------------------------- - | - | This option controls the default cache connection that gets used while - | using this caching library. This connection is used when another is - | not explicitly specified when executing a given caching function. - | - | Supported: "apc", "array", "database", "file", - | "memcached", "redis", "dynamodb" - | + |-------------------------------------------------------------------------- + | Default Cache Store + |-------------------------------------------------------------------------- + | + | This option controls the default cache connection that gets used while + | using this caching library. This connection is used when another is + | not explicitly specified when executing a given caching function. + | + | Supported: "apc", "array", "database", "file", + | "memcached", "redis", "dynamodb" + | */ 'default' => env('CACHE_DRIVER', 'file'), /* - |-------------------------------------------------------------------------- - | Cache Stores - |-------------------------------------------------------------------------- - | - | Here you may define all of the cache "stores" for your application as - | well as their drivers. You may even define multiple stores for the - | same cache driver to group types of items stored in your caches. - | + |-------------------------------------------------------------------------- + | Cache Stores + |-------------------------------------------------------------------------- + | + | Here you may define all of the cache "stores" for your application as + | well as their drivers. You may even define multiple stores for the + | same cache driver to group types of items stored in your caches. + | */ 'stores' => [ @@ -88,16 +88,16 @@ return [ ], /* - |-------------------------------------------------------------------------- - | Cache Key Prefix - |-------------------------------------------------------------------------- - | - | When utilizing a RAM based store such as APC or Memcached, there might - | be other applications utilizing the same cache. So, we'll specify a - | value to get prefixed to all our keys so we can avoid collisions. - | + |-------------------------------------------------------------------------- + | Cache Key Prefix + |-------------------------------------------------------------------------- + | + | When utilizing a RAM based store such as APC or Memcached, there might + | be other applications utilizing the same cache. So, we'll specify a + | value to get prefixed to all our keys so we can avoid collisions. + | */ - 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache'), + 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_') . '_cache'), ]; diff --git a/config/database.php b/config/database.php index b42d9b3..ac4559f 100644 --- a/config/database.php +++ b/config/database.php @@ -5,32 +5,32 @@ use Illuminate\Support\Str; return [ /* - |-------------------------------------------------------------------------- - | Default Database Connection Name - |-------------------------------------------------------------------------- - | - | Here you may specify which of the database connections below you wish - | to use as your default connection for all database work. Of course - | you may use many connections at once using the Database library. - | + |-------------------------------------------------------------------------- + | Default Database Connection Name + |-------------------------------------------------------------------------- + | + | Here you may specify which of the database connections below you wish + | to use as your default connection for all database work. Of course + | you may use many connections at once using the Database library. + | */ 'default' => env('DB_CONNECTION', 'mysql'), /* - |-------------------------------------------------------------------------- - | Database Connections - |-------------------------------------------------------------------------- - | - | Here are each of the database connections setup for your application. - | Of course, examples of configuring each database platform that is - | supported by Laravel is shown below to make development simple. - | - | - | All database work in Laravel is done through the PHP PDO facilities - | so make sure you have the driver for your particular database of - | choice installed on your machine before you begin development. - | + |-------------------------------------------------------------------------- + | Database Connections + |-------------------------------------------------------------------------- + | + | Here are each of the database connections setup for your application. + | Of course, examples of configuring each database platform that is + | supported by Laravel is shown below to make development simple. + | + | + | All database work in Laravel is done through the PHP PDO facilities + | so make sure you have the driver for your particular database of + | choice installed on your machine before you begin development. + | */ 'connections' => [ @@ -94,27 +94,27 @@ return [ ], /* - |-------------------------------------------------------------------------- - | Migration Repository Table - |-------------------------------------------------------------------------- - | - | This table keeps track of all the migrations that have already run for - | your application. Using this information, we can determine which of - | the migrations on disk haven't actually been run in the database. - | + |-------------------------------------------------------------------------- + | Migration Repository Table + |-------------------------------------------------------------------------- + | + | This table keeps track of all the migrations that have already run for + | your application. Using this information, we can determine which of + | the migrations on disk haven't actually been run in the database. + | */ 'migrations' => 'migrations', /* - |-------------------------------------------------------------------------- - | Redis Databases - |-------------------------------------------------------------------------- - | - | Redis is an open source, fast, and advanced key-value store that also - | provides a richer body of commands than a typical key-value system - | such as APC or Memcached. Laravel makes it easy to dig right in. - | + |-------------------------------------------------------------------------- + | Redis Databases + |-------------------------------------------------------------------------- + | + | Redis is an open source, fast, and advanced key-value store that also + | provides a richer body of commands than a typical key-value system + | such as APC or Memcached. Laravel makes it easy to dig right in. + | */ 'redis' => [ @@ -123,7 +123,7 @@ return [ 'options' => [ 'cluster' => env('REDIS_CLUSTER', 'redis'), - 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'), + 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_') . '_database_'), ], 'default' => [ diff --git a/config/excel.php b/config/excel.php index c3199b9..80c0593 100644 --- a/config/excel.php +++ b/config/excel.php @@ -6,40 +6,40 @@ return [ 'exports' => [ /* - |-------------------------------------------------------------------------- - | Chunk size - |-------------------------------------------------------------------------- - | - | When using FromQuery, the query is automatically chunked. - | Here you can specify how big the chunk should be. - | + |-------------------------------------------------------------------------- + | Chunk size + |-------------------------------------------------------------------------- + | + | When using FromQuery, the query is automatically chunked. + | Here you can specify how big the chunk should be. + | */ 'chunk_size' => 1000, /* - |-------------------------------------------------------------------------- - | Pre-calculate formulas during export - |-------------------------------------------------------------------------- + |-------------------------------------------------------------------------- + | Pre-calculate formulas during export + |-------------------------------------------------------------------------- */ 'pre_calculate_formulas' => false, /* - |-------------------------------------------------------------------------- - | Enable strict null comparison - |-------------------------------------------------------------------------- - | - | When enabling strict null comparison empty cells ('') will - | be added to the sheet. + |-------------------------------------------------------------------------- + | Enable strict null comparison + |-------------------------------------------------------------------------- + | + | When enabling strict null comparison empty cells ('') will + | be added to the sheet. */ 'strict_null_comparison' => false, /* - |-------------------------------------------------------------------------- - | CSV Settings - |-------------------------------------------------------------------------- - | - | Configure e.g. delimiter, enclosure and line ending for CSV exports. - | + |-------------------------------------------------------------------------- + | CSV Settings + |-------------------------------------------------------------------------- + | + | Configure e.g. delimiter, enclosure and line ending for CSV exports. + | */ 'csv' => [ 'delimiter' => ',', @@ -51,12 +51,12 @@ return [ ], /* - |-------------------------------------------------------------------------- - | Worksheet properties - |-------------------------------------------------------------------------- - | - | Configure e.g. default title, creator, subject,... - | + |-------------------------------------------------------------------------- + | Worksheet properties + |-------------------------------------------------------------------------- + | + | Configure e.g. default title, creator, subject,... + | */ 'properties' => [ 'creator' => '', @@ -74,51 +74,51 @@ return [ 'imports' => [ /* - |-------------------------------------------------------------------------- - | Read Only - |-------------------------------------------------------------------------- - | - | When dealing with imports, you might only be interested in the - | data that the sheet exists. By default we ignore all styles, - | however if you want to do some logic based on style data - | you can enable it by setting read_only to false. - | + |-------------------------------------------------------------------------- + | Read Only + |-------------------------------------------------------------------------- + | + | When dealing with imports, you might only be interested in the + | data that the sheet exists. By default we ignore all styles, + | however if you want to do some logic based on style data + | you can enable it by setting read_only to false. + | */ 'read_only' => true, /* - |-------------------------------------------------------------------------- - | Ignore Empty - |-------------------------------------------------------------------------- - | - | When dealing with imports, you might be interested in ignoring - | rows that have null values or empty strings. By default rows - | containing empty strings or empty values are not ignored but can be - | ignored by enabling the setting ignore_empty to true. - | + |-------------------------------------------------------------------------- + | Ignore Empty + |-------------------------------------------------------------------------- + | + | When dealing with imports, you might be interested in ignoring + | rows that have null values or empty strings. By default rows + | containing empty strings or empty values are not ignored but can be + | ignored by enabling the setting ignore_empty to true. + | */ 'ignore_empty' => false, /* - |-------------------------------------------------------------------------- - | Heading Row Formatter - |-------------------------------------------------------------------------- - | - | Configure the heading row formatter. - | Available options: none|slug|custom - | + |-------------------------------------------------------------------------- + | Heading Row Formatter + |-------------------------------------------------------------------------- + | + | Configure the heading row formatter. + | Available options: none|slug|custom + | */ 'heading_row' => [ 'formatter' => 'slug', ], /* - |-------------------------------------------------------------------------- - | CSV Settings - |-------------------------------------------------------------------------- - | - | Configure e.g. delimiter, enclosure and line ending for CSV imports. - | + |-------------------------------------------------------------------------- + | CSV Settings + |-------------------------------------------------------------------------- + | + | Configure e.g. delimiter, enclosure and line ending for CSV imports. + | */ 'csv' => [ 'delimiter' => ',', @@ -129,12 +129,12 @@ return [ ], /* - |-------------------------------------------------------------------------- - | Worksheet properties - |-------------------------------------------------------------------------- - | - | Configure e.g. default title, creator, subject,... - | + |-------------------------------------------------------------------------- + | Worksheet properties + |-------------------------------------------------------------------------- + | + | Configure e.g. default title, creator, subject,... + | */ 'properties' => [ 'creator' => '', @@ -151,13 +151,13 @@ return [ ], /* - |-------------------------------------------------------------------------- - | Extension detector - |-------------------------------------------------------------------------- - | - | Configure here which writer/reader type should be used when the package - | needs to guess the correct type based on the extension alone. - | + |-------------------------------------------------------------------------- + | Extension detector + |-------------------------------------------------------------------------- + | + | Configure here which writer/reader type should be used when the package + | needs to guess the correct type based on the extension alone. + | */ 'extension_detector' => [ 'xlsx' => Excel::XLSX, @@ -177,33 +177,33 @@ return [ 'tsv' => Excel::TSV, /* - |-------------------------------------------------------------------------- - | PDF Extension - |-------------------------------------------------------------------------- - | - | Configure here which Pdf driver should be used by default. - | Available options: Excel::MPDF | Excel::TCPDF | Excel::DOMPDF - | + |-------------------------------------------------------------------------- + | PDF Extension + |-------------------------------------------------------------------------- + | + | Configure here which Pdf driver should be used by default. + | Available options: Excel::MPDF | Excel::TCPDF | Excel::DOMPDF + | */ 'pdf' => Excel::DOMPDF, ], /* - |-------------------------------------------------------------------------- - | Value Binder - |-------------------------------------------------------------------------- - | - | PhpSpreadsheet offers a way to hook into the process of a value being - | written to a cell. In there some assumptions are made on how the - | value should be formatted. If you want to change those defaults, - | you can implement your own default value binder. - | - | Possible value binders: - | - | [x] Maatwebsite\Excel\DefaultValueBinder::class - | [x] PhpOffice\PhpSpreadsheet\Cell\StringValueBinder::class - | [x] PhpOffice\PhpSpreadsheet\Cell\AdvancedValueBinder::class - | + |-------------------------------------------------------------------------- + | Value Binder + |-------------------------------------------------------------------------- + | + | PhpSpreadsheet offers a way to hook into the process of a value being + | written to a cell. In there some assumptions are made on how the + | value should be formatted. If you want to change those defaults, + | you can implement your own default value binder. + | + | Possible value binders: + | + | [x] Maatwebsite\Excel\DefaultValueBinder::class + | [x] PhpOffice\PhpSpreadsheet\Cell\StringValueBinder::class + | [x] PhpOffice\PhpSpreadsheet\Cell\AdvancedValueBinder::class + | */ 'value_binder' => [ 'default' => Maatwebsite\Excel\DefaultValueBinder::class, @@ -211,48 +211,48 @@ return [ 'cache' => [ /* - |-------------------------------------------------------------------------- - | Default cell caching driver - |-------------------------------------------------------------------------- - | - | By default PhpSpreadsheet keeps all cell values in memory, however when - | dealing with large files, this might result into memory issues. If you - | want to mitigate that, you can configure a cell caching driver here. - | When using the illuminate driver, it will store each value in a the - | cache store. This can slow down the process, because it needs to - | store each value. You can use the "batch" store if you want to - | only persist to the store when the memory limit is reached. - | - | Drivers: memory|illuminate|batch - | + |-------------------------------------------------------------------------- + | Default cell caching driver + |-------------------------------------------------------------------------- + | + | By default PhpSpreadsheet keeps all cell values in memory, however when + | dealing with large files, this might result into memory issues. If you + | want to mitigate that, you can configure a cell caching driver here. + | When using the illuminate driver, it will store each value in a the + | cache store. This can slow down the process, because it needs to + | store each value. You can use the "batch" store if you want to + | only persist to the store when the memory limit is reached. + | + | Drivers: memory|illuminate|batch + | */ 'driver' => 'memory', /* - |-------------------------------------------------------------------------- - | Batch memory caching - |-------------------------------------------------------------------------- - | - | When dealing with the "batch" caching driver, it will only - | persist to the store when the memory limit is reached. - | Here you can tweak the memory limit to your liking. - | + |-------------------------------------------------------------------------- + | Batch memory caching + |-------------------------------------------------------------------------- + | + | When dealing with the "batch" caching driver, it will only + | persist to the store when the memory limit is reached. + | Here you can tweak the memory limit to your liking. + | */ 'batch' => [ 'memory_limit' => 60000, ], /* - |-------------------------------------------------------------------------- - | Illuminate cache - |-------------------------------------------------------------------------- - | - | When using the "illuminate" caching driver, it will automatically use - | your default cache store. However if you prefer to have the cell - | cache on a separate store, you can configure the store name here. - | You can use any store defined in your cache config. When leaving - | at "null" it will use the default store. - | + |-------------------------------------------------------------------------- + | Illuminate cache + |-------------------------------------------------------------------------- + | + | When using the "illuminate" caching driver, it will automatically use + | your default cache store. However if you prefer to have the cell + | cache on a separate store, you can configure the store name here. + | You can use any store defined in your cache config. When leaving + | at "null" it will use the default store. + | */ 'illuminate' => [ 'store' => null, @@ -260,19 +260,19 @@ return [ ], /* - |-------------------------------------------------------------------------- - | Transaction Handler - |-------------------------------------------------------------------------- - | - | By default the import is wrapped in a transaction. This is useful - | for when an import may fail and you want to retry it. With the - | transactions, the previous import gets rolled-back. - | - | You can disable the transaction handler by setting this to null. - | Or you can choose a custom made transaction handler here. - | - | Supported handlers: null|db - | + |-------------------------------------------------------------------------- + | Transaction Handler + |-------------------------------------------------------------------------- + | + | By default the import is wrapped in a transaction. This is useful + | for when an import may fail and you want to retry it. With the + | transactions, the previous import gets rolled-back. + | + | You can disable the transaction handler by setting this to null. + | Or you can choose a custom made transaction handler here. + | + | Supported handlers: null|db + | */ 'transactions' => [ 'handler' => 'db', @@ -281,47 +281,47 @@ return [ 'temporary_files' => [ /* - |-------------------------------------------------------------------------- - | Local Temporary Path - |-------------------------------------------------------------------------- - | - | When exporting and importing files, we use a temporary file, before - | storing reading or downloading. Here you can customize that path. - | + |-------------------------------------------------------------------------- + | Local Temporary Path + |-------------------------------------------------------------------------- + | + | When exporting and importing files, we use a temporary file, before + | storing reading or downloading. Here you can customize that path. + | */ 'local_path' => storage_path('framework/laravel-excel'), /* - |-------------------------------------------------------------------------- - | Remote Temporary Disk - |-------------------------------------------------------------------------- - | - | When dealing with a multi server setup with queues in which you - | cannot rely on having a shared local temporary path, you might - | want to store the temporary file on a shared disk. During the - | queue executing, we'll retrieve the temporary file from that - | location instead. When left to null, it will always use - | the local path. This setting only has effect when using - | in conjunction with queued imports and exports. - | + |-------------------------------------------------------------------------- + | Remote Temporary Disk + |-------------------------------------------------------------------------- + | + | When dealing with a multi server setup with queues in which you + | cannot rely on having a shared local temporary path, you might + | want to store the temporary file on a shared disk. During the + | queue executing, we'll retrieve the temporary file from that + | location instead. When left to null, it will always use + | the local path. This setting only has effect when using + | in conjunction with queued imports and exports. + | */ 'remote_disk' => null, 'remote_prefix' => null, /* - |-------------------------------------------------------------------------- - | Force Resync - |-------------------------------------------------------------------------- - | - | When dealing with a multi server setup as above, it's possible - | for the clean up that occurs after entire queue has been run to only - | cleanup the server that the last AfterImportJob runs on. The rest of the server - | would still have the local temporary file stored on it. In this case your - | local storage limits can be exceeded and future imports won't be processed. - | To mitigate this you can set this config value to be true, so that after every - | queued chunk is processed the local temporary file is deleted on the server that - | processed it. - | + |-------------------------------------------------------------------------- + | Force Resync + |-------------------------------------------------------------------------- + | + | When dealing with a multi server setup as above, it's possible + | for the clean up that occurs after entire queue has been run to only + | cleanup the server that the last AfterImportJob runs on. The rest of the server + | would still have the local temporary file stored on it. In this case your + | local storage limits can be exceeded and future imports won't be processed. + | To mitigate this you can set this config value to be true, so that after every + | queued chunk is processed the local temporary file is deleted on the server that + | processed it. + | */ 'force_resync_remote' => null, ], diff --git a/config/filesystems.php b/config/filesystems.php index ec6a7ce..3cc4d09 100644 --- a/config/filesystems.php +++ b/config/filesystems.php @@ -3,42 +3,42 @@ return [ /* - |-------------------------------------------------------------------------- - | Default Filesystem Disk - |-------------------------------------------------------------------------- - | - | Here you may specify the default filesystem disk that should be used - | by the framework. The "local" disk, as well as a variety of cloud - | based disks are available to your application. Just store away! - | + |-------------------------------------------------------------------------- + | Default Filesystem Disk + |-------------------------------------------------------------------------- + | + | Here you may specify the default filesystem disk that should be used + | by the framework. The "local" disk, as well as a variety of cloud + | based disks are available to your application. Just store away! + | */ 'default' => env('FILESYSTEM_DRIVER', 'local'), /* - |-------------------------------------------------------------------------- - | Default Cloud Filesystem Disk - |-------------------------------------------------------------------------- - | - | Many applications store files both locally and in the cloud. For this - | reason, you may specify a default "cloud" driver here. This driver - | will be bound as the Cloud disk implementation in the container. - | + |-------------------------------------------------------------------------- + | Default Cloud Filesystem Disk + |-------------------------------------------------------------------------- + | + | Many applications store files both locally and in the cloud. For this + | reason, you may specify a default "cloud" driver here. This driver + | will be bound as the Cloud disk implementation in the container. + | */ 'cloud' => env('FILESYSTEM_CLOUD', 's3'), /* - |-------------------------------------------------------------------------- - | Filesystem Disks - |-------------------------------------------------------------------------- - | - | Here you may configure as many filesystem "disks" as you wish, and you - | may even configure multiple disks of the same driver. Defaults have - | been setup for each driver as an example of the required options. - | - | Supported Drivers: "local", "ftp", "sftp", "s3" - | + |-------------------------------------------------------------------------- + | Filesystem Disks + |-------------------------------------------------------------------------- + | + | Here you may configure as many filesystem "disks" as you wish, and you + | may even configure multiple disks of the same driver. Defaults have + | been setup for each driver as an example of the required options. + | + | Supported Drivers: "local", "ftp", "sftp", "s3" + | */ 'disks' => [ @@ -51,7 +51,7 @@ return [ 'public' => [ 'driver' => 'local', 'root' => storage_path('app/public'), - 'url' => env('APP_URL').'/storage', + 'url' => env('APP_URL') . '/storage', 'visibility' => 'public', ], diff --git a/config/hashing.php b/config/hashing.php index 8425770..6641c8c 100644 --- a/config/hashing.php +++ b/config/hashing.php @@ -3,29 +3,29 @@ return [ /* - |-------------------------------------------------------------------------- - | Default Hash Driver - |-------------------------------------------------------------------------- - | - | This option controls the default hash driver that will be used to hash - | passwords for your application. By default, the bcrypt algorithm is - | used; however, you remain free to modify this option if you wish. - | - | Supported: "bcrypt", "argon", "argon2id" - | + |-------------------------------------------------------------------------- + | Default Hash Driver + |-------------------------------------------------------------------------- + | + | This option controls the default hash driver that will be used to hash + | passwords for your application. By default, the bcrypt algorithm is + | used; however, you remain free to modify this option if you wish. + | + | Supported: "bcrypt", "argon", "argon2id" + | */ 'driver' => 'bcrypt', /* - |-------------------------------------------------------------------------- - | Bcrypt Options - |-------------------------------------------------------------------------- - | - | Here you may specify the configuration options that should be used when - | passwords are hashed using the Bcrypt algorithm. This will allow you - | to control the amount of time it takes to hash the given password. - | + |-------------------------------------------------------------------------- + | Bcrypt Options + |-------------------------------------------------------------------------- + | + | Here you may specify the configuration options that should be used when + | passwords are hashed using the Bcrypt algorithm. This will allow you + | to control the amount of time it takes to hash the given password. + | */ 'bcrypt' => [ @@ -33,14 +33,14 @@ return [ ], /* - |-------------------------------------------------------------------------- - | Argon Options - |-------------------------------------------------------------------------- - | - | Here you may specify the configuration options that should be used when - | passwords are hashed using the Argon algorithm. These will allow you - | to control the amount of time it takes to hash the given password. - | + |-------------------------------------------------------------------------- + | Argon Options + |-------------------------------------------------------------------------- + | + | Here you may specify the configuration options that should be used when + | passwords are hashed using the Argon algorithm. These will allow you + | to control the amount of time it takes to hash the given password. + | */ 'argon' => [ diff --git a/config/logging.php b/config/logging.php index 088c204..a2ba2cf 100644 --- a/config/logging.php +++ b/config/logging.php @@ -7,31 +7,31 @@ use Monolog\Handler\SyslogUdpHandler; return [ /* - |-------------------------------------------------------------------------- - | Default Log Channel - |-------------------------------------------------------------------------- - | - | This option defines the default log channel that gets used when writing - | messages to the logs. The name specified in this option should match - | one of the channels defined in the "channels" configuration array. - | + |-------------------------------------------------------------------------- + | Default Log Channel + |-------------------------------------------------------------------------- + | + | This option defines the default log channel that gets used when writing + | messages to the logs. The name specified in this option should match + | one of the channels defined in the "channels" configuration array. + | */ 'default' => env('LOG_CHANNEL', 'stack'), /* - |-------------------------------------------------------------------------- - | Log Channels - |-------------------------------------------------------------------------- - | - | Here you may configure the log channels for your application. Out of - | the box, Laravel uses the Monolog PHP logging library. This gives - | you a variety of powerful log handlers / formatters to utilize. - | - | Available Drivers: "single", "daily", "slack", "syslog", - | "errorlog", "monolog", - | "custom", "stack" - | + |-------------------------------------------------------------------------- + | Log Channels + |-------------------------------------------------------------------------- + | + | Here you may configure the log channels for your application. Out of + | the box, Laravel uses the Monolog PHP logging library. This gives + | you a variety of powerful log handlers / formatters to utilize. + | + | Available Drivers: "single", "daily", "slack", "syslog", + | "errorlog", "monolog", + | "custom", "stack" + | */ 'channels' => [ diff --git a/config/mail.php b/config/mail.php index 3c65eb3..635bb51 100644 --- a/config/mail.php +++ b/config/mail.php @@ -3,56 +3,56 @@ return [ /* - |-------------------------------------------------------------------------- - | Mail Driver - |-------------------------------------------------------------------------- - | - | Laravel supports both SMTP and PHP's "mail" function as drivers for the - | sending of e-mail. You may specify which one you're using throughout - | your application here. By default, Laravel is setup for SMTP mail. - | - | Supported: "smtp", "sendmail", "mailgun", "ses", - | "postmark", "log", "array" - | + |-------------------------------------------------------------------------- + | Mail Driver + |-------------------------------------------------------------------------- + | + | Laravel supports both SMTP and PHP's "mail" function as drivers for the + | sending of e-mail. You may specify which one you're using throughout + | your application here. By default, Laravel is setup for SMTP mail. + | + | Supported: "smtp", "sendmail", "mailgun", "ses", + | "postmark", "log", "array" + | */ 'driver' => env('MAIL_DRIVER', 'smtp'), /* - |-------------------------------------------------------------------------- - | SMTP Host Address - |-------------------------------------------------------------------------- - | - | Here you may provide the host address of the SMTP server used by your - | applications. A default option is provided that is compatible with - | the Mailgun mail service which will provide reliable deliveries. - | + |-------------------------------------------------------------------------- + | SMTP Host Address + |-------------------------------------------------------------------------- + | + | Here you may provide the host address of the SMTP server used by your + | applications. A default option is provided that is compatible with + | the Mailgun mail service which will provide reliable deliveries. + | */ 'host' => env('MAIL_HOST', 'smtp.mailgun.org'), /* - |-------------------------------------------------------------------------- - | SMTP Host Port - |-------------------------------------------------------------------------- - | - | This is the SMTP port used by your application to deliver e-mails to - | users of the application. Like the host we have set this value to - | stay compatible with the Mailgun e-mail application by default. - | + |-------------------------------------------------------------------------- + | SMTP Host Port + |-------------------------------------------------------------------------- + | + | This is the SMTP port used by your application to deliver e-mails to + | users of the application. Like the host we have set this value to + | stay compatible with the Mailgun e-mail application by default. + | */ 'port' => env('MAIL_PORT', 587), /* - |-------------------------------------------------------------------------- - | Global "From" Address - |-------------------------------------------------------------------------- - | - | You may wish for all e-mails sent by your application to be sent from - | the same address. Here, you may specify a name and address that is - | used globally for all e-mails that are sent by your application. - | + |-------------------------------------------------------------------------- + | Global "From" Address + |-------------------------------------------------------------------------- + | + | You may wish for all e-mails sent by your application to be sent from + | the same address. Here, you may specify a name and address that is + | used globally for all e-mails that are sent by your application. + | */ 'from' => [ @@ -61,27 +61,27 @@ return [ ], /* - |-------------------------------------------------------------------------- - | E-Mail Encryption Protocol - |-------------------------------------------------------------------------- - | - | Here you may specify the encryption protocol that should be used when - | the application send e-mail messages. A sensible default using the - | transport layer security protocol should provide great security. - | + |-------------------------------------------------------------------------- + | E-Mail Encryption Protocol + |-------------------------------------------------------------------------- + | + | Here you may specify the encryption protocol that should be used when + | the application send e-mail messages. A sensible default using the + | transport layer security protocol should provide great security. + | */ 'encryption' => env('MAIL_ENCRYPTION', 'tls'), /* - |-------------------------------------------------------------------------- - | SMTP Server Username - |-------------------------------------------------------------------------- - | - | If your SMTP server requires a username for authentication, you should - | set it here. This will get used to authenticate with your server on - | connection. You may also set the "password" value below this one. - | + |-------------------------------------------------------------------------- + | SMTP Server Username + |-------------------------------------------------------------------------- + | + | If your SMTP server requires a username for authentication, you should + | set it here. This will get used to authenticate with your server on + | connection. You may also set the "password" value below this one. + | */ 'username' => env('MAIL_USERNAME'), @@ -89,27 +89,27 @@ return [ 'password' => env('MAIL_PASSWORD'), /* - |-------------------------------------------------------------------------- - | Sendmail System Path - |-------------------------------------------------------------------------- - | - | When using the "sendmail" driver to send e-mails, we will need to know - | the path to where Sendmail lives on this server. A default path has - | been provided here, which will work well on most of your systems. - | + |-------------------------------------------------------------------------- + | Sendmail System Path + |-------------------------------------------------------------------------- + | + | When using the "sendmail" driver to send e-mails, we will need to know + | the path to where Sendmail lives on this server. A default path has + | been provided here, which will work well on most of your systems. + | */ 'sendmail' => '/usr/sbin/sendmail -bs', /* - |-------------------------------------------------------------------------- - | Markdown Mail Settings - |-------------------------------------------------------------------------- - | - | If you are using Markdown based email rendering, you may configure your - | theme and component paths here, allowing you to customize the design - | of the emails. Or, you may simply stick with the Laravel defaults! - | + |-------------------------------------------------------------------------- + | Markdown Mail Settings + |-------------------------------------------------------------------------- + | + | If you are using Markdown based email rendering, you may configure your + | theme and component paths here, allowing you to customize the design + | of the emails. Or, you may simply stick with the Laravel defaults! + | */ 'markdown' => [ @@ -121,14 +121,14 @@ return [ ], /* - |-------------------------------------------------------------------------- - | Log Channel - |-------------------------------------------------------------------------- - | - | If you are using the "log" driver, you may specify the logging channel - | if you prefer to keep mail messages separate from other log entries - | for simpler reading. Otherwise, the default channel will be used. - | + |-------------------------------------------------------------------------- + | Log Channel + |-------------------------------------------------------------------------- + | + | If you are using the "log" driver, you may specify the logging channel + | if you prefer to keep mail messages separate from other log entries + | for simpler reading. Otherwise, the default channel will be used. + | */ 'log_channel' => env('MAIL_LOG_CHANNEL'), diff --git a/config/queue.php b/config/queue.php index 3a30d6c..f00417e 100644 --- a/config/queue.php +++ b/config/queue.php @@ -3,29 +3,29 @@ return [ /* - |-------------------------------------------------------------------------- - | Default Queue Connection Name - |-------------------------------------------------------------------------- - | - | Laravel's queue API supports an assortment of back-ends via a single - | API, giving you convenient access to each back-end using the same - | syntax for every one. Here you may define a default connection. - | + |-------------------------------------------------------------------------- + | Default Queue Connection Name + |-------------------------------------------------------------------------- + | + | Laravel's queue API supports an assortment of back-ends via a single + | API, giving you convenient access to each back-end using the same + | syntax for every one. Here you may define a default connection. + | */ 'default' => env('QUEUE_CONNECTION', 'sync'), /* - |-------------------------------------------------------------------------- - | Queue Connections - |-------------------------------------------------------------------------- - | - | Here you may configure the connection information for each server that - | is used by your application. A default configuration has been added - | for each back-end shipped with Laravel. You are free to add more. - | - | Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null" - | + |-------------------------------------------------------------------------- + | Queue Connections + |-------------------------------------------------------------------------- + | + | Here you may configure the connection information for each server that + | is used by your application. A default configuration has been added + | for each back-end shipped with Laravel. You are free to add more. + | + | Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null" + | */ 'connections' => [ @@ -69,14 +69,14 @@ return [ ], /* - |-------------------------------------------------------------------------- - | Failed Queue Jobs - |-------------------------------------------------------------------------- - | - | These options configure the behavior of failed queue job logging so you - | can control which database and table are used to store the jobs that - | have failed. You may change them to any database / table you wish. - | + |-------------------------------------------------------------------------- + | Failed Queue Jobs + |-------------------------------------------------------------------------- + | + | These options configure the behavior of failed queue job logging so you + | can control which database and table are used to store the jobs that + | have failed. You may change them to any database / table you wish. + | */ 'failed' => [ diff --git a/config/services.php b/config/services.php index 2a1d616..915dfe7 100644 --- a/config/services.php +++ b/config/services.php @@ -3,15 +3,15 @@ return [ /* - |-------------------------------------------------------------------------- - | Third Party Services - |-------------------------------------------------------------------------- - | - | This file is for storing the credentials for third party services such - | as Mailgun, Postmark, AWS and more. This file provides the de facto - | location for this type of information, allowing packages to have - | a conventional file to locate the various service credentials. - | + |-------------------------------------------------------------------------- + | Third Party Services + |-------------------------------------------------------------------------- + | + | This file is for storing the credentials for third party services such + | as Mailgun, Postmark, AWS and more. This file provides the de facto + | location for this type of information, allowing packages to have + | a conventional file to locate the various service credentials. + | */ 'mailgun' => [ diff --git a/config/session.php b/config/session.php index 3e9082d..6ba32e7 100644 --- a/config/session.php +++ b/config/session.php @@ -5,30 +5,30 @@ use Illuminate\Support\Str; return [ /* - |-------------------------------------------------------------------------- - | Default Session Driver - |-------------------------------------------------------------------------- - | - | This option controls the default session "driver" that will be used on - | requests. By default, we will use the lightweight native driver but - | you may specify any of the other wonderful drivers provided here. - | - | Supported: "file", "cookie", "database", "apc", - | "memcached", "redis", "dynamodb", "array" - | + |-------------------------------------------------------------------------- + | Default Session Driver + |-------------------------------------------------------------------------- + | + | This option controls the default session "driver" that will be used on + | requests. By default, we will use the lightweight native driver but + | you may specify any of the other wonderful drivers provided here. + | + | Supported: "file", "cookie", "database", "apc", + | "memcached", "redis", "dynamodb", "array" + | */ 'driver' => env('SESSION_DRIVER', 'file'), /* - |-------------------------------------------------------------------------- - | Session Lifetime - |-------------------------------------------------------------------------- - | - | Here you may specify the number of minutes that you wish the session - | to be allowed to remain idle before it expires. If you want them - | to immediately expire on the browser closing, set that option. - | + |-------------------------------------------------------------------------- + | Session Lifetime + |-------------------------------------------------------------------------- + | + | Here you may specify the number of minutes that you wish the session + | to be allowed to remain idle before it expires. If you want them + | to immediately expire on the browser closing, set that option. + | */ 'lifetime' => env('SESSION_LIFETIME', 120), @@ -36,162 +36,162 @@ return [ 'expire_on_close' => false, /* - |-------------------------------------------------------------------------- - | Session Encryption - |-------------------------------------------------------------------------- - | - | This option allows you to easily specify that all of your session data - | should be encrypted before it is stored. All encryption will be run - | automatically by Laravel and you can use the Session like normal. - | + |-------------------------------------------------------------------------- + | Session Encryption + |-------------------------------------------------------------------------- + | + | This option allows you to easily specify that all of your session data + | should be encrypted before it is stored. All encryption will be run + | automatically by Laravel and you can use the Session like normal. + | */ 'encrypt' => false, /* - |-------------------------------------------------------------------------- - | Session File Location - |-------------------------------------------------------------------------- - | - | When using the native session driver, we need a location where session - | files may be stored. A default has been set for you but a different - | location may be specified. This is only needed for file sessions. - | + |-------------------------------------------------------------------------- + | Session File Location + |-------------------------------------------------------------------------- + | + | When using the native session driver, we need a location where session + | files may be stored. A default has been set for you but a different + | location may be specified. This is only needed for file sessions. + | */ 'files' => storage_path('framework/sessions'), /* - |-------------------------------------------------------------------------- - | Session Database Connection - |-------------------------------------------------------------------------- - | - | When using the "database" or "redis" session drivers, you may specify a - | connection that should be used to manage these sessions. This should - | correspond to a connection in your database configuration options. - | + |-------------------------------------------------------------------------- + | Session Database Connection + |-------------------------------------------------------------------------- + | + | When using the "database" or "redis" session drivers, you may specify a + | connection that should be used to manage these sessions. This should + | correspond to a connection in your database configuration options. + | */ 'connection' => env('SESSION_CONNECTION', null), /* - |-------------------------------------------------------------------------- - | Session Database Table - |-------------------------------------------------------------------------- - | - | When using the "database" session driver, you may specify the table we - | should use to manage the sessions. Of course, a sensible default is - | provided for you; however, you are free to change this as needed. - | + |-------------------------------------------------------------------------- + | Session Database Table + |-------------------------------------------------------------------------- + | + | When using the "database" session driver, you may specify the table we + | should use to manage the sessions. Of course, a sensible default is + | provided for you; however, you are free to change this as needed. + | */ 'table' => 'sessions', /* - |-------------------------------------------------------------------------- - | Session Cache Store - |-------------------------------------------------------------------------- - | - | When using the "apc", "memcached", or "dynamodb" session drivers you may - | list a cache store that should be used for these sessions. This value - | must match with one of the application's configured cache "stores". - | + |-------------------------------------------------------------------------- + | Session Cache Store + |-------------------------------------------------------------------------- + | + | When using the "apc", "memcached", or "dynamodb" session drivers you may + | list a cache store that should be used for these sessions. This value + | must match with one of the application's configured cache "stores". + | */ 'store' => env('SESSION_STORE', null), /* - |-------------------------------------------------------------------------- - | Session Sweeping Lottery - |-------------------------------------------------------------------------- - | - | Some session drivers must manually sweep their storage location to get - | rid of old sessions from storage. Here are the chances that it will - | happen on a given request. By default, the odds are 2 out of 100. - | + |-------------------------------------------------------------------------- + | Session Sweeping Lottery + |-------------------------------------------------------------------------- + | + | Some session drivers must manually sweep their storage location to get + | rid of old sessions from storage. Here are the chances that it will + | happen on a given request. By default, the odds are 2 out of 100. + | */ 'lottery' => [2, 100], /* - |-------------------------------------------------------------------------- - | Session Cookie Name - |-------------------------------------------------------------------------- - | - | Here you may change the name of the cookie used to identify a session - | instance by ID. The name specified here will get used every time a - | new session cookie is created by the framework for every driver. - | + |-------------------------------------------------------------------------- + | Session Cookie Name + |-------------------------------------------------------------------------- + | + | Here you may change the name of the cookie used to identify a session + | instance by ID. The name specified here will get used every time a + | new session cookie is created by the framework for every driver. + | */ 'cookie' => env( 'SESSION_COOKIE', - Str::slug(env('APP_NAME', 'laravel'), '_').'_session' + Str::slug(env('APP_NAME', 'laravel'), '_') . '_session' ), /* - |-------------------------------------------------------------------------- - | Session Cookie Path - |-------------------------------------------------------------------------- - | - | The session cookie path determines the path for which the cookie will - | be regarded as available. Typically, this will be the root path of - | your application but you are free to change this when necessary. - | + |-------------------------------------------------------------------------- + | Session Cookie Path + |-------------------------------------------------------------------------- + | + | The session cookie path determines the path for which the cookie will + | be regarded as available. Typically, this will be the root path of + | your application but you are free to change this when necessary. + | */ 'path' => '/', /* - |-------------------------------------------------------------------------- - | Session Cookie Domain - |-------------------------------------------------------------------------- - | - | Here you may change the domain of the cookie used to identify a session - | in your application. This will determine which domains the cookie is - | available to in your application. A sensible default has been set. - | + |-------------------------------------------------------------------------- + | Session Cookie Domain + |-------------------------------------------------------------------------- + | + | Here you may change the domain of the cookie used to identify a session + | in your application. This will determine which domains the cookie is + | available to in your application. A sensible default has been set. + | */ 'domain' => env('SESSION_DOMAIN', null), /* - |-------------------------------------------------------------------------- - | HTTPS Only Cookies - |-------------------------------------------------------------------------- - | - | By setting this option to true, session cookies will only be sent back - | to the server if the browser has a HTTPS connection. This will keep - | the cookie from being sent to you if it can not be done securely. - | + |-------------------------------------------------------------------------- + | HTTPS Only Cookies + |-------------------------------------------------------------------------- + | + | By setting this option to true, session cookies will only be sent back + | to the server if the browser has a HTTPS connection. This will keep + | the cookie from being sent to you if it can not be done securely. + | */ 'secure' => env('SESSION_SECURE_COOKIE', null), /* - |-------------------------------------------------------------------------- - | HTTP Access Only - |-------------------------------------------------------------------------- - | - | Setting this value to true will prevent JavaScript from accessing the - | value of the cookie and the cookie will only be accessible through - | the HTTP protocol. You are free to modify this option if needed. - | + |-------------------------------------------------------------------------- + | HTTP Access Only + |-------------------------------------------------------------------------- + | + | Setting this value to true will prevent JavaScript from accessing the + | value of the cookie and the cookie will only be accessible through + | the HTTP protocol. You are free to modify this option if needed. + | */ 'http_only' => true, /* - |-------------------------------------------------------------------------- - | Same-Site Cookies - |-------------------------------------------------------------------------- - | - | This option determines how your cookies behave when cross-site requests - | take place, and can be used to mitigate CSRF attacks. By default, we - | do not enable this as other CSRF protection services are in place. - | - | Supported: "lax", "strict", "none" - | + |-------------------------------------------------------------------------- + | Same-Site Cookies + |-------------------------------------------------------------------------- + | + | This option determines how your cookies behave when cross-site requests + | take place, and can be used to mitigate CSRF attacks. By default, we + | do not enable this as other CSRF protection services are in place. + | + | Supported: "lax", "strict", "none" + | */ 'same_site' => null, diff --git a/config/view.php b/config/view.php index 22b8a18..53008fd 100644 --- a/config/view.php +++ b/config/view.php @@ -3,14 +3,14 @@ return [ /* - |-------------------------------------------------------------------------- - | View Storage Paths - |-------------------------------------------------------------------------- - | - | Most templating systems load templates from disk. Here you may specify - | an array of paths that should be checked for your views. Of course - | the usual Laravel view path has already been registered for you. - | + |-------------------------------------------------------------------------- + | View Storage Paths + |-------------------------------------------------------------------------- + | + | Most templating systems load templates from disk. Here you may specify + | an array of paths that should be checked for your views. Of course + | the usual Laravel view path has already been registered for you. + | */ 'paths' => [ @@ -18,14 +18,14 @@ return [ ], /* - |-------------------------------------------------------------------------- - | Compiled View Path - |-------------------------------------------------------------------------- - | - | This option determines where all the compiled Blade templates will be - | stored for your application. Typically, this is within the storage - | directory. However, as usual, you are free to change this value. - | + |-------------------------------------------------------------------------- + | Compiled View Path + |-------------------------------------------------------------------------- + | + | This option determines where all the compiled Blade templates will be + | stored for your application. Typically, this is within the storage + | directory. However, as usual, you are free to change this value. + | */ 'compiled' => env( diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php index 24f412f..c90ff1d 100644 --- a/database/factories/UserFactory.php +++ b/database/factories/UserFactory.php @@ -9,14 +9,14 @@ use Faker\Generator as Faker; use Illuminate\Support\Str; /* -|-------------------------------------------------------------------------- -| Model Factories -|-------------------------------------------------------------------------- -| -| This directory should contain each of the model factory definitions for -| your application. Factories provide a convenient way to generate new -| model instances for testing / seeding your application's database. -| + |-------------------------------------------------------------------------- + | Model Factories + |-------------------------------------------------------------------------- + | + | This directory should contain each of the model factory definitions for + | your application. Factories provide a convenient way to generate new + | model instances for testing / seeding your application's database. + | */ $factory->define(User::class, function (Faker $faker) { @@ -24,7 +24,8 @@ $factory->define(User::class, function (Faker $faker) { 'name' => $faker->name, 'email' => $faker->unique()->safeEmail, 'email_verified_at' => now(), - 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password + 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', +// password 'remember_token' => Str::random(10), ]; }); diff --git a/routes/api.php b/routes/api.php index e28b1c5..278f934 100644 --- a/routes/api.php +++ b/routes/api.php @@ -3,14 +3,14 @@ use App\Http\Controllers\API\SyncController; /* -|-------------------------------------------------------------------------- -| API Routes -|-------------------------------------------------------------------------- -| -| Here is where you can register API routes for your application. These -| routes are loaded by the RouteServiceProvider within a group which -| is assigned the "api" middleware group. Enjoy building your API! -| + |-------------------------------------------------------------------------- + | API Routes + |-------------------------------------------------------------------------- + | + | Here is where you can register API routes for your application. These + | routes are loaded by the RouteServiceProvider within a group which + | is assigned the "api" middleware group. Enjoy building your API! + | */ Route::group(['middleware' => 'api.token'], function () { @@ -22,4 +22,17 @@ Route::group(['middleware' => 'api.token'], function () { Route::post('sendBrochure', [SyncController::class, 'SendFlyer']); }); -//Route::get('extractText', 'API\SyncController@processOCR'); +Route::group(['middleware' => 'api.token'], function () { + Route::prefix('v2')->group( + function () { + Route::get('users', [SyncController::class, 'getUsers']); + Route::post('contacts', [SyncController::class, 'getContacts']); + Route::get('directories', [SyncController::class, 'getDirectories']); + Route::get('documents', [SyncController::class, 'getDocuments']); + Route::get('version', [SyncController::class, 'getVersion']); + Route::post('sendBrochure', [SyncController::class, 'SendFlyer']); + } + ); +}); + +// Route::get('extractText', 'API\SyncController@processOCR'); diff --git a/routes/channels.php b/routes/channels.php index f16a20b..1e36a53 100644 --- a/routes/channels.php +++ b/routes/channels.php @@ -1,16 +1,16 @@ id === (int) $id; + return (int)$user->id === (int)$id; }); diff --git a/routes/console.php b/routes/console.php index 75dd0cd..23c267d 100644 --- a/routes/console.php +++ b/routes/console.php @@ -3,14 +3,14 @@ use Illuminate\Foundation\Inspiring; /* -|-------------------------------------------------------------------------- -| Console Routes -|-------------------------------------------------------------------------- -| -| This file is where you may define all of your Closure based console -| commands. Each Closure is bound to a command instance allowing a -| simple approach to interacting with each command's IO methods. -| + |-------------------------------------------------------------------------- + | Console Routes + |-------------------------------------------------------------------------- + | + | This file is where you may define all of your Closure based console + | commands. Each Closure is bound to a command instance allowing a + | simple approach to interacting with each command's IO methods. + | */ Artisan::command('inspire', function () { diff --git a/routes/web.php b/routes/web.php index 6733bc3..30aca1b 100644 --- a/routes/web.php +++ b/routes/web.php @@ -14,30 +14,30 @@ Route::get('/docs/{uuid}/download', [DocumentsController::class, 'download']) ->middleware('signed'); Route::middleware('auth')->group(function () { - /* HOME */ + // HOME Route::get('/', [HomeController::class, 'index'])->name('home'); - /* EXPORT CONTACT */ + // EXPORT CONTACT Route::get('/export-contact', [HomeController::class, 'getContacts']); - /* VERSION */ + // VERSION Route::post('/new-version', [HomeController::class, 'newVersion']); - /* FOLDERS */ + // FOLDERS Route::get('/folders', [FoldersController::class, 'index']); Route::post('/save-folder-order', [FoldersController::class, 'saveOrder']); Route::post('/save-folder-name', [FoldersController::class, 'saveName']); Route::post('/add-folder', [FoldersController::class, 'add']); Route::post('/delete-folder', [FoldersController::class, 'delete']); Route::post('/folders/toggle-authorization', [FoldersController::class, 'toggleAuthorization']); - /* DOCUMENTS */ + // DOCUMENTS Route::post('/documents/upload', [DocumentsController::class, 'upload'])->name('documents.upload'); Route::resource('documents', DocumentsController::class)->except(['show']); - /* USERS */ + // USERS Route::post('/app-users/import', [UsersController::class, 'import'])->name('app-users.import'); Route::resource('app-users', UsersController::class)->except(['show']); - /* SHOW */ + // SHOW Route::get('/show', [ShowController::class, 'index'])->name('show.index'); Route::post('/show/updateStatus', [ShowController::class, 'updateStatus']); Route::middleware('can:is-admin')->group(function () { Route::resource('setting', SettingController::class)->except(['create', 'store', 'show', 'destroy']); }); -}); \ No newline at end of file +}); diff --git a/tests/CreatesApplication.php b/tests/CreatesApplication.php index 547152f..ab92402 100644 --- a/tests/CreatesApplication.php +++ b/tests/CreatesApplication.php @@ -13,7 +13,7 @@ trait CreatesApplication */ public function createApplication() { - $app = require __DIR__.'/../bootstrap/app.php'; + $app = require __DIR__ . '/../bootstrap/app.php'; $app->make(Kernel::class)->bootstrap(); diff --git a/tests/Feature/ExampleTest.php b/tests/Feature/ExampleTest.php index cdb5111..8fbf370 100644 --- a/tests/Feature/ExampleTest.php +++ b/tests/Feature/ExampleTest.php @@ -2,7 +2,6 @@ namespace Tests\Feature; -use Illuminate\Foundation\Testing\RefreshDatabase; use Tests\TestCase; class ExampleTest extends TestCase