Merge branch 'develop' into trunk

This commit is contained in:
Vincent BRIDIER 2023-01-05 09:04:49 +01:00
commit 46846bbbb8
No known key found for this signature in database
GPG key ID: 8571BFA20420D512
146 changed files with 15948 additions and 10855 deletions

View file

@ -28,6 +28,6 @@ MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS=null
MAIL_FROM_NAME="${APP_NAME}"
MAIL_LIST_SERVICEWEB=
STATIC_FOLDERS="1"
BRAND="TEST"

3
.gitignore vendored
View file

@ -1,6 +1,5 @@
/node_modules
/public/hot
/public/storage
/public
/storage/*.key
/storage/framework/laravel-excel/*
/vendor

49
.vscode/launch.json vendored Normal file
View file

@ -0,0 +1,49 @@
{
// Utilisez IntelliSense pour en savoir plus sur les attributs possibles.
// Pointez pour afficher la description des attributs existants.
// Pour plus d'informations, visitez : https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Listen for Xdebug",
"type": "php",
"request": "launch",
"hostname": "xdebug-com-app-bo.s-web.test",
"port": 9003
},
{
"name": "Launch currently open script",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 0,
"runtimeArgs": [
"-dxdebug.start_with_request=yes"
],
"env": {
"XDEBUG_MODE": "debug,develop",
"XDEBUG_CONFIG": "client_port=${port}"
}
},
{
"name": "Launch Built-in web server",
"type": "php",
"request": "launch",
"runtimeArgs": [
"-dxdebug.mode=debug",
"-dxdebug.start_with_request=yes",
"-S",
"localhost:0"
],
"program": "",
"cwd": "${workspaceRoot}",
"port": 9003,
"serverReadyAction": {
"pattern": "Development Server \\(http://localhost:([0-9]+)\\) started",
"uriFormat": "http://localhost:%s",
"action": "openExternally"
}
}
]
}

4
CHANGELOG.md Normal file
View file

@ -0,0 +1,4 @@
# V2.0
- Ajout de la possibilité de supprimer un utilisateur
- Ajout de la possibilité de modifier toute l'arborescence des dossiers
- Ajout d'une configuration de l'application via le BO

19
README.md Normal file
View file

@ -0,0 +1,19 @@
# BO Application Commerciaux
## Installation
```
php artisan storage:link
cp .env.example .env
php artisan key:generate
```
- éditer le .env
```
php artisan migrate --seed
```
## Création d'un user BO
```
php artisan user:create
```
# TODO
- Nettoyer tous les controllers
- Utiliser requests + validate
- Enlever l'utilisation de VueJS si pas nécessaire. (ex: EditUserComponent)

View file

@ -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();

View file

@ -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');
}

30
app/Enums/Roles.php Normal file
View file

@ -0,0 +1,30 @@
<?php
namespace App\Enums;
use Kwaadpepper\Enum\BaseEnumRoutable;
/**
* This defines a data type.
*
* @method static self admin() admin role
* @method static self user() user role
*/
final class Roles extends BaseEnumRoutable
{
protected static function values(): array
{
return [
'admin' => 1,
'user' => 2,
];
}
protected static function labels(): array
{
return [
'admin' => 'Administrateur',
'user' => 'Utilisateur',
];
}
}

View file

@ -0,0 +1,33 @@
<?php
namespace App\Enums;
use Kwaadpepper\Enum\BaseEnumRoutable;
/**
* This defines a data type.
*
* @method static self string() string type
* @method static self numeric() numeric type
* @method static self picture() picture type
*/
final class SettingTypes extends BaseEnumRoutable
{
protected static function values(): array
{
return [
'string' => 1,
'numeric' => 2,
'picture' => 3,
];
}
protected static function labels(): array
{
return [
'string' => 'String (Hexa)',
'numeric' => 'Numeric',
'picture' => 'Picture',
];
}
}

View file

@ -2,10 +2,7 @@
namespace App\Exceptions;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Illuminate\Support\Facades\Mail;
use RuntimeException;
use Throwable;
use Kwaadpepper\ExceptionHandler\Exceptions\ExceptionHandler;
class Handler extends ExceptionHandler
{
@ -14,9 +11,7 @@ class Handler extends ExceptionHandler
*
* @var array
*/
protected $dontReport = [
//
];
protected $dontReport = [];
/**
* A list of the inputs that are never flashed for validation exceptions.
@ -27,63 +22,4 @@ class Handler extends ExceptionHandler
'password',
'password_confirmation',
];
/**
* Register the exception handling callbacks for the application.
*
* @return void
*/
public function register()
{
$this->reportable(function (Throwable $e) {
try {
if (!config('app.debug')) {
if ($this->shouldntReport($e)) {
return false;
}
Mail::send([
'html' => 'emails.exception',
'text' => 'emails.exception-plain'
], [
'exception' => $e,
'appName' => config('app.name')
], function ($m) {
$m->to(
config('mail.contactsList.serviceweb'),
sprintf('%s Exception Handler', config('app.name'))
)->subject('Need help !, an error occured in your application, please check Logs ASAP');
});
}
} finally {
return true;
}
});
}
/**
* Report or log an exception.
*
* @param \Throwable $exception
* @return void
*
* @throws \Throwable
*/
public function report(Throwable $exception)
{
parent::report($exception);
}
/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Throwable $exception
* @return \Symfony\Component\HttpFoundation\Response
*
* @throws \Throwable
*/
public function render($request, Throwable $exception)
{
return parent::render($request, $exception);
}
}

View file

@ -0,0 +1,27 @@
<?php
namespace App\Http\Controllers\API;
use App\Http\Controllers\Controller;
use App\Http\Resources\ApiResponseResource;
use App\Models\Directories;
use App\Models\Setting;
class AppController extends Controller
{
/**
* get App Config
* @return ApiResponseResource
*/
public function get()
{
$response = [];
$settings = Setting::orWhere('key', 'Button1')->orWhere('key', 'Button2')->orWhere('key', 'Button3')->get();
foreach ($settings as $setting) {
$response['folders'][$setting->key] = Directories::find($setting->value)->only('id', 'name');
}
return new ApiResponseResource("OK", $response);
}
}

View file

@ -0,0 +1,28 @@
<?php
namespace App\Http\Controllers\API;
use App\Enums\SettingTypes;
use App\Http\Controllers\Controller;
use App\Models\Setting;
use App\Http\Resources\ApiResponseResource;
class SettingsController extends Controller
{
/**
* get Settings
*
* @return \Illuminate\Http\JsonResponse
*/
public function get()
{
$response = [];
$settings = Setting::all();
foreach ($settings as $setting) {
$response[$setting->key] = SettingTypes::numeric()->equals($setting->type)
? \intval($setting->value)
: $setting->value;
}
return new ApiResponseResource("OK", $response);
}
}

View file

@ -4,9 +4,9 @@ namespace App\Http\Controllers\API;
use App\Http\Controllers\Controller;
use App\Mail\SendFlyerFailed;
use App\Models\AppUsers;
use App\Models\AppUser;
use App\Models\Contacts;
use App\Models\Data;
use App\Models\Setting;
use GuzzleHttp\Exception\ClientException;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Mail;
@ -17,41 +17,46 @@ use Google\Cloud\Vision\V1\ImageAnnotatorClient;
class SyncController extends Controller
{
public function getUsers(Request $request) {
return new \App\Http\Resources\AppUsersCollection(\App\Models\AppUsers::where('activated', 1)->get());
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) {
return new \App\Http\Resources\DocumentsCollection(\App\Models\Documents::where('published', 1)->get());
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 = Data::select('value AS version')->where('key', 'version')->first();
$ShowIsActive = Data::select('value AS ShowIsActive')->where('key', 'ShowIsActive')->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,63 +69,66 @@ class SyncController extends Controller
return ['version' => $version->version, 'ShowIsActive' => $ShowIsActive->ShowIsActive, 'newApp' => $newApp];
}
public function SendFlyer(Request $request) {
$emails = json_decode($request->emails);
foreach ($emails as $datas) {
$email = $datas->email;
$subject = $datas->subject;
$message = $datas->message;
$user_id = $datas->user_id;
$docs = json_decode($datas->documents);
public function SendFlyer(Request $request)
{
$datas = json_decode($request->emails);
$user = AppUsers::find($user_id);
$email = $datas->email;
$subject = $datas->subject;
$message = $datas->message;
$user_id = $datas->user_id;
$docs = json_decode($datas->documents);
$attach = [];
$filesName = [];
$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]
));
array_push($filesName, $doc->title);
} else {
array_push($noExists, $doc->title);
}
}
$user = AppUser::find($user_id);
if (count($noExists) === 0) {
$message = new SendFlyer([
'body' => $message,
'from' => $user->email,
'fromName' => $user->surname . ' ' . $user->firstname,
'subject' => '['. config('app.BRAND') .'] - '. $subject,
'attach' => $attach,
'filesName' => $filesName,
]);
Mail::to($email)
->cc($user->email)
->queue($message);
$attach = [];
$filesName = [];
$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]
));
array_push($filesName, $doc->title);
} else {
$message = new SendFlyerFailed([
'email' => $email,
'message' => $message,
'subject' => $subject,
'filesName' => $filesName,
'noExists' => $noExists
]);
Mail::to($user->email)
->queue($message);
array_push($noExists, $doc->title);
}
}
if (count($noExists) === 0) {
$message = new SendFlyer([
'body' => $message,
'from' => $user->email,
'fromName' => $user->surname . ' ' . $user->firstname,
'subject' => '[' . config('app.BRAND') . '] - ' . $subject,
'attach' => $attach,
'filesName' => $filesName,
]);
Mail::to($email)
->cc($user->email)
->queue($message);
} else {
$message = new SendFlyerFailed([
'email' => $email,
'message' => $message,
'subject' => $subject,
'filesName' => $filesName,
'noExists' => $noExists
]);
Mail::to($user->email)
->queue($message);
}//end if
return 'OK';
}
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 +153,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() . "<br>";
}
}
}

View file

@ -0,0 +1,44 @@
<?php
namespace App\Http\Controllers;
use App\Http\Requests\App\SubmitRequest;
use App\Models\Directories;
use App\Models\Setting;
class AppController extends Controller
{
/**
* Index
*
* @return \Illuminate\Contracts\View\View
*/
public function index()
{
$button_1 = Setting::where('key', 'Button1')->first()->only('value');
$button_2 = Setting::where('key', 'Button2')->first()->only('value');
$button_3 = Setting::where('key', 'Button3')->first()->only('value');
return view('app.index', [
'directories' => Directories::where('parent', \null)->where('id', '<>', 1)->orderBy('order', 'ASC')->get(),
'button_1' => \intval($button_1['value']),
'button_2' => \intval($button_2['value']),
'button_3' => \intval($button_3['value'])
]);
}
/**
* Submit
*
* @param \App\Http\Requests\App\SubmitRequest $request
* @return redirect
*/
public function submit(SubmitRequest $request)
{
Setting::where('key', 'Button1')->update(['value' => $request->button_1]);
Setting::where('key', 'Button2')->update(['value' => $request->button_2]);
Setting::where('key', 'Button3')->update(['value' => $request->button_3]);
return redirect()->route('app.index')->with('status', __("Configuration sauvegardée."));
}
}

View file

@ -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;
/**

View file

@ -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;
}

View file

@ -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;
/**

View file

@ -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)

View file

@ -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;
/**

View file

@ -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;
/**

View file

@ -9,5 +9,7 @@ use Illuminate\Routing\Controller as BaseController;
class Controller extends BaseController
{
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
use AuthorizesRequests;
use DispatchesJobs;
use ValidatesRequests;
}

View file

@ -3,77 +3,71 @@
namespace App\Http\Controllers;
use App\Models\Directories;
use App\Models\Documents;
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;
class DocumentsController extends Controller
{
public function __construct()
public function index()
{
$this->middleware('auth', ['except' => ['download']]);
return view('document.index', ['documents' => Document::where('lang', '=', 'fr')->get()]);
}
public function index(Request $request) {
return view('documents.index', ['documents' => Documents::where('lang', '=', 'fr')->get()]);
public function create()
{
return view('document.create', ['folders' => Directories::all(), 'docsFR' => Document::where('lang', '=', 'fr')->orderBy('title', 'asc')->get()]);
}
public function add(Request $request) {
$folders = Directories::all();
return view('documents.add', ['folders' => $folders, 'docsFR' => Documents::where('lang', '=', 'fr')->orderBy('title', 'asc')->get()]);
}
public function store(Request $request) {
$tmp = $request->document;
$doc = new Documents();
$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';
}
public function edit(Request $request) {
$requestId = $request->id;
$doc = Documents::findOrFail($requestId);
$folders = Directories::all();
return view('documents.edit', ['document' => $doc, 'folders' => $folders]);
public function edit(Document $document)
{
return view('document.edit', ['document' => $document, 'folders' => Directories::all()]);
}
public function update(Request $request) {
$tmp = $request->document;
$doc = Documents::findOrFail($tmp['id']);
$doc->uuid = $tmp['uuid'];
$doc->title = $tmp['title'];
$doc->type = $tmp['type'];
$doc->directory = $tmp['directory'];
$doc->path = $tmp['path'];
if ($tmp['published'] === true || $tmp['published'] === 1){
$doc->published = 1;
}else{
$doc->published = 0;
public function update(Request $request, Document $document)
{
$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->published = 1;
} else {
$document->published = 0;
}
$doc->save();
$document->save();
if ($doc->lang === 'fr') {
foreach ($doc->others_lang as $item) {
$item->directory = $doc->directory;
if ($document->lang === 'fr') {
foreach ($document->others_lang as $item) {
$item->directory = $document->directory;
$item->save();
}
}
@ -81,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
@ -112,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());
@ -125,22 +121,20 @@ class DocumentsController extends Controller
/** Download the document */
public function download(Request $request, $uuid)
{
$doc = Documents::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);
}
public function delete(Request $request)
public function destroy(Request $request, Document $document)
{
$doc = Documents::findOrFail($request->id);
if ($doc->lang === 'fr') {
foreach ($doc->others_lang as $item) {
if ($document->lang === 'fr') {
foreach ($document->others_lang as $item) {
$item->delete();
}
}
$doc->delete();
$document->delete();
return ['status' => 'OK'];
}

View file

@ -3,28 +3,24 @@
namespace App\Http\Controllers;
use App\Models\Directories;
use App\Models\Documents;
use Illuminate\Http\Request;
class FoldersController extends Controller
{
public function __construct()
public function index(Request $request)
{
$this->middleware('auth');
}
public function index(Request $request) {
$folders = Directories::all();
return view('folders', ['folders' => $folders, 'static_folders' => config('app.STATIC_FOLDERS')]);
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();
@ -32,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();
@ -66,26 +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 'OK';
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']);
}
}

View file

@ -3,22 +3,12 @@
namespace App\Http\Controllers;
use App\Models\Contacts;
use App\Models\Data;
use App\Models\Setting;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Storage;
class HomeController extends Controller
{
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('auth');
}
/**
* Show the application dashboard.
*
@ -26,12 +16,13 @@ class HomeController extends Controller
*/
public function index()
{
$version = Data::where('key', 'version')->first();
$version = Setting::where('key', 'version')->first();
return view('home', ['version' => $version->value]);
}
public function newVersion(Request $request) {
$version = Data::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');
@ -40,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";
@ -59,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();
}
}

View file

@ -0,0 +1,57 @@
<?php
namespace App\Http\Controllers;
use App\Enums\SettingTypes;
use App\Http\Requests\Setting\UpdateRequest;
use App\Models\Setting;
class SettingController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$settings = Setting::all();
return \view('setting.index', \compact('settings'));
}
/**
* Show the form for editing the specified resource.
*
* @param \App\Models\Setting $setting
* @return \Illuminate\Http\Response
*/
public function edit(Setting $setting)
{
return \view('setting.edit', \compact('setting'));
}
/**
* Update the specified resource in storage.
*
* @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(
'public/setting_img',
$setting->key . ".png"
);
$setting->value = \str_replace("public", "storage", $path);
} else {
$setting->value = $request->value;
}
$setting->saveOrFail();
return redirect()->route('setting.edit', ['setting' => $setting])->with('status', __('La paramètre a été modifié.'));
}
}

View file

@ -2,28 +2,25 @@
namespace App\Http\Controllers;
use App\Models\Data;
use App\Models\Setting;
use Illuminate\Http\Request;
class ShowController extends Controller
{
public function __construct()
public function index(Request $request)
{
$this->middleware('auth');
}
public function index(Request $request) {
$ShowIsActive = Data::where('key', '=', 'ShowIsActive')->first();
$ShowIsActive = Setting::where('key', '=', 'ShowIsActive')->first();
return view('show.index', ['isActive' => $ShowIsActive->value]);
}
public function updateStatus(Request $request) {
$status = $request->status;
$d = Data::where('key', '=', 'ShowIsActive')->first();
public function updateStatus(Request $request)
{
$status = $request->status;
$d = Setting::where('key', '=', 'ShowIsActive')->first();
$d->value = $status;
$d->save();
$version = Data::where('key', 'version')->first();
$version = Setting::where('key', 'version')->first();
$version->value = $version->value + 1;
$version->save();

View file

@ -2,100 +2,61 @@
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\AppUsers;
use App\Models\AppUser;
use App\Models\Directories;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Hash;
use Illuminate\Database\Eloquent\Collection;
use Maatwebsite\Excel\Facades\Excel;
class UsersController extends Controller
{
public function __construct()
public function index()
{
$this->middleware('auth');
return view('app-users.index', ['app_users' => AppUser::all()]);
}
public function index(Request $request) {
return view('users.index', ['users' => AppUsers::all()]);
public function create()
{
return view('app-users.create');
}
public function add(Request $request) {
return view('users.add');
public function store(StoreRequest $request)
{
$appUser = new AppUser();
$appUser->fill($request->validated());
$appUser->activated = $request->has('activated') ? 1 : 0;
$appUser->save();
return redirect()->route('app-users.edit', ['app_user' => $appUser])->with('status', __('Utilisateur créé.'));
}
public function store(Request $request) {
$surname = $request->surname;
$firstname = $request->firstname;
$email = $request->email;
$password = $request->new_password;
$activated = $request->UserActivated;
$user = AppUsers::where('email', '=', $email)->first();
if ($user) {
return back()->with(['status' => 'Cette adresse email est déjà utilisée.', 'surname' => $surname, 'firstname' => $firstname, 'activated' => $activated]);
}else {
$user = new AppUsers();
$user->surname = $surname;
$user->firstname = $firstname;
$user->email = $email;
$user->password = Hash::make($password);
$user->authorizedFolders = json_encode([]);
if ($activated === NULL) {
$user->activated = 0;
} else {
$user->activated = 1;
}
$user->save();
return redirect()->route('users.edit', ['id' => $user->id])->with('status', 'Ajouté !');
}
public function edit(AppUser $appUser)
{
return view('app-users.edit', ['app_user' => $appUser, 'folders' => $this->renderFolders(Directories::where('needAuthorization', 1)->get())]);
}
public function edit(Request $request) {
$user = AppUsers::findOrFail($request->id);
$folders = Directories::where('needAuthorization', 1)->get();
foreach ($folders as $k => $folder){
$name = "";
$folders[$k]['parents'] = $folder->parents;
foreach ($folder->parents as $parent)
$name .= json_decode($parent->name)->fr . " / ";
$name .= json_decode($folder->name)->fr;
$folders[$k]['name'] = $name;
}
return view('users.edit', ['user' => $user, 'folders' => $folders]);
public function update(UpdateRequest $request, AppUser $appUser)
{
$appUser->fill($request->validated());
$appUser->activated = $request->has('activated') ? 1 : 0;
$appUser->save();
return redirect()->route('app-users.edit', ['app_user' => $appUser])->with('status', __('Utilisateur enregistré.'));
}
public function update(Request $request) {
$surname = $request->surname;
$firstname = $request->firstname;
$email = $request->email;
$password = $request->new_password;
$activated = $request->UserActivated;
$role = $request->role;
$authorized_folders = $request->authorized_folders;
$user = AppUsers::findOrFail($request->id);
$user->surname = $surname;
$user->firstname = $firstname;
$user->email = $email;
$user->role = $role;
if ($authorized_folders === 'null') {
$user->authorizedFolders = json_encode([]);
}else{
$user->authorizedFolders = $authorized_folders;
}
if ($password != NULL){
$user->password = Hash::make($password);
}
if ($activated === NULL) {
$user->activated = 0;
}else{
$user->activated = 1;
}
$user->save();
return redirect()->route('users.edit', ['id' => $user->id])->with('status', 'Enregistré !');
/**
* Delete an app user
*
* @param AppUser $app_user
* @return response
*/
public function destroy(AppUser $app_user)
{
$app_user->delete();
return redirect()->route('app-users.index')->with('status', __('Utilisateur supprimé.'));
}
/**
@ -105,9 +66,28 @@ 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('users.index')->with('success', 'Import terminé.');
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 = "";
$folders[$k]['parents'] = $folder->parents;
foreach ($folder->parents as $parent) {
$name .= json_decode($parent->name)->fr . " / ";
}
$name .= json_decode($folder->name)->fr;
$folders[$k]['name'] = $name;
}
return $folders;
}
}

View file

@ -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)

View file

@ -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);

View file

@ -12,6 +12,5 @@ class CheckForMaintenanceMode extends Middleware
* @var array
*/
protected $except = [
//
];
];
}

View file

@ -12,6 +12,5 @@ class EncryptCookies extends Middleware
* @var array
*/
protected $except = [
//
];
];
}

View file

@ -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)

View file

@ -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;
}

View file

@ -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;

View file

@ -0,0 +1,32 @@
<?php
namespace App\Http\Requests\App;
use Illuminate\Foundation\Http\FormRequest;
class SubmitRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return boolean
*/
public function authorize()
{
return auth()->check();
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'button_1' => 'required|exists:directories,id',
'button_2' => 'required|exists:directories,id',
'button_3' => 'required|exists:directories,id'
];
}
}

View file

@ -0,0 +1,46 @@
<?php
namespace App\Http\Requests\Setting;
use App\Enums\SettingTypes;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Gate;
class UpdateRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return boolean
*/
public function authorize()
{
return auth()->check() && Gate::allows('is-admin');
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
$setting = $this->route('setting');
switch ($setting->type->value) {
case SettingTypes::string()->value:
$validate = "required";
break;
case SettingTypes::numeric()->value:
$validate = "numeric|min:0|required";
break;
case SettingTypes::picture()->value:
$validate = "file|mimes:png|required";
break;
}
return [
'value' => $validate
];
}
}

View file

@ -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()
{

View file

@ -0,0 +1,33 @@
<?php
namespace App\Http\Requests\Users;
use Illuminate\Foundation\Http\FormRequest;
class StoreRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return boolean
*/
public function authorize()
{
return auth()->check();
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'surname' => 'required',
'firstname' => 'required',
'email' => 'unique:app_users,email|required',
'password' => 'min:8|required'
];
}
}

View file

@ -0,0 +1,39 @@
<?php
namespace App\Http\Requests\Users;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class UpdateRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return boolean
*/
public function authorize()
{
return \auth()->check();
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'surname' => 'required',
'firstname' => 'required',
'email' => [
Rule::unique('app_users', 'email')->ignore($this->route('app_user')->id),
'required'
],
'password' => 'nullable|min:8',
'authorizedFolders' => 'json|required',
'role' => 'in:USER,TOTAL|required'
];
}
}

View file

@ -0,0 +1,46 @@
<?php
namespace App\Http\Resources;
use Illuminate\Http\Resources\Json\JsonResource;
class ApiResponseResource extends JsonResource
{
/**
* Status
* @var string
*/
private $status;
/**
* Datas
* @var array
*/
private $datas;
/**
* Create a new resource instance.
*
* @param string $status
* @param array $datas
* @return void
*/
public function __construct(string $status, array $datas)
{
$this->status = $status;
$this->datas = $datas;
}
/**
* Transform the resource into an array.
*
* @param \Illuminate\Http\Request $request
* @return array
*/
public function toArray($request)
{
return [
'status' => $this->status,
'datas' => $this->datas
];
}
}

View file

@ -4,12 +4,12 @@ namespace App\Http\Resources;
use Illuminate\Http\Resources\Json\ResourceCollection;
class AppUsersCollection extends ResourceCollection
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)

View file

@ -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)

View file

@ -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)

View file

@ -2,7 +2,6 @@
namespace App\Http\Resources;
use App\Models\Documents;
use Illuminate\Http\Resources\Json\ResourceCollection;
class DocumentsCollection extends ResourceCollection
@ -10,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)

View file

@ -3,7 +3,7 @@
namespace App\Imports;
use App\Mail\AccountCreated;
use App\Models\AppUsers;
use App\Models\AppUser;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Mail;
use Illuminate\Support\Str;
@ -29,17 +29,17 @@ 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])) {
return null;
}
$user = new AppUsers([
$user = new AppUser([
'email' => $row[3],
'surname' => strtoupper($row[1]),
'firstname' => ucfirst(strtolower($row[2])),
@ -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();

View file

@ -2,19 +2,20 @@
namespace App\Mail;
use App\Models\AppUsers;
use App\Models\AppUser;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
class AccountCreated extends Mailable
{
use Queueable, SerializesModels;
use Queueable;
use SerializesModels;
/**
* The app user instance
*
* @var \App\Models\AppUsers;
* @var \App\Models\AppUser;
*/
public $user;
@ -28,9 +29,9 @@ class AccountCreated extends Mailable
*
* @return void
*/
public function __construct(AppUsers $user, string $password)
public function __construct(AppUser $user, string $password)
{
$this->user = $user;
$this->user = $user;
$this->password = $password;
}

View file

@ -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;
}
/**

View file

@ -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]);
}

34
app/Models/AppUser.php Normal file
View file

@ -0,0 +1,34 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Hash;
class AppUser extends Model
{
protected $fillable = ['email', 'surname', 'firstname', 'password', 'activated', 'role', 'authorizedFolders'];
public static function boot()
{
parent::boot();
self::creating(function ($model) {
$model->password = Hash::make($model->password);
$model->authorizedFolders = json_encode([]);
});
self::updating(function ($model) {
$model->password = $model->password !== null ? Hash::make($model->password) : $model->getOriginal('password');
});
static::deleting(function ($model) {
$model->contacts()->delete();
});
}
public function contacts()
{
return $this->hasMany(Contacts::class, 'user_id', 'id');
}
}

View file

@ -1,10 +0,0 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class AppUsers extends Model
{
protected $fillable = [ 'email', 'surname', 'firstname', 'password', 'activated', 'role', 'authorizedFolders'];
}

View file

@ -7,10 +7,17 @@ use Illuminate\Database\Eloquent\Model;
class Contacts extends Model
{
public $incrementing = false;
protected $appends = ['owner_name'];
public function getOwnerNameAttribute() {
$owner = AppUsers::find($this->user_id);
public function getOwnerNameAttribute()
{
$owner = AppUser::find($this->user_id);
return $owner->surname . " " . $owner->firstname;
}
public function app_user()
{
return $this->belongsTo(AppUser::class, 'id', 'user_id');
}
}

View file

@ -1,10 +0,0 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Data extends Model
{
//
}

View file

@ -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);
@ -21,6 +23,6 @@ class Directories extends Model
public function documents()
{
return $this->hasMany(Documents::class, 'directory', 'id');
return $this->hasMany(Document::class, 'directory', 'id');
}
}

View file

@ -4,21 +4,23 @@ namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Documents extends Model
class Document extends Model
{
public function getOthersLangAttribute() {
return Documents::where('parent', '=', $this->id)->get();
public function getOthersLangAttribute()
{
return Document::where('parent', '=', $this->id)->get();
}
public function getParentsAttribute() {
public function getParentsAttribute()
{
return $this->constructParents($this->directory);
}
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);

16
app/Models/Setting.php Normal file
View file

@ -0,0 +1,16 @@
<?php
namespace App\Models;
use App\Enums\SettingTypes;
use Illuminate\Database\Eloquent\Model;
use Kwaadpepper\Enum\Traits\CastsEnums;
class Setting extends Model
{
use CastsEnums;
protected $enumCasts = [
'type' => SettingTypes::class
];
}

View file

@ -14,7 +14,6 @@ class AppServiceProvider extends ServiceProvider
*/
public function register()
{
//
}
/**
@ -24,9 +23,7 @@ class AppServiceProvider extends ServiceProvider
*/
public function boot()
{
if (\App::environment() !== 'local') {
\URL::forceScheme('https');
}
url()->forceScheme('https');
JsonResource::withoutWrapping();
}

View file

@ -2,9 +2,10 @@
namespace App\Providers;
use App\Enums\Roles;
use App\User;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\Gate;
use Laravel\Passport\Passport;
class AuthServiceProvider extends ServiceProvider
{
@ -13,9 +14,7 @@ class AuthServiceProvider extends ServiceProvider
*
* @var array
*/
protected $policies = [
// 'App\Model' => 'App\Policies\ModelPolicy',
];
protected $policies = [];
/**
* Register any authentication / authorization services.
@ -25,5 +24,9 @@ class AuthServiceProvider extends ServiceProvider
public function boot()
{
$this->registerPolicies();
Gate::define('is-admin', function (User $user) {
return $user->role->equals(Roles::admin());
});
}
}

View file

@ -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();
//
}
}

View file

@ -14,7 +14,7 @@ class RouteServiceProvider extends ServiceProvider
*
* @var string
*/
protected $namespace = 'App\Http\Controllers';
protected $namespace = null;
/**
* The path to the "home" route for your application.
@ -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();
//
}
/**

View file

@ -2,13 +2,15 @@
namespace App;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use App\Enums\Roles;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Kwaadpepper\Enum\Traits\CastsEnums;
class User extends Authenticatable
{
use Notifiable;
use CastsEnums;
/**
* The attributes that are mass assignable.
@ -25,15 +27,10 @@ class User extends Authenticatable
* @var array
*/
protected $hidden = [
'password', 'remember_token',
'password',
];
/**
* The attributes that should be cast to native types.
*
* @var array
*/
protected $casts = [
'email_verified_at' => 'datetime',
protected $enumCasts = [
'role' => Roles::class
];
}

View file

@ -12,11 +12,14 @@
"ext-json": "*",
"fideloper/proxy": "^4.0",
"google/cloud-vision": "^0.25.0",
"kwaadpepper/enum": "^2.1",
"kwaadpepper/exception-handler": "^0.0.8",
"laravel/framework": "^8.0",
"laravel/tinker": "^2.0",
"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": {
@ -29,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": {

362
composer.lock generated
View file

@ -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": "f1a1ec757ebd7a6f0b2ec06767f78a82",
"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",
@ -1240,6 +1315,127 @@
},
"time": "2021-04-26T09:17:50+00:00"
},
{
"name": "kwaadpepper/enum",
"version": "2.1.2",
"source": {
"type": "git",
"url": "https://github.com/Kwaadpepper/enum.git",
"reference": "bbd08723895cad5a41bc0d57e565fe64fa13ca41"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Kwaadpepper/enum/zipball/bbd08723895cad5a41bc0d57e565fe64fa13ca41",
"reference": "bbd08723895cad5a41bc0d57e565fe64fa13ca41",
"shasum": ""
},
"require": {
"php": "^7.3"
},
"require-dev": {
"orchestra/testbench": "^5",
"phpunit/php-code-coverage": "^9.2",
"phpunit/phpunit": "~9.0",
"slevomat/coding-standard": "^7.0",
"squizlabs/php_codesniffer": "^3.5"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"Kwaadpepper\\Enum\\EnumServiceProvider"
]
}
},
"autoload": {
"psr-4": {
"Kwaadpepper\\Enum\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jérémy Munsch",
"email": "github@jeremydev.ovh",
"homepage": "https://jeremydev.ovh"
}
],
"description": "Enums to use for any project",
"homepage": "https://github.com/kwaadpepper/enum",
"keywords": [
"enum",
"laravel"
],
"support": {
"issues": "https://github.com/Kwaadpepper/enum/issues",
"source": "https://github.com/Kwaadpepper/enum/tree/2.1.2"
},
"time": "2021-11-18T16:52:08+00:00"
},
{
"name": "kwaadpepper/exception-handler",
"version": "0.0.8",
"source": {
"type": "git",
"url": "https://github.com/Kwaadpepper/exception-handler.git",
"reference": "e8ba0e31ca2bf5971e459c623f0f5322a4c7a630"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Kwaadpepper/exception-handler/zipball/e8ba0e31ca2bf5971e459c623f0f5322a4c7a630",
"reference": "e8ba0e31ca2bf5971e459c623f0f5322a4c7a630",
"shasum": ""
},
"require": {
"illuminate/support": "~7|~8|~9",
"laravel/framework": "~7|~8|~9"
},
"require-dev": {
"orchestra/testbench": "^6.13",
"phpunit/phpunit": "~9.0",
"squizlabs/php_codesniffer": "^3.5"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"Kwaadpepper\\ExceptionHandler\\ExceptionHandlerServiceProvider"
]
}
},
"autoload": {
"psr-4": {
"Kwaadpepper\\ExceptionHandler\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jérémy Munsch",
"email": "github@jeremydev.ovh",
"homepage": "https://jeremydev.ovh"
}
],
"description": "Send emails when exceptions occurs",
"homepage": "https://github.com/kwaadpepper/exception-handler",
"keywords": [
"email",
"exception",
"laravel",
"policies"
],
"support": {
"issues": "https://github.com/Kwaadpepper/exception-handler/issues",
"source": "https://github.com/Kwaadpepper/exception-handler/tree/0.0.8"
},
"time": "2022-02-03T15:23:22+00:00"
},
{
"name": "laravel/framework",
"version": "v8.54.0",
@ -2731,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",
@ -3539,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",
@ -8636,5 +8994,5 @@
"ext-json": "*"
},
"platform-dev": [],
"plugin-api-version": "2.1.0"
"plugin-api-version": "2.3.0"
}

View file

@ -2,58 +2,56 @@
return [
/* APP STATIC FOLDERS */
'STATIC_FOLDERS' => env('STATIC_FOLDERS'),
'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'),
@ -61,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'),
@ -128,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' => [
@ -183,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' => [
@ -231,6 +229,7 @@ return [
'Validator' => Illuminate\Support\Facades\Validator::class,
'View' => Illuminate\Support\Facades\View::class,
'Excel' => Maatwebsite\Excel\Facades\Excel::class,
'SettingTypesEnum' => App\Enums\SettingTypes::class,
],
];

View file

@ -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,

View file

@ -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' => [

View file

@ -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'),
];

View file

@ -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' => [

View file

@ -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,
],

View file

@ -0,0 +1,15 @@
<?php
return [
/**
* Send mail when app debug is turn off
* so you can be warned if an unhandled exception occurs
*/
'enableMaiLog' => !config('app.debug'),
/**
* Put a developper secured mailbox in here
* so you can receive email if things go mad
*/
'contactsList' => explode(",", env('MAIL_LIST_SERVICEWEB', 'equipe.web@ldc.fr'))
];

View file

@ -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',
],

View file

@ -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' => [

View file

@ -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' => [

View file

@ -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' => [
@ -60,34 +60,28 @@ return [
'name' => env('MAIL_FROM_NAME', 'Example'),
],
// Contacts List
'contactsList' => [
'serviceweb' => env('MAIL_LIST_SERVICEWEB', 'informatique.internet@ldc.fr')
],
/*
|--------------------------------------------------------------------------
| 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'),
@ -95,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' => [
@ -127,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'),

View file

@ -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' => [

View file

@ -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' => [

View file

@ -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,

View file

@ -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(

View file

@ -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),
];
});

View file

@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class UpdateDatasTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::rename('data', 'settings');
Schema::table('settings', function (Blueprint $table) {
$table->integer('type')->after('value');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('settings', function (Blueprint $table) {
$table->dropColumn('type');
});
Schema::rename('settings', 'data');
}
}

View file

@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class UpdateUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('users', function (Blueprint $table) {
$table->dropColumn('email_verified_at');
$table->dropColumn('remember_token');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('users', function (Blueprint $table) {
$table->timestamp('email_verified_at')->nullable()->after('email');
$table->string('remember_token', 100)->nullable()->after('password');
});
}
}

View file

@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreatePasswordResetsTable extends Migration
class AddRoleUsersTable extends Migration
{
/**
* Run the migrations.
@ -13,10 +13,8 @@ class CreatePasswordResetsTable extends Migration
*/
public function up()
{
Schema::create('password_resets', function (Blueprint $table) {
$table->string('email')->index();
$table->string('token');
$table->timestamp('created_at')->nullable();
Schema::table('users', function (Blueprint $table) {
$table->tinyInteger('role')->after('password');
});
}
@ -27,6 +25,8 @@ class CreatePasswordResetsTable extends Migration
*/
public function down()
{
Schema::dropIfExists('password_resets');
Schema::table('users', function (Blueprint $table) {
$table->dropColumn('role');
});
}
}

View file

@ -1,27 +0,0 @@
<?php
namespace Database\Seeders;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
class DataTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('data')->insert([
'key' => 'version',
'value' => '1'
]);
DB::table('data')->insert([
'key' => 'ShowIsActive',
'value' => '0'
]);
}
}

View file

@ -13,7 +13,7 @@ class DatabaseSeeder extends Seeder
*/
public function run()
{
$this->call(DataTableSeeder::class);
$this->call(SettingTableSeeder::class);
$this->call(DirectoriesSeeder::class);
}
}

View file

@ -0,0 +1,29 @@
<?php
namespace Database\Seeders;
use App\Enums\SettingTypes;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
class SettingTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('settings')->insert([
['key' => 'version', 'value' => '1', 'type' => SettingTypes::numeric()->value],
['key' => 'ShowIsActive', 'value' => '0', 'type' => SettingTypes::numeric()->value],
['key' => 'MainColor', 'value' => '#DE0017', 'type' => SettingTypes::string()->value],
['key' => 'SquaredLogo', 'value' => 'storage/setting_img/default.png', 'type' => SettingTypes::picture()->value],
['key' => 'RectangleLogo', 'value' => 'storage/setting_img/default.png', 'type' => SettingTypes::picture()->value],
['key' => 'BackgroundImage', 'value' => 'storage/setting_img/default.png', 'type' => SettingTypes::picture()->value],
['key' => 'HomeButtonImage', 'value' => 'storage/setting_img/default.png', 'type' => SettingTypes::picture()->value],
['key' => 'AppStoreUUID', 'value' => "", 'type' => SettingTypes::string()->value]
]);
}
}

12172
package-lock.json generated

File diff suppressed because it is too large Load diff

130
phpcs.xml Normal file
View file

@ -0,0 +1,130 @@
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="LDC Laravel"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd">
<description>Created with the PHP Coding Standard Generator. http://edorian.github.com/php-coding-standard-generator/</description>
<arg name="colors" />
<arg name="extensions" value="php" />
<file>app/</file>
<file>config/</file>
<file>database/factories</file>
<file>database/seeders</file>
<file>routes/</file>
<file>tests/</file>
<rule ref="PSR1" />
<rule ref="PSR12" />
<rule ref="Generic.Classes.DuplicateClassName"/>
<rule ref="Generic.CodeAnalysis.EmptyStatement"/>
<rule ref="Generic.CodeAnalysis.ForLoopShouldBeWhileLoop"/>
<rule ref="Generic.CodeAnalysis.ForLoopWithTestFunctionCall"/>
<rule ref="Generic.CodeAnalysis.JumbledIncrementer"/>
<rule ref="Generic.CodeAnalysis.UnconditionalIfStatement"/>
<rule ref="Generic.CodeAnalysis.UnnecessaryFinalModifier"/>
<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter"/>
<rule ref="Generic.CodeAnalysis.UselessOverridingMethod"/>
<rule ref="Generic.Commenting.Todo"/>
<rule ref="Generic.Commenting.Fixme"/>
<rule ref="Generic.ControlStructures.InlineControlStructure"/>
<rule ref="Generic.Files.ByteOrderMark"/>
<rule ref="Generic.Files.LineEndings"/>
<rule ref="Generic.Files.LineLength"/>
<rule ref="Generic.Formatting.DisallowMultipleStatements"/>
<rule ref="Generic.Formatting.MultipleStatementAlignment"/>
<rule ref="Generic.Formatting.NoSpaceAfterCast"/>
<rule ref="Generic.Functions.CallTimePassByReference"/>
<rule ref="Generic.Functions.FunctionCallArgumentSpacing"/>
<rule ref="Generic.Metrics.CyclomaticComplexity"/>
<rule ref="Generic.Metrics.NestingLevel"/>
<rule ref="Generic.NamingConventions.ConstructorName"/>
<rule ref="Generic.NamingConventions.UpperCaseConstantName"/>
<rule ref="Generic.NamingConventions.CamelCapsFunctionName"/>
<rule ref="Generic.PHP.DeprecatedFunctions"/>
<rule ref="Generic.PHP.DisallowShortOpenTag"/>
<rule ref="Generic.PHP.ForbiddenFunctions"/>
<rule ref="Generic.PHP.NoSilencedErrors"/>
<rule ref="Generic.Strings.UnnecessaryStringConcat"/>
<rule ref="Generic.WhiteSpace.DisallowTabIndent"/>
<rule ref="Generic.WhiteSpace.ScopeIndent"/>
<rule ref="MySource.PHP.EvalObjectFactory"/>
<rule ref="MySource.PHP.GetRequestData"/>
<rule ref="MySource.PHP.AjaxNullComparison"/>
<rule ref="PEAR.Classes.ClassDeclaration"/>
<rule ref="PEAR.Commenting.InlineComment"/>
<rule ref="PSR1.Classes.ClassDeclaration"/>
<rule ref="PSR1.Files.SideEffects"/>
<rule ref="PSR2.Classes.ClassDeclaration"/>
<rule ref="PSR2.Classes.PropertyDeclaration"/>
<rule ref="PSR2.ControlStructures.ElseIfDeclaration"/>
<rule ref="PSR2.ControlStructures.SwitchDeclaration"/>
<rule ref="PSR2.Files.EndFileNewline"/>
<rule ref="PSR2.Methods.MethodDeclaration"/>
<rule ref="PSR2.Namespaces.NamespaceDeclaration"/>
<rule ref="PSR2.Namespaces.UseDeclaration"/>
<rule ref="Squiz.PHP.CommentedOutCode"/>
<rule ref="Squiz.PHP.DisallowMultipleAssignments">
<exclude name="Squiz.PHP.DisallowMultipleAssignments.FoundInControlStructure" />
</rule>
<rule ref="Squiz.PHP.DisallowSizeFunctionsInLoops"/>
<rule ref="Squiz.PHP.DiscouragedFunctions">
<properties>
<property name="error" value="true"/>
</properties>
</rule>
<rule ref="Squiz.PHP.Eval"/>
<rule ref="Squiz.PHP.GlobalKeyword"/>
<rule ref="Squiz.PHP.Heredoc"/>
<rule ref="Squiz.PHP.InnerFunctions"/>
<rule ref="Squiz.PHP.LowercasePHPFunctions"/>
<rule ref="Squiz.PHP.NonExecutableCode"/>
<rule ref="Squiz.Scope.MemberVarScope"/>
<rule ref="Squiz.Scope.MethodScope"/>
<rule ref="Squiz.Scope.StaticThisUsage"/>
<rule ref="Squiz.WhiteSpace.LanguageConstructSpacing"/>
<rule ref="Squiz.WhiteSpace.LogicalOperatorSpacing"/>
<rule ref="Squiz.WhiteSpace.MemberVarSpacing">
<properties>
<property name="spacingBeforeFirst " value="false"/>
</properties>
</rule>
<rule ref="Squiz.WhiteSpace.OperatorSpacing">
<properties>
<property name="ignoreNewlines" value="true"/>
</properties>
</rule>
<rule ref="Squiz.WhiteSpace.ObjectOperatorSpacing">
<properties>
<property name="ignoreNewlines" value="true"/>
</properties>
</rule>
<rule ref="Squiz.WhiteSpace.ScopeKeywordSpacing"/>
<rule ref="Squiz.WhiteSpace.SemicolonSpacing"/>
<rule ref="Squiz.Commenting.BlockComment">
<exclude name="Squiz.Commenting.BlockComment.WrongStart" />
</rule>
<rule ref="Squiz.Commenting.ClassComment">
<exclude name="Squiz.Commenting.ClassComment.Missing" />
<exclude name="Squiz.Commenting.ClassComment.TagNotAllowed" />
</rule>
<rule ref="Squiz.Commenting.DocCommentAlignment"/>
<rule ref="Squiz.Commenting.EmptyCatchComment"/>
<rule ref="Squiz.Commenting.FunctionComment">
<exclude name="Squiz.Commenting.FunctionComment.MissingParamComment" />
</rule>
<rule ref="Squiz.Commenting.FunctionCommentThrowTag"/>
<rule ref="Squiz.Commenting.InlineComment">
<exclude name="Squiz.Commenting.InlineComment.DocBlock" />
</rule>
<rule ref="Squiz.Commenting.LongConditionClosingComment">
<exclude name="Squiz.Commenting.LongConditionClosingComment.SpacingBefore" />
</rule>
<rule ref="Squiz.Commenting.PostStatementComment"/>
<rule ref="Squiz.Commenting.VariableComment"/>
<rule ref="SlevomatCodingStandard.Namespaces.UnusedUses.UnusedUse" />
<!-- For Laravel migrations -->
<rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace">
<exclude-pattern>*/database/migrations/*</exclude-pattern>
</rule>
</ruleset>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 138 KiB

View file

@ -1,12 +0,0 @@
{
"type": "service_account",
"project_id": "testocr-270811",
"private_key_id": "1d660dd41ff7067f663811307f33b1cfcf5936b7",
"private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC2Cwm7AYiAIosU\nqXmrEBgvs1wcU3FVYx7hz3iL6gwU+eOrxv6SDOg2wG5/FZWq6P4kgx+ZqFsVoKVu\n2C6wE+XhLqAdLeMkHZuYSrOW7cLBkbHct2TOym7lIjMpdc05cHZL6ALpysWlOMzH\naOlpHaXHUR5QPxW2f0SVBQz0IbDoZlEy9hd5MiPeAcONulOCdFdy6+00R7MHqQUt\niS1ytznpbcfo6UfZpzNTnWtK7zazoA4nLxIKmFZ1fgCBt9aGFbIJj4H7qJDhT9Bh\nWW66OtupFmt3RDily7QzdIr+pKv2q+FuB7pXkUsSb7eQJ6Ms9LWBFYGTP7jU8xy2\nrScbsfArAgMBAAECggEANSKJp4zuA8CRaemBut2KwbmPhDES3oJ9DBobrHMXLbQ2\nsPf3bDfaO8j1N6DcO7OgIpYnThlm5KwsPWtaTUixi4WpdHrlVrBRryT2wHILq6ZU\nDQF2qilKLxVJa6uXyFE8JjHFT+pAwFYQ54+GuYjOz5usxm1zb/47zWdY/ZUr5tkg\nN7Mf5IX+nILptTlFcEFZ8kvlOZ1lO5B3WB1QS7CLkUTpdnXCkvngQt4Vn7FG+CRm\nz5/yQQ07+SqXYQ3C+RuNEYqsdbS258H4SUNRKY0nz78Yy0QMbEwWrBoeYbR1CGhQ\nKCBkySzkMT8tAYOkVRWc/eKUKmvkgUWFJWf+cNXK2QKBgQDn5nQEx9dZWlH6greR\nlI2kJd+1NxNgqEiPxpHrXTeW5aSC7r+JgYK0x5VrbyPORRXbOjs7+s8KTgk9XOks\nfWjDHoi68AwWhNsREpgjkE79KziEO36p9+FLk8JIdxdrcFFreqYsLh/fRoYpXxd+\n6DoAFNt9+Map+3IoqL1yTOvAdQKBgQDI9ivCX7G18DAEPy1i53rwcDu4gsiNTDQH\nYzyTXwajpXG8afXN6XzDpVw83EcVR1mX2Fifs18T4ytdE+ckGbEDPs5vkfWE4xov\nZidOH4TGwHluYbo9WOodWzSyHioJCpx1D8I4ejngoHCjZOmudpFT9l6urQ+TWcqG\nyOEN2/raHwKBgQCl05WDFaRYsM2OZYr+/0uJ5ctiuk+Q/sVkioot1Cq8LNrHBhLR\nMVtWCqI+gOsJxT0r1ygka+VBaSwSRS44MjWH0X3Ur3L1Z2t/edxxEfBp+U4gwKqC\nwE7KzI5RY1fL7DVMthe93/3Km5O0YdtbVJSlGkUaf5sQUk3/5SoTYg3zQQKBgBc6\nVO5/jxPfcj1bbAyNguk9n7mA7FtgnnboIn1KM4NAwTes66tkPHaEq3ehYln0SEfD\nyuKSof+zdzSn80R577rXTJcawM0eTs2BujNOc1NhtedrRlKG73B7NUkNMYCgCFuD\nech7YCs1gC9yn4v5ymxxApqgCDfY3g7cMx8d+Q2zAoGAZIf4SlFnUFNdjHYslGzf\nhL0tYDzz+gt7AQI+3n/GKUReGaWN0CoXT+O//xCGALj6ReDzryZLus0hBJrEYyWP\nJIM4qkclx2PxJR3GrO3iiUHH5Q6ausS/HdkcEog27b87YzUO7itRlvBqcYDrIdRB\nqdtKvavcip9IKY0HeyLWby8=\n-----END PRIVATE KEY-----\n",
"client_email": "testocr@testocr-270811.iam.gserviceaccount.com",
"client_id": "108442987620293463387",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/testocr%40testocr-270811.iam.gserviceaccount.com"
}

8
public/css/app.css vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2
public/js/app.js vendored

File diff suppressed because one or more lines are too long

View file

@ -1,76 +0,0 @@
/*!
* Bootstrap v4.4.1 (https://getbootstrap.com/)
* Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
/*!
* Sizzle CSS Selector Engine v2.3.4
* https://sizzlejs.com/
*
* Copyright JS Foundation and other contributors
* Released under the MIT license
* https://js.foundation/
*
* Date: 2019-04-08
*/
/*!
* Vue.js v2.6.11
* (c) 2014-2019 Evan You
* Released under the MIT License.
*/
/*!
* jQuery JavaScript Library v3.4.1
* https://jquery.com/
*
* Includes Sizzle.js
* https://sizzlejs.com/
*
* Copyright JS Foundation and other contributors
* Released under the MIT license
* https://jquery.org/license
*
* Date: 2019-05-01T21:04Z
*/
/*!
* vue-nestable v2.5.1
* (c) Ralph Huwiler <ralph@huwiler.rocks>
* Released under the MIT License.
*/
/**
* @license
* Lodash <https://lodash.com/>
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/
/**!
* @fileOverview Kickass library to create and place poppers near their reference elements.
* @version 1.16.1
* @license
* Copyright (c) 2016 Federico Zivolo and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

View file

@ -1,4 +0,0 @@
{
"/js/app.js": "/js/app.js",
"/css/app.css": "/css/app.css"
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

File diff suppressed because it is too large Load diff

Before

Width:  |  Height:  |  Size: 699 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show more