From c15a6e380f018cb0d8948a7ae06c55812882a01c Mon Sep 17 00:00:00 2001 From: ludo Date: Fri, 23 Feb 2024 08:35:41 +0100 Subject: [PATCH] minor fixes --- .../Admin/Core/Mail/MailLogsDataTable.php | 53 --- .../Core/Mail/MailTemplatesDataTable.php | 16 - .../Admin/Core/Mail/MailLogController.php | 26 -- .../Admin/Shop/DashboardController.php | 24 -- .../Admin/Shop/PackageController.php | 7 - .../Admin/Shop/ProducerController.php | 5 - .../Admin/Shop/UnityController.php | 11 +- .../Controllers/Shop/BasketController.php | 2 +- app/Install.php | 32 -- app/Models/Core/CartStorage.php | 24 ++ app/Repositories/Cities.php | 62 ---- .../Core/Auth/PasswordSecurities.php | 28 -- app/Repositories/Core/Auth/Passwords.php | 23 -- app/Repositories/Core/Auth/Permissions.php | 26 -- app/Repositories/Core/Auth/Roles.php | 83 ----- app/Repositories/Core/Auth/Teams.php | 61 ---- app/Repositories/Core/Auth/Users.php | 160 --------- app/Repositories/Core/Database.php | 52 --- app/Repositories/Core/Export.php | 172 --------- app/Repositories/Core/Images.php | 10 - app/Repositories/Core/Mail/MailLogs.php | 26 -- app/Repositories/Core/Mail/MailParser.php | 89 ----- app/Repositories/Core/Menu/Menu.php | 2 +- app/Repositories/Core/PDF.php | 100 ++++-- app/Repositories/Core/Stat.php | 164 --------- app/Repositories/Core/Trees.php | 12 +- app/Repositories/Shop/BasketStores.php | 13 +- app/Repositories/Shop/Paybox.php | 5 +- app/Repositories/Shop/PriceListValues.php | 1 - app/Repositories/Shop/Tariffs.php | 2 +- app/Repositories/Shop/Taxes.php | 2 +- app/Repositories/Shop/Unities.php | 4 +- app/Repositories/Shop/Variations.php | 2 +- app/Repositories/Users.php | 18 - app/Traits/Model/Basic.php | 2 +- app/Traits/Model/HasComments.php | 47 ++- app/Update.php | 30 -- app/User.php | 121 +------ config/backup.php | 266 -------------- config/comments.php | 18 - config/health/config.php | 2 +- config/ignition.php | 126 ------- config/laratrust.php | 334 ------------------ config/teamwork.php | 84 ----- config/twigbridge.php | 230 ------------ database/factories/UserFactory.php | 28 -- routes/Admin/Shop/Producers.php | 1 - 47 files changed, 148 insertions(+), 2458 deletions(-) delete mode 100644 app/Datatables/Admin/Core/Mail/MailLogsDataTable.php delete mode 100644 app/Http/Controllers/Admin/Core/Mail/MailLogController.php delete mode 100644 app/Http/Controllers/Admin/Shop/DashboardController.php delete mode 100644 app/Install.php create mode 100644 app/Models/Core/CartStorage.php delete mode 100644 app/Repositories/Cities.php delete mode 100644 app/Repositories/Core/Auth/PasswordSecurities.php delete mode 100644 app/Repositories/Core/Auth/Passwords.php delete mode 100644 app/Repositories/Core/Auth/Permissions.php delete mode 100644 app/Repositories/Core/Auth/Roles.php delete mode 100644 app/Repositories/Core/Auth/Teams.php delete mode 100644 app/Repositories/Core/Database.php delete mode 100644 app/Repositories/Core/Export.php delete mode 100644 app/Repositories/Core/Images.php delete mode 100644 app/Repositories/Core/Mail/MailLogs.php delete mode 100644 app/Repositories/Core/Mail/MailParser.php delete mode 100644 app/Repositories/Core/Stat.php delete mode 100644 app/Repositories/Users.php delete mode 100644 app/Update.php delete mode 100644 config/backup.php delete mode 100644 config/comments.php delete mode 100644 config/ignition.php delete mode 100644 config/laratrust.php delete mode 100644 config/teamwork.php delete mode 100644 config/twigbridge.php delete mode 100644 database/factories/UserFactory.php diff --git a/app/Datatables/Admin/Core/Mail/MailLogsDataTable.php b/app/Datatables/Admin/Core/Mail/MailLogsDataTable.php deleted file mode 100644 index 3090dfc6..00000000 --- a/app/Datatables/Admin/Core/Mail/MailLogsDataTable.php +++ /dev/null @@ -1,53 +0,0 @@ -buildQuery($model); - } - - public function modifier($datatables) - { - $datatables - ->editColumn('sent_to', function (MailLog $log) { - return MailParser::getToEmail($log->event); - }) - ->editColumn('subject', function (MailLog $log) { - return MailParser::getSubject($log->event); - }) - ->rawColumns(['action']); - - return parent::modifier($datatables); - } - - public function getHtmlButtons() - { - return self::getButtonShow(); - } - - protected function getColumns() - { - return [ - Column::make('created_at')->title(__('sent')), - Column::make('sent_to')->title(__('user')), - Column::make('subject')->title(__('subject')), - $this->makeColumnButtons()->width('60'), - ]; - } -} diff --git a/app/Datatables/Admin/Core/Mail/MailTemplatesDataTable.php b/app/Datatables/Admin/Core/Mail/MailTemplatesDataTable.php index e0513c80..913eb1ca 100644 --- a/app/Datatables/Admin/Core/Mail/MailTemplatesDataTable.php +++ b/app/Datatables/Admin/Core/Mail/MailTemplatesDataTable.php @@ -22,22 +22,6 @@ class MailTemplatesDataTable extends DataTable return $this->buildQuery($model); } - public function getHtmlButtons() - { - $buttons = ''; - if (Users::hasPermission('mail_templates_view')) { - $buttons .= self::getButtonShow(); - } - if (Users::hasPermission('mail_templates_update')) { - $buttons .= self::getButtonEdit(); - } - if (Users::hasPermission('mail_templates_delete')) { - $buttons .= self::getButtonDel(); - } - - return $buttons; - } - protected function getColumns() { return [ diff --git a/app/Http/Controllers/Admin/Core/Mail/MailLogController.php b/app/Http/Controllers/Admin/Core/Mail/MailLogController.php deleted file mode 100644 index 3cacdbef..00000000 --- a/app/Http/Controllers/Admin/Core/Mail/MailLogController.php +++ /dev/null @@ -1,26 +0,0 @@ -middleware('ability:admin'); - } - - public function index(MailLogsDataTable $dataTable) - { - return $dataTable->render('admin.Core.Mail.MailLog.index', $data ?? []); - } - - public function show($id) - { - $data['message'] = MailLogs::getParsed($id); - - return view('admin.Core.Mail.MailLog.modal', $data); - } -} diff --git a/app/Http/Controllers/Admin/Shop/DashboardController.php b/app/Http/Controllers/Admin/Shop/DashboardController.php deleted file mode 100644 index a0a2290d..00000000 --- a/app/Http/Controllers/Admin/Shop/DashboardController.php +++ /dev/null @@ -1,24 +0,0 @@ -middleware('auth'); - } - - public function index(Request $request) - { - $data = $request->all(); - $data = Dashboards::getStats($data); - dump($data); - - return view('Admin.Shop.Dashboard.index', $data); - } -} diff --git a/app/Http/Controllers/Admin/Shop/PackageController.php b/app/Http/Controllers/Admin/Shop/PackageController.php index 46488f8b..fdc20ac4 100644 --- a/app/Http/Controllers/Admin/Shop/PackageController.php +++ b/app/Http/Controllers/Admin/Shop/PackageController.php @@ -16,13 +16,6 @@ class PackageController extends Controller return $dataTable->render('Admin.Shop.Packages.list', $data); } - public function getOptionsByFamily(Request $request) - { - $id = $request->input('family_id'); - - return response()->json(Packages::getSelectByFamily($id)); - } - public function create() { $data = Packages::init(); diff --git a/app/Http/Controllers/Admin/Shop/ProducerController.php b/app/Http/Controllers/Admin/Shop/ProducerController.php index 8fdef2d2..c90c3a6e 100644 --- a/app/Http/Controllers/Admin/Shop/ProducerController.php +++ b/app/Http/Controllers/Admin/Shop/ProducerController.php @@ -66,9 +66,4 @@ class ProducerController extends Controller return Producers::deleteImage($id, $index); } - - public function exportExcel() - { - return Producers::exportExcel(); - } } diff --git a/app/Http/Controllers/Admin/Shop/UnityController.php b/app/Http/Controllers/Admin/Shop/UnityController.php index 48915f61..99169f76 100644 --- a/app/Http/Controllers/Admin/Shop/UnityController.php +++ b/app/Http/Controllers/Admin/Shop/UnityController.php @@ -11,10 +11,10 @@ class UnityController extends Controller { public function index(UnitiesDataTable $dataTable) { - return $dataTable->render('Admin.Shop.Unities.list', $data ?? []); + return $dataTable->render('Admin.Shop.Unities.list'); } - public function getOptionsByPackage(Request $request) + public function getOptionsByPackage($id) { return response()->json(Unities::getOptionsByPackage($id)); } @@ -31,13 +31,6 @@ class UnityController extends Controller return redirect()->route('Admin.Shop.Unities.index'); } - public function show($id) - { - $data = Unities::get($id); - - return view('Admin.Shop.Unities.view', $data); - } - public function edit($id) { $data = [ diff --git a/app/Http/Controllers/Shop/BasketController.php b/app/Http/Controllers/Shop/BasketController.php index 3f895629..4480976a 100644 --- a/app/Http/Controllers/Shop/BasketController.php +++ b/app/Http/Controllers/Shop/BasketController.php @@ -87,7 +87,7 @@ class BasketController extends Controller ShopCart::clear(); $data = $request->all(); unset($data['_token']); - $data['user_id'] = Users::getId(); + $data['user_id'] = Customers::getId(); Orders::saveOrder($data); return response()->json(['code' => '200']); diff --git a/app/Install.php b/app/Install.php deleted file mode 100644 index ebbaed82..00000000 --- a/app/Install.php +++ /dev/null @@ -1,32 +0,0 @@ -external('composer', 'install', '--no-dev', '--prefer-dist', '--optimize-autoloader') - ->artisan('key:generate', ['--force' => true]) - ->artisan('migrate', ['--force' => true]) - ->artisan('storage:link') - // ->dispatch(new MakeCronTask) - ->external('npm', 'install', '--production') - ->external('npm', 'run', 'production') - ->artisan('route:cache') - ->artisan('config:cache') - ->artisan('event:cache'); - } - - public function local(Runner $run) - { - $run->external('composer', 'install') - ->artisan('key:generate') - ->artisan('migrate') - ->artisan('storage:link') - ->external('npm', 'install') - ->external('npm', 'run', 'development'); - } -} diff --git a/app/Models/Core/CartStorage.php b/app/Models/Core/CartStorage.php new file mode 100644 index 00000000..b24dde79 --- /dev/null +++ b/app/Models/Core/CartStorage.php @@ -0,0 +1,24 @@ +attributes['cart_data'] = serialize($value); + } + + public function getCartDataAttribute($value) + { + return unserialize($value); + } +} diff --git a/app/Repositories/Cities.php b/app/Repositories/Cities.php deleted file mode 100644 index 40121a6c..00000000 --- a/app/Repositories/Cities.php +++ /dev/null @@ -1,62 +0,0 @@ -where('nom', 'LIKE', "{$query}%") - ->orderBy('nom', 'ASC')->take(30)->get(); - } - - public static function getCitiesByCP($query) - { - return City::select('id', DB::raw("concat(nom,' (',code_postal,')') as text")) - ->where('code_postal', 'LIKE', "%{$query}%") - ->orderBy('nom', 'ASC')->take(30)->get(); - } - - public static function getCPByCity($id) - { - $ville = self::get($id); - - return explode('-', $ville->code_postal); - } - - public static function getNomByCity($id) - { - $ville = self::get($id); - - return $ville->nom; - } - - public static function get($id) - { - return City::find($id); - } - - public static function getCoords($adresse) - { - $geocode = app('geocoder')->geocode($adresse)->get(); - if (! count($geocode)) { - return false; - } - $res = $geocode[0]->getCoordinates()->toArray(); - $latitude = $res[0]; - $longitude = $res[1]; - - return ['latitude' => $latitude, 'longitude' => $longitude]; - } - - public static function getCoordsByCity($id) - { - $ville = City::find($id); - - return ['latitude' => $ville->latitude, 'longitude' => $ville->longitude]; - } -} diff --git a/app/Repositories/Core/Auth/PasswordSecurities.php b/app/Repositories/Core/Auth/PasswordSecurities.php deleted file mode 100644 index bdf1662c..00000000 --- a/app/Repositories/Core/Auth/PasswordSecurities.php +++ /dev/null @@ -1,28 +0,0 @@ - $user_id, - 'password_expiry_days' => $delay, - 'password_updated_at' => Carbon::now(), - ]); - } - - public static function getUserName($id) - { - return self::getUser($id)->username; - } - - public static function getUser($id) - { - return PasswordSecurity::with('user')->find($id)->user; - } -} diff --git a/app/Repositories/Core/Auth/Passwords.php b/app/Repositories/Core/Auth/Passwords.php deleted file mode 100644 index 5ce753e0..00000000 --- a/app/Repositories/Core/Auth/Passwords.php +++ /dev/null @@ -1,23 +0,0 @@ -setMinLength(5); - $validator->setMinLowerCaseLetters(2); - $validator->setMinUpperCaseLetters(1); - $validator->setMinNumbers(1); - $validator->setMinSymbols(3); - - if ($validator->isValid($password)) { - printf('password %s is valid'.PHP_EOL, $password); - } else { - printf('password %s is invalid'.PHP_EOL, $password); - var_dump($validator->getErrors()); - } - } -} diff --git a/app/Repositories/Core/Auth/Permissions.php b/app/Repositories/Core/Auth/Permissions.php deleted file mode 100644 index 828e609f..00000000 --- a/app/Repositories/Core/Auth/Permissions.php +++ /dev/null @@ -1,26 +0,0 @@ -distinct('module')->get()->pluck('module'); - } - - public static function getByName($name) - { - return Permission::where('name', $name)->first(); - } - - public static function getModel() - { - return Permission::query(); - } -} diff --git a/app/Repositories/Core/Auth/Roles.php b/app/Repositories/Core/Auth/Roles.php deleted file mode 100644 index 83f00f79..00000000 --- a/app/Repositories/Core/Auth/Roles.php +++ /dev/null @@ -1,83 +0,0 @@ -hasRole('admin') ? Role::whereNotIn('name', ['admin'])->get() : Role::all(); - - return $data->pluck('name', 'id')->toArray(); - } - - public static function create($data) - { - $permissions = array_keys($data['permissions']); - unset($data['permissions']); - $data['active'] = true; - $role = Role::create($data); - $role->attachPermissions($permissions); - - return $role; - } - - public static function update($input, $id = false) - { - $id = $id ? $id : $input['id']; - $permissions = array_keys($input['permissions']); - $role = self::get($id); - $role->update(['name' => $input['name']]); - $role->syncPermissions($permissions); - - return $role; - } - - public static function toggleActive($id, $active) - { - return Role::find($id)->update(['active' => $active]); - } - - public static function getWithPermissions($id) - { - $role = self::get($id)->toArray(); - $role['permissions'] = self::get($id)->permissions->pluck('id')->toArray(); - - return $role; - } - - public static function getByName($name) - { - return Role::where('name', $name)->first(); - } - - public static function getRolesByUser($user_id = false) - { - $user_id = $user_id ? $user_id : Users::getId(); - - return RoleUser::byUser($user_id); - } - - public static function getUsersByRole($id) - { - return RoleUser::byTeam($id)->get(); - } - - public static function getUsersIdByRole($id) - { - return self::getUsersByRole($id)->pluck('user_id'); - } - - public static function getModel() - { - return RoleUser::query(); - } -} diff --git a/app/Repositories/Core/Auth/Teams.php b/app/Repositories/Core/Auth/Teams.php deleted file mode 100644 index b8495429..00000000 --- a/app/Repositories/Core/Auth/Teams.php +++ /dev/null @@ -1,61 +0,0 @@ -get(); - } - - public static function getUsersIdByTeam($id) - { - return self::getUsersByTeam($id)->pluck('user_id'); - } - - public static function getUsersByTeam2($id) - { - return Team::find($id)->users(); - } - - public static function getByName($name) - { - return Team::where('name', $name)->first(); - } - - public static function delete($id) - { - Users::destroyByUniqueTeam($id); - - return Team::destroy($id); - } - - public static function destroyBySociete($id) - { - $teams = Team::bySociete($id)->get(); - foreach ($teams as $team) { - self::delete($team->id); - } - } - - public static function getModel() - { - return Team::query(); - } -} diff --git a/app/Repositories/Core/Auth/Users.php b/app/Repositories/Core/Auth/Users.php index c33bbe03..3ff8d06a 100644 --- a/app/Repositories/Core/Auth/Users.php +++ b/app/Repositories/Core/Auth/Users.php @@ -9,57 +9,12 @@ use App\Traits\Model\Basic; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Hash; -use Illuminate\Support\Str; -use LangleyFoxall\LaravelNISTPasswordRules\PasswordRules; use Laratrust\Traits\LaratrustUserTrait; class Users { use Basic, LaratrustUserTrait; - public static function isAdmin() - { - return self::hasRole('admin'); - } - - public static function getInfo($id = false) - { - $id = $id ? $id : self::getId(); - if (! $id) { - return false; - } - $user = self::get($id); - $data = $user->toArray(); - $data['name'] = $user->name; - $data['avatar'] = self::getAvatar($id); - $data['roles'] = $user->roles->pluck('id')->toArray(); - $data['permissions'] = $user->allPermissions()->pluck('id')->toArray(); - - return $data; - } - - public static function store($data) - { - if ($data['id'] ?? false) { - unset($data['password']); - } - $user = $data['id'] ?? false ? self::update($data) : self::create($data); - $user->roles()->sync(array_keys($data['roles'] ?? [])); - - return $user; - } - - public static function create($data) - { - $data['password'] = $data['password'] ?? Hash::make($data['password']); - $data['remember_token'] = Str::random(32); - $data['active'] = true; - $user = User::create($data); - PasswordSecurities::create($user->id); - - return $user; - } - public static function getId() { $user = self::getUser(); @@ -94,98 +49,6 @@ class Users return User::orderBy('name')->pluck('name', 'id')->toArray(); } - public static function delete($id) - { - $ret = RoleUser::byUser($id)->delete(); - - return User::destroy($id); - } - - public static function getListByRole($role) - { - return self::selectOptions()->orderBy('name')->whereRoleIs($role)->get(); - } - - public static function hasRole($role, $user = false) - { - $user = $user ? $user : self::getUser(); - - return $user ? $user->hasRole($role) : false; - } - - public static function hasPermission($permission, $user = false) - { - if (self::isAdmin()) { - return true; - } - $user = $user ? $user : self::getUser(); - $permissions = self::getPermissions($user); - - return $user ? self::checkPermission($permissions, $permission) : false; - // TODO why is posing problem ??? - // return $user ? $user->hasPermission($permission) : false; - } - - public static function checkPermission($permissions, $permission) - { - if (! strpos($permission, '*')) { - return in_array($permission, $permissions); - } - $permission = str_replace('*', '', $permission); - foreach ($permissions as $item) { - if (stripos($item, $permission) !== false) { - return true; - } - } - - return false; - } - - public static function getRoles($user = false) - { - $user = $user ? $user : self::getUser(); - - return $user ? $user->roles->pluck('name')->toArray() : false; - } - - public static function getRolesToEdit() - { - return Roles::getListByRights(); - } - - public static function getPermissions($user = false) - { - $user = $user ? $user : self::getUser(); - - return $user ? $user->allPermissions()->pluck('name')->toArray() : false; - } - - public static function getByTeam($id) - { - return User::byTeam($id)->get(); - } - - public static function getByUniqueTeam($id) - { - return User::byTeam($id)->byUniqueTeam()->get(); - } - - public static function destroyByUniqueTeam($id) - { - return User::byTeam($id)->byUniqueTeam()->delete(); - } - - public static function getAvatar($user_id) - { - $avatar = self::get($user_id)->avatar; - if (! $avatar) { - return '/assets/img/no-avatar.png'; - } - $path = '/images/avatars/'; - - return $path.$avatar; - } - public static function selectOptions() { return User::select('id', DB::raw("concat(last_name,' ',first_name) as name")); @@ -201,24 +64,6 @@ class Users return self::get($id)->update(['active' => $active]); } - public static function uploadAvatar($request) - { - $targetDir = 'uploads'; - $file = $request->file('avatar_file'); - $data = Upload::getData($file); - $file_uploaded = Upload::store($file, $targetDir); - $tab = pathinfo($file_uploaded); - - return [ - 'name' => $tab['basename'], - ]; - } - - public static function updateAvatar($id, $avatar) - { - return User::find($id)->update(['avatar' => $avatar]); - } - public static function updatePassword($id, $password) { $password = Hash::make($password); @@ -226,11 +71,6 @@ class Users return User::find($id)->update(['password' => $password]); } - public static function validate($username, $field = 'current_password') - { - return PasswordRules::changePassword($username, $field); - } - public static function getModel() { return User::query(); diff --git a/app/Repositories/Core/Database.php b/app/Repositories/Core/Database.php deleted file mode 100644 index c3194fcc..00000000 --- a/app/Repositories/Core/Database.php +++ /dev/null @@ -1,52 +0,0 @@ -getTable()); - foreach ($columns as &$column) { - $type = Schema::getColumnType($table->getTable(), $column); - array_push($data, ['name' => $column, 'type' => $type]); - } - - return $data; - } - - public static function getPopulate($model, $route, $id) - { - echo Form::model($model, ['route' => [$route.'.update', $id]]); - } -} diff --git a/app/Repositories/Core/Export.php b/app/Repositories/Core/Export.php deleted file mode 100644 index a75991b9..00000000 --- a/app/Repositories/Core/Export.php +++ /dev/null @@ -1,172 +0,0 @@ -xls = new PHPExcel(); - } - - public function create($filename, $stockage = false) - { - $this->sheet = $this->xls->setActiveSheetIndex(0); - $this->filename = $filename; - $this->stockage = $stockage; - $this->lig = 1; - } - - public function setColumnsTitle($data) - { - $col = 0; - foreach ($data as $value) { - $this->writeTitle($this->lig, $col, $value); - $col++; - } - $this->lig++; - } - - public function writeTitle($lig, $col, $txt) - { - $coord = $this->conv($lig, $col); - $style = $this->sheet->getStyle($coord); - $styleFont = $style->getFont(); - $styleFont->setBold(true); - $styleFont->setSize(12); - $styleFont->setName('Arial'); - $this->sheet->setCellValue($coord, $txt); - } - - public function writeCell($lig, $col, $txt) - { - $coord = $this->conv($lig, $col); - $this->sheet->setCellValue($coord, $txt); - } - - public function exportRow($data, $config = null) - { - if ($config) { - $vars = $config['vars']; - $options = $config['options']; - $multioptions = $config['multioptions']; - } - $col = 0; - if (is_array($vars)) { - foreach ($vars as $key) { - $txt = $data[$key]; - if (isset($options[$key])) { - $txt = $options[$key][$txt]; - } - if (! isset($multioptions[$key])) { - $this->writeCell($this->lig, $col, $txt); - $this->nb++; - $col++; - - continue; - } - $tabs = self::getReverseMultiOptions($txt); - foreach ($tabs as $key2 => $value) { - $txt .= $multioptions[$key][$key2].'\n'; - } - - $this->writeCell($this->lig, $col, $txt); - $this->nb++; - $col++; - } - } else { - foreach ($data as $value) { - $txt = $value; - $this->writeCell($this->lig, $col, $txt); - $this->nb++; - $col++; - } - } - $this->lig++; - } - - public function header() - { - // Redirect output to a client’s web browser (Excel5) - header('Content-Type: application/vnd.ms-excel'); - header('Content-Disposition: attachment;filename="'.$this->filename.'"'); - header('Cache-Control: max-age=0'); - // If you're serving to IE 9, then the following may be needed - // header('Cache-Control: max-age=1'); - - // If you're serving to IE over SSL, then the following may be needed - header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past - header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); // always modified - header('Cache-Control: cache, must-revalidate'); // HTTP/1.1 - header('Pragma: public'); // HTTP/1.0 - } - - public function close() - { - if ($this->debug) { - return; - } - $objWriter = PHPExcel_IOFactory::createWriter($this->xls, 'Excel2007'); - if (! $this->stockage) { - $this->header(); - $objWriter->save('php://output'); - } else { - $objWriter->save('text.xlsx'); - } - } - - public function conv($lig, $col) - { - $c = static::convColtoTxt($col); - - return $c.$lig; - } - - public function convColtoTxt($col) - { - $col1 = $col % 26; - $col2 = (int) floor($col / 26); - if ($col2) { - $c = chr(64 + $col2); - } else { - $c = ''; - } - $c .= chr(65 + $col1); - - return $c; - } - - public function getOption($var) - { - $data = $this->init(); - - return $data[$var.'_options']; - } - - public function getOptions($data) - { - $options = []; - foreach ($data as $key => $value) { - $var = substr($key, 0, -8); - $options[$var] = $value; - } - - return $options; - } -} diff --git a/app/Repositories/Core/Images.php b/app/Repositories/Core/Images.php deleted file mode 100644 index bb121725..00000000 --- a/app/Repositories/Core/Images.php +++ /dev/null @@ -1,10 +0,0 @@ -event); - } - - public static function getParsed($id) - { - return MailParser::getParsed(self::get($id)->event); - } - - public static function getModel() - { - return MailLog::query(); - } -} diff --git a/app/Repositories/Core/Mail/MailParser.php b/app/Repositories/Core/Mail/MailParser.php deleted file mode 100644 index f412c356..00000000 --- a/app/Repositories/Core/Mail/MailParser.php +++ /dev/null @@ -1,89 +0,0 @@ - self::getFromByModel($model), - 'subject' => self::getSubjectByModel($model), - 'content' => self::getHtmlByModel($model), - 'to_name' => self::getToNameByModel($model), - 'to_email' => self::getToEmailByModel($model), - ]; - } - - public static function getSubject($mail) - { - return self::getSubjectByModel(self::getModel($mail)); - } - - public static function getText($mail) - { - return self::getTextByModel(self::getModel($mail)); - } - - public static function getHtml($mail) - { - return self::getHtmlByModel(self::getModel($mail)); - } - - public static function getFrom($mail) - { - return self::getFromByModel(self::getModel($mail)); - } - - public static function getToName($mail) - { - return self::getToNameByModel(self::getModel($mail)); - } - - public static function getToEmail($mail) - { - return self::getToEmailByModel(self::getModel($mail)); - } - - public static function getSubjectByModel($model) - { - return $model->getHeaderValue(HeaderConsts::SUBJECT); - } - - public static function getTextByModel($model) - { - return $model->getTextContent(); - } - - public static function getFromByModel($model) - { - return $model->getHeader(HeaderConsts::FROM)->getPersonName(); - } - - public static function getToNameByModel($model) - { - return $model->getHeader(HeaderConsts::TO)->getAddresses()[0]->getName(); - } - - public static function getToEmailByModel($model) - { - return $model->getHeader(HeaderConsts::TO)->getAddresses()[0]->getEmail(); - } - - public static function getHtmlByModel($model) - { - return $model->getHtmlContent(); - } - - public static function getModel($mail) - { - $mailParser = new MailMimeParser(); - - return $mailParser->parse($mail, false); - } -} diff --git a/app/Repositories/Core/Menu/Menu.php b/app/Repositories/Core/Menu/Menu.php index 9f7fb4d9..846b60e6 100644 --- a/app/Repositories/Core/Menu/Menu.php +++ b/app/Repositories/Core/Menu/Menu.php @@ -7,7 +7,7 @@ use View; class Menu extends LavaryMenu { - public function make($name, $callback) + public function make($name, $callback, $arr = []) { if (! is_callable($callback)) { return; diff --git a/app/Repositories/Core/PDF.php b/app/Repositories/Core/PDF.php index ed025c6d..8b004fe8 100644 --- a/app/Repositories/Core/PDF.php +++ b/app/Repositories/Core/PDF.php @@ -2,41 +2,66 @@ namespace App\Repositories\Core; +use Barryvdh\Debugbar\Facades\Debugbar; use Barryvdh\DomPDF\Facade\Pdf as DomPDF; use Barryvdh\Snappy\Facades\SnappyPdf; use GravityMedia\Ghostscript\Ghostscript; +use Imagick; use Mpdf\Mpdf; +use Spatie\PdfToText\Pdf as PDFToText; use Symfony\Component\Process\Process; class PDF { - public function convertView($view, $data, $filename) - { - try { - Browsershot::html(view($view, $data)->render()) - ->noSandbox() - ->waitUntilNetworkIdle() - ->format('A4') - ->showBackground() - ->savePdf('temp.pdf'); - - $postRoute = URL::signedRoute('orderinvoices.store', ['order' => $this->order]); - Http::attach('invoice', file_get_contents('temp.pdf'), $filename) - ->post($postRoute) - ->throw(); - } catch (\Exception $exception) { - Log::error($exception); - } - } - public static function view($view, $data, $filename = 'file.pdf') { - \Debugbar::disable(); + Debugbar::disable(); $pdf = DomPDF::loadView($view, $data); return $pdf->download($filename); } + public static function countPages($filename) + { + $image = new Imagick(); + $image->pingImage($filename); + + return $image->getNumberImages(); + + /* + $pdftext = file_get_contents($filename); + + return preg_match_all("/\/Page\W*(\d+)/", $pdftext, $dummy); + */ + } + + public function getPDFPages($document) + { + $cmd = '/path/to/pdfinfo'; // Linux + $cmd = 'C:\\path\\to\\pdfinfo.exe'; // Windows + + // Parse entire output + // Surround with double quotes if file name has spaces + exec("$cmd \"$document\"", $output); + + // Iterate through lines + $pagecount = 0; + foreach ($output as $op) { + // Extract the number + if (preg_match("/Pages:\s*(\d+)/i", $op, $matches) === 1) { + $pagecount = intval($matches[1]); + break; + } + } + + return $pagecount; + } + + public static function getText($filename) + { + return PDFToText::getText($filename); + } + public static function convertHTML($html) { $mpdf = new Mpdf(); @@ -45,11 +70,11 @@ class PDF return $mpdf->Output(); } - public static function convertURL($url) + public static function convertURL($url, $filename = 'sample.pdf') { $pdf = SnappyPdf::loadFile($url); - return $pdf->download('invoice.pdf'); + return $pdf->download($filename); } public static function convertIfNeeded($filename) @@ -62,13 +87,14 @@ class PDF public static function getVersion($filename) { $pdf = fopen($filename, 'r'); - if ($pdf) { - $line_first = fgets($pdf); - fclose($pdf); - } else { + if (! $pdf) { echo 'error opening the file.'; + + return false; } - preg_match_all('!\d+!', $line_first, $matches); + $lineFirst = fgets($pdf); + fclose($pdf); + preg_match_all('!\d+!', $lineFirst, $matches); $version = implode('.', $matches[0]); return (float) $version; @@ -76,35 +102,31 @@ class PDF public static function downgrade($filename) { - $new_filename = $filename.'-temp'; + $newFilename = $filename.'-temp'; $ghostscript = new Ghostscript([ 'quiet' => false, ]); - $device = $ghostscript->createPdfDevice($new_filename); + $device = $ghostscript->createPdfDevice($newFilename); $device->setCompatibilityLevel(1.4); - - // dump($device); $process = $device->createProcess($filename); - // dump($process); - // echo '$ ' . $process->getCommandLine() . PHP_EOL; - // exit; + $process->run(function ($type, $buffer) { if ($type === Process::ERR) { throw new \RuntimeException($buffer); } - // print $buffer; }); unlink($filename); - rename($new_filename, $filename); + rename($newFilename, $filename); } public static function downgrade2($filename) { - $new_filename = $filename.'-temp'; - shell_exec('gs -dBATCH -dCompatibilityLevel=1.4 -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile="'.$new_filename.'" "'.$filename.'"'); + $newFilename = $filename.'-temp'; + $options = '-dBATCH -dCompatibilityLevel=1.4 -dNOPAUSE -q -sDEVICE=pdfwrite'; + shell_exec("gs {$options} -sOutputFile=\"{$newFilename}\" \"{$filename}\""); unlink($filename); - rename($new_filename, $filename); + rename($newFilename, $filename); } } diff --git a/app/Repositories/Core/Stat.php b/app/Repositories/Core/Stat.php deleted file mode 100644 index 58c7fb0a..00000000 --- a/app/Repositories/Core/Stat.php +++ /dev/null @@ -1,164 +0,0 @@ -whereBetween('created_at', [$start, $end])->count(); - } - - public static function getTotalAtDate($model, $end) - { - return $model->where('created_at', '<', $end)->count(); - } - - public static function renderStatsbyMultiVar($var, $var_option = '') - { - self::renderStatsJson(self::getStatsbyMultiVar($var, $var_option)); - } - - public static function renderStatsbyVar($var) - { - self::renderStatsJson(self::getStatsbyVar($var)); - } - - public static function renderStatsbyOptions($var, $var_option = '') - { - self::renderStatsJson(self::getStatsbyOptions($var, $var_option)); - } - - public static function renderStatsJson($data) - { - return json_encode($data, JSON_NUMERIC_CHECK); - } - - public static function getStatsbyMultiVar($var, $var_option = '') - { - if ($var_option) { - $var_option = $var; - } - $options = self::getOption($var_option); - - return self::getStatsbyMultiOptions($var, $options); - } - - public static function getCountByPeriod($var, $begin, $end) - { - return self::getModel() - ->whereBetween($var, $begin, $end) - ->count(); - } - - public static function getCountbyVar($var) - { - $db = self::getInstance()->app->db; - - return self::getModel() - ->select($db::raw("count(id) as y, {$var} as name")) - ->groupBy($var) - ->get(); - } - - public static function getStatsbyOptions($var, $var_option = '') - { - if ($var_option ?? false) { - $var_option = $var; - } - $options = self::getInstance()->controller->getOption($var_option); - $nb = self::getCountbyOption($var); - $data = []; - foreach ($options as $key => $value) { - $y = (int) $nb[$key]; - $data[] = ['y' => $y, 'name' => $value]; - } - - return $data; - } - - public static function getCountbyOption($var) - { - $db = self::getInstance()->app->db; - $data = self::getModel() - ->select($db::raw('count(id) as nb')) - ->groupBy($var) - ->get(); - foreach ($data as $key => $value) { - if (is_array($data[$key])) { - $data[$key] = (int) $data[$key]['nb']; - } else { - $data[$key] = (int) $data[$key]->nb; - } - } - - return $data; - } - - public static function getStatsbyMultiOptions($var, $options) - { - $data = []; - foreach ($options as $key => $value) { - $nb = self::getCountbyBin($var, $key); - $data[] = ['y' => $nb, 'name' => $value]; - } - - return $data; - } - - public static function getCountbyBin($var, $value) - { - $bit = pow(2, $value); - - return self::getModel()->where($var, '&', $bit)->count(); - } - - public static function getStatsbyPeriod($begin = '', $end = '', $period = 'days') - { - $end = Carbon::now(); - $begin = Carbon::now()->subMonth(1); - switch ($period) { - case 'days': - $periods = DateRange::getPeriodsbyDay($begin, $end); - break; - case 'months': - $periods = DateRange::getPeriodsbyMonth($begin, $end); - break; - case 'weeks': - $periods = DateRange::getPeriodsbyWeek($begin, $end); - break; - default: - } - - return $periods; - } - - public static function serializeValues($tab) - { - return self::serializeByVar($tab, 'count'); - } - - public static function serializeByVar($tab, $var, $n = 0) - { - $collection = collect($tab); - - if ($n) { - $tab = $collection->pluck($var)->slice(-$n)->toArray(); - } else { - $tab = $collection->pluck($var)->toArray(); - } - - return implode(',', $tab); - } - - public static function avgByVar($tab, $var) - { - return collect($tab)->pluck($var)->avg(); - } -} diff --git a/app/Repositories/Core/Trees.php b/app/Repositories/Core/Trees.php index a655fedd..ed1d1882 100644 --- a/app/Repositories/Core/Trees.php +++ b/app/Repositories/Core/Trees.php @@ -28,10 +28,10 @@ class Trees return $tree; } - public static function moveTree($node_id, $target_id, $type) + public static function moveTree($node_id, $target_id, $type, $model) { - $item = self::getNode($node_id); - $item_target = self::getNode($target_id); + $item = self::getNode($node_id, $model); + $item_target = self::getNode($target_id, $model); switch ($type) { case 'after': @@ -49,7 +49,7 @@ class Trees public static function create($data, $model) { - $parent = $data['parent_id'] ?? false ? self::getNode($data['parent_id']) : self::getRoot(); + $parent = $data['parent_id'] ?? false ? self::getNode($data['parent_id'], $model) : self::getRoot($model); $tree = $model->create(['name' => $data['name']]); $tree->appendToNode($parent)->save(); @@ -69,9 +69,9 @@ class Trees // return Category::destroy($id); } - public static function getRoot() + public static function getRoot($model) { - return self::getNode(1); + return self::getNode(1, $model); } public static function getNode($id, $model) diff --git a/app/Repositories/Shop/BasketStores.php b/app/Repositories/Shop/BasketStores.php index 1cd1b700..bfa99c3c 100644 --- a/app/Repositories/Shop/BasketStores.php +++ b/app/Repositories/Shop/BasketStores.php @@ -10,24 +10,19 @@ class BasketStores { use Basic; - public function has($key) + public static function has($key) { return Basket::find($key); } - public function get($key) + public static function get($key) { - if ($this->has($key)) { - return new CartCollection(Basket::find($key)->cart_data); - } else { - return []; - } + return self::has($key) ? new CartCollection(Basket::find($key)->cart_data) : []; } - public function put($key, $value) + public static function put($key, $value) { if ($row = Basket::find($key)) { - // update $row->cart_data = $value; $row->save(); } else { diff --git a/app/Repositories/Shop/Paybox.php b/app/Repositories/Shop/Paybox.php index 39b3354c..9dacff36 100644 --- a/app/Repositories/Shop/Paybox.php +++ b/app/Repositories/Shop/Paybox.php @@ -2,6 +2,7 @@ namespace App\Repositories\Shop; +use App\Models\Shop\InvoicePayment; use Bnb\PayboxGateway\Requests\Paybox\AuthorizationWithCapture; use Bnb\PayboxGateway\Requests\PayboxDirect\Capture; use Bnb\PayboxGateway\Responses\Exceptions\InvalidSignature; @@ -35,9 +36,9 @@ class Paybox } } - public static function getPreviousAuthorizedRequest() + public static function getPreviousAuthorizedRequest($request) { - $payment = Payment::where('number', $request->input('order_number'))->firstOrFail(); + $payment = InvoicePayment::where('number', $request->input('order_number'))->firstOrFail(); $captureRequest = App::make(Capture::class); $response = $captureRequest->setAmount($payment->amount) ->setPayboxCallNumber($payment->call_number) diff --git a/app/Repositories/Shop/PriceListValues.php b/app/Repositories/Shop/PriceListValues.php index b96fd450..40129186 100644 --- a/app/Repositories/Shop/PriceListValues.php +++ b/app/Repositories/Shop/PriceListValues.php @@ -15,7 +15,6 @@ class PriceListValues return [ 'unities' => Unities::getOptions(), 'taxes_options' => Taxes::getOptions(), - 'categories' => PriceListValueCategories::getOptions(), ]; } diff --git a/app/Repositories/Shop/Tariffs.php b/app/Repositories/Shop/Tariffs.php index 429e595f..b66082bf 100644 --- a/app/Repositories/Shop/Tariffs.php +++ b/app/Repositories/Shop/Tariffs.php @@ -26,7 +26,7 @@ class Tariffs public static function autocomplete($str) { - $data = Tariff::byAutocomplete($str)->orderBy('name')->limit(30)->get()->pluck('name', 'id'); + $data = Tariff::byAutocomplete($str)->orderBy('name')->limit(30)->pluck('name', 'id'); $export = []; foreach ($data as $key => $name) { $export[] = ['value' => $key, 'text' => $name]; diff --git a/app/Repositories/Shop/Taxes.php b/app/Repositories/Shop/Taxes.php index 9ee31547..a9a20186 100644 --- a/app/Repositories/Shop/Taxes.php +++ b/app/Repositories/Shop/Taxes.php @@ -11,7 +11,7 @@ class Taxes public static function getOptions() { - return Tax::orderBy('value', 'asc')->get()->pluck('value', 'id')->toArray(); + return Tax::orderBy('value', 'asc')->pluck('value', 'id')->toArray(); } public static function getAll() diff --git a/app/Repositories/Shop/Unities.php b/app/Repositories/Shop/Unities.php index 288dc500..b3c93ef7 100644 --- a/app/Repositories/Shop/Unities.php +++ b/app/Repositories/Shop/Unities.php @@ -11,12 +11,12 @@ class Unities public static function getOptions() { - return Unity::orderBy('value', 'asc')->get()->pluck('value', 'id')->toArray(); + return Unity::orderBy('value', 'asc')->pluck('value', 'id')->toArray(); } public static function getOptionsByPackage($package_id) { - return Unity::byPackage($package_id)->orderBy('value', 'asc')->get()->pluck('value', 'id')->toArray(); + return Unity::byPackage($package_id)->orderBy('value', 'asc')->pluck('value', 'id')->toArray(); } public static function getAll() diff --git a/app/Repositories/Shop/Variations.php b/app/Repositories/Shop/Variations.php index 2dca18e0..ef5ab412 100644 --- a/app/Repositories/Shop/Variations.php +++ b/app/Repositories/Shop/Variations.php @@ -20,7 +20,7 @@ class Variations public static function autocomplete($str) { - $data = Variation::where('name', 'LIKE', "%{$str}%")->orderBy('name')->limit(30)->get()->pluck('name', 'id'); + $data = Variation::where('name', 'LIKE', "%{$str}%")->orderBy('name')->limit(30)->pluck('name', 'id'); $export = []; foreach ($data as $key => $name) { $export[] = ['value' => $key, 'text' => $name]; diff --git a/app/Repositories/Users.php b/app/Repositories/Users.php deleted file mode 100644 index 0d113427..00000000 --- a/app/Repositories/Users.php +++ /dev/null @@ -1,18 +0,0 @@ -toArray() : false; - - return $data; - } -} diff --git a/app/Traits/Model/Basic.php b/app/Traits/Model/Basic.php index 1490d4e5..e6165dad 100644 --- a/app/Traits/Model/Basic.php +++ b/app/Traits/Model/Basic.php @@ -79,7 +79,7 @@ trait Basic public static function edit($id) { - return self::get($id)->toArray(); + return self::getArray($id); } public static function store($data, $stopStamping = false) diff --git a/app/Traits/Model/HasComments.php b/app/Traits/Model/HasComments.php index 441e7579..5433b887 100644 --- a/app/Traits/Model/HasComments.php +++ b/app/Traits/Model/HasComments.php @@ -2,8 +2,8 @@ namespace App\Traits\Model; -use App\Contracts\Commentator; use App\Models\Core\Comment; +use App\Repositories\Core\Auth\Users; use Illuminate\Database\Eloquent\Model; trait HasComments @@ -15,19 +15,46 @@ trait HasComments public function comment(string $comment) { - return $this->commentAsUser(auth()->user(), $comment); + $user = Users::getUser(); + + return $this->commentAsUser($user, $comment); } public function commentAsUser(?Model $user, string $comment) { - $comment = new Comment([ - 'comment' => $comment, - 'is_approved' => $user instanceof Commentator ? ! $user->needsCommentApproval($this) : false, - 'user_id' => is_null($user) ? null : $user->getKey(), - 'commentable_id' => $this->getKey(), - 'commentable_type' => get_class(), - ]); + if (trim(strip_tags($comment))) { + $data = new Comment([ + 'comment' => $comment, + // 'is_approved' => ($user instanceof CanComment) ? ! $user->needsCommentApproval($this) : false, + 'is_approved' => true, + 'commenter_id' => is_null($user) ? null : $user->getKey(), + 'commenter_type' => is_null($user) ? null : $user::class, + 'commentable_id' => $this->getKey(), + 'commentable_type' => $this::class, + ]); - return $this->comments()->save($comment); + return $this->comments()->save($data); + } + + return false; + } + + public function commentAsGuest($guest, string $comment) + { + if (trim(strip_tags($comment))) { + $data = new Comment([ + 'comment' => $comment, + 'guest_name' => $guest['name'], + 'guest_email' => $guest['email'], + // 'is_approved' => ($guest instanceof CanComment) ? ! $guest->needsCommentApproval($this) : false, + 'is_approved' => true, + 'commentable_id' => $this->getKey(), + 'commentable_type' => $this::class, + ]); + + return $this->comments()->save($data); + } + + return false; } } diff --git a/app/Update.php b/app/Update.php deleted file mode 100644 index 2ff22d15..00000000 --- a/app/Update.php +++ /dev/null @@ -1,30 +0,0 @@ -external('composer', 'install', '--no-dev', '--prefer-dist', '--optimize-autoloader') - ->external('npm', 'install', '--production') - ->external('npm', 'run', 'production') - ->artisan('route:cache') - ->artisan('config:cache') - ->artisan('event:cache') - ->artisan('migrate', ['--force' => true]) - ->artisan('cache:clear') - ->artisan('queue:restart'); // ->artisan('horizon:terminate'); - } - - public function local(Runner $run) - { - $run->external('composer', 'install') - ->external('npm', 'install') - ->external('npm', 'run', 'development') - ->artisan('migrate') - ->artisan('cache:clear'); - } -} diff --git a/app/User.php b/app/User.php index 43439d20..ecf9c03a 100644 --- a/app/User.php +++ b/app/User.php @@ -2,125 +2,8 @@ namespace App; -use Carbon\Carbon; -use Illuminate\Database\Eloquent\SoftDeletes; -use Illuminate\Foundation\Auth\User as Authenticatable; -use Illuminate\Notifications\Notifiable; -use Laratrust\Traits\LaratrustUserTrait; -use Mpociot\Teamwork\Traits\UserHasTeams; -use Sebastienheyd\Boilerplate\Notifications\NewUser as NewUserNotification; -use Sebastienheyd\Boilerplate\Notifications\ResetPassword as ResetPasswordNotification; -use Yadahan\AuthenticationLog\AuthenticationLogable; +use Sebastienheyd\Boilerplate\Models\User as parentUser; -class User extends Authenticatable +class User extends parentUser { - use AuthenticationLogable; - use LaratrustUserTrait; - use Notifiable; - use SoftDeletes; - use UserHasTeams; - - protected $fillable = ['active', 'last_name', 'first_name', 'email', 'password', 'remember_token', 'last_login']; - - protected $hidden = ['password', 'remember_token']; - - protected $casts = [ - 'email_verified_at' => 'datetime', - ]; - - public function teams() - { - return $this->hasManyThrough( - 'App\Models\Core\Auth\Team', - 'App\Models\Core\Auth\TeamUser', - 'user_id', - 'id', - 'id', - 'team_id' - ); - } - - public function scopeByTeam($query, $id) - { - return $query->whereHas('teams', function ($query) use ($id) { - $query->where('id', $id); - }); - } - - public function scopeByUniqueTeam($query) - { - return $query->has('teams', '=', 1); - } - - public function scopeActive($query) - { - return $query->where('active', 1); - } - - public function sendPasswordResetNotification($token) - { - $this->notify(new ResetPasswordNotification($token)); - } - - public function sendNewUserNotification($token) - { - $this->notify(new NewUserNotification($token, $this)); - } - - public function getLastNameAttribute($value) - { - return mb_strtoupper($value); - } - - public function getFirstNameAttribute($value) - { - return mb_convert_case($value, MB_CASE_TITLE); - } - - public function getNameAttribute($value) - { - if ($value ?? false) { - return $value; - } - - return $this->first_name.' '.$this->last_name; - } - - public function getLastLogin($format = 'YYYY-MM-DD HH:mm:ss', $default = '') - { - if ($this->last_login === null) { - return $default; - } - - return Carbon::createFromTimeString($this->last_login)->isoFormat($format); - } - - public function getRolesList() - { - $res = []; - foreach ($this->roles as $role) { - $res[] = __($role->display_name); - } - if (! $res ?? true) { - return '-'; - } - - return implode(', ', $res); - } - - public function getAvatarPathAttribute() - { - return public_path('images/avatars/'.md5($this->id.$this->email).'.jpg'); - } - - public function getAvatarUrlAttribute() - { - if (is_file($this->avatar_path)) { - $ts = filemtime($this->avatar_path); - - return asset('images/avatars/'.md5($this->id.$this->email).'.jpg?t='.$ts); - } - - return asset('/assets/vendor/boilerplate/images/default-user.png'); - } } diff --git a/config/backup.php b/config/backup.php deleted file mode 100644 index 20cbfa7d..00000000 --- a/config/backup.php +++ /dev/null @@ -1,266 +0,0 @@ - [ - - /* - * The name of this application. You can use this name to monitor - * the backups. - */ - 'name' => env('APP_NAME', 'laravel-backup'), - - 'source' => [ - - 'files' => [ - - /* - * The list of directories and files that will be included in the backup. - */ - 'include' => [ - base_path(), - ], - - /* - * These directories and files will be excluded from the backup. - * - * Directories used by the backup process will automatically be excluded. - */ - 'exclude' => [ - base_path('vendor'), - base_path('node_modules'), - ], - - /* - * Determines if symlinks should be followed. - */ - 'follow_links' => false, - - /* - * Determines if it should avoid unreadable folders. - */ - 'ignore_unreadable_directories' => false, - - /* - * This path is used to make directories in resulting zip-file relative - * Set to `null` to include complete absolute path - * Example: base_path() - */ - 'relative_path' => null, - ], - - /* - * The names of the connections to the databases that should be backed up - * MySQL, PostgreSQL, SQLite and Mongo databases are supported. - * - * The content of the database dump may be customized for each connection - * by adding a 'dump' key to the connection settings in config/database.php. - * E.g. - * 'mysql' => [ - * ... - * 'dump' => [ - * 'excludeTables' => [ - * 'table_to_exclude_from_backup', - * 'another_table_to_exclude' - * ] - * ], - * ], - * - * If you are using only InnoDB tables on a MySQL server, you can - * also supply the useSingleTransaction option to avoid table locking. - * - * E.g. - * 'mysql' => [ - * ... - * 'dump' => [ - * 'useSingleTransaction' => true, - * ], - * ], - * - * For a complete list of available customization options, see https://github.com/spatie/db-dumper - */ - 'databases' => [ - 'mysql', - ], - ], - - /* - * The database dump can be compressed to decrease diskspace usage. - * - * Out of the box Laravel-backup supplies - * Spatie\DbDumper\Compressors\GzipCompressor::class. - * - * You can also create custom compressor. More info on that here: - * https://github.com/spatie/db-dumper#using-compression - * - * If you do not want any compressor at all, set it to null. - */ - 'database_dump_compressor' => null, - - /* - * The file extension used for the database dump files. - * - * If not specified, the file extension will be .archive for MongoDB and .sql for all other databases - * The file extension should be specified without a leading . - */ - 'database_dump_file_extension' => '', - - 'destination' => [ - - /* - * The filename prefix used for the backup zip file. - */ - 'filename_prefix' => '', - - /* - * The disk names on which the backups will be stored. - */ - 'disks' => [ - 'local', - ], - ], - - /* - * The directory where the temporary files will be stored. - */ - 'temporary_directory' => storage_path('app/backup-temp'), - - /* - * The password to be used for archive encryption. - * Set to `null` to disable encryption. - */ - 'password' => env('BACKUP_ARCHIVE_PASSWORD'), - - /* - * The encryption algorithm to be used for archive encryption. - * You can set it to `null` or `false` to disable encryption. - * - * When set to 'default', we'll use ZipArchive::EM_AES_256 if it is - * available on your system. - */ - 'encryption' => 'default', - ], - - /* - * You can get notified when specific events occur. Out of the box you can use 'mail' and 'slack'. - * For Slack you need to install laravel/slack-notification-channel. - * - * You can also use your own notification classes, just make sure the class is named after one of - * the `Spatie\Backup\Events` classes. - */ - 'notifications' => [ - - 'notifications' => [ - \Spatie\Backup\Notifications\Notifications\BackupHasFailed::class => ['mail'], - \Spatie\Backup\Notifications\Notifications\UnhealthyBackupWasFound::class => ['mail'], - \Spatie\Backup\Notifications\Notifications\CleanupHasFailed::class => ['mail'], - \Spatie\Backup\Notifications\Notifications\BackupWasSuccessful::class => ['mail'], - \Spatie\Backup\Notifications\Notifications\HealthyBackupWasFound::class => ['mail'], - \Spatie\Backup\Notifications\Notifications\CleanupWasSuccessful::class => ['mail'], - ], - - /* - * Here you can specify the notifiable to which the notifications should be sent. The default - * notifiable will use the variables specified in this config file. - */ - 'notifiable' => \Spatie\Backup\Notifications\Notifiable::class, - - 'mail' => [ - 'to' => 'your@example.com', - - 'from' => [ - 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'), - 'name' => env('MAIL_FROM_NAME', 'Example'), - ], - ], - - 'slack' => [ - 'webhook_url' => '', - - /* - * If this is set to null the default channel of the webhook will be used. - */ - 'channel' => null, - - 'username' => null, - - 'icon' => null, - - ], - ], - - /* - * Here you can specify which backups should be monitored. - * If a backup does not meet the specified requirements the - * UnHealthyBackupWasFound event will be fired. - */ - 'monitor_backups' => [ - [ - 'name' => env('APP_NAME', 'laravel-backup'), - 'disks' => ['local'], - 'health_checks' => [ - \Spatie\Backup\Tasks\Monitor\HealthChecks\MaximumAgeInDays::class => 1, - \Spatie\Backup\Tasks\Monitor\HealthChecks\MaximumStorageInMegabytes::class => 5000, - ], - ], - - /* - [ - 'name' => 'name of the second app', - 'disks' => ['local', 's3'], - 'health_checks' => [ - \Spatie\Backup\Tasks\Monitor\HealthChecks\MaximumAgeInDays::class => 1, - \Spatie\Backup\Tasks\Monitor\HealthChecks\MaximumStorageInMegabytes::class => 5000, - ], - ], - */ - ], - - 'cleanup' => [ - /* - * The strategy that will be used to cleanup old backups. The default strategy - * will keep all backups for a certain amount of days. After that period only - * a daily backup will be kept. After that period only weekly backups will - * be kept and so on. - * - * No matter how you configure it the default strategy will never - * delete the newest backup. - */ - 'strategy' => \Spatie\Backup\Tasks\Cleanup\Strategies\DefaultStrategy::class, - - 'default_strategy' => [ - - /* - * The number of days for which backups must be kept. - */ - 'keep_all_backups_for_days' => 7, - - /* - * The number of days for which daily backups must be kept. - */ - 'keep_daily_backups_for_days' => 16, - - /* - * The number of weeks for which one weekly backup must be kept. - */ - 'keep_weekly_backups_for_weeks' => 8, - - /* - * The number of months for which one monthly backup must be kept. - */ - 'keep_monthly_backups_for_months' => 4, - - /* - * The number of years for which one yearly backup must be kept. - */ - 'keep_yearly_backups_for_years' => 2, - - /* - * After cleaning up the backups remove the oldest backup until - * this amount of megabytes has been reached. - */ - 'delete_oldest_backups_when_using_more_megabytes_than' => 5000, - ], - ], - -]; diff --git a/config/comments.php b/config/comments.php deleted file mode 100644 index 80f765f8..00000000 --- a/config/comments.php +++ /dev/null @@ -1,18 +0,0 @@ - \BeyondCode\Comments\Comment::class, - - /* - * The user model that should be used when associating comments with - * commentators. If null, the default user provider from your - * Laravel authentication configuration will be used. - */ - 'user_model' => null, - -]; diff --git a/config/health/config.php b/config/health/config.php index e91e4974..35051785 100644 --- a/config/health/config.php +++ b/config/health/config.php @@ -10,7 +10,7 @@ return [ | corner of the window. Feel free to edit this value to suit your needs. | */ - 'title' => 'FgDigital Monitoring checking', + 'title' => 'Monitoring checking', /* |-------------------------------------------------------------------------- diff --git a/config/ignition.php b/config/ignition.php deleted file mode 100644 index dce4fd51..00000000 --- a/config/ignition.php +++ /dev/null @@ -1,126 +0,0 @@ - env('IGNITION_EDITOR', 'phpstorm'), - - /* - |-------------------------------------------------------------------------- - | Theme - |-------------------------------------------------------------------------- - | - | Here you may specify which theme Ignition should use. - | - | Supported: "light", "dark", "auto" - | - */ - - 'theme' => env('IGNITION_THEME', 'light'), - - /* - |-------------------------------------------------------------------------- - | Sharing - |-------------------------------------------------------------------------- - | - | You can share local errors with colleagues or others around the world. - | Sharing is completely free and doesn't require an account on Flare. - | - | If necessary, you can completely disable sharing below. - | - */ - - 'enable_share_button' => env('IGNITION_SHARING_ENABLED', true), - - /* - |-------------------------------------------------------------------------- - | Register Ignition commands - |-------------------------------------------------------------------------- - | - | Ignition comes with an additional make command that lets you create - | new solution classes more easily. To keep your default Laravel - | installation clean, this command is not registered by default. - | - | You can enable the command registration below. - | - */ - 'register_commands' => env('REGISTER_IGNITION_COMMANDS', false), - - /* - |-------------------------------------------------------------------------- - | Ignored Solution Providers - |-------------------------------------------------------------------------- - | - | You may specify a list of solution providers (as fully qualified class - | names) that shouldn't be loaded. Ignition will ignore these classes - | and possible solutions provided by them will never be displayed. - | - */ - - 'ignored_solution_providers' => [ - \Facade\Ignition\SolutionProviders\MissingPackageSolutionProvider::class, - ], - - /* - |-------------------------------------------------------------------------- - | Runnable Solutions - |-------------------------------------------------------------------------- - | - | Some solutions that Ignition displays are runnable and can perform - | various tasks. Runnable solutions are enabled when your app has - | debug mode enabled. You may also fully disable this feature. - | - */ - - 'enable_runnable_solutions' => env('IGNITION_ENABLE_RUNNABLE_SOLUTIONS', null), - - /* - |-------------------------------------------------------------------------- - | Remote Path Mapping - |-------------------------------------------------------------------------- - | - | If you are using a remote dev server, like Laravel Homestead, Docker, or - | even a remote VPS, it will be necessary to specify your path mapping. - | - | Leaving one, or both of these, empty or null will not trigger the remote - | URL changes and Ignition will treat your editor links as local files. - | - | "remote_sites_path" is an absolute base path for your sites or projects - | in Homestead, Vagrant, Docker, or another remote development server. - | - | Example value: "/home/vagrant/Code" - | - | "local_sites_path" is an absolute base path for your sites or projects - | on your local computer where your IDE or code editor is running on. - | - | Example values: "/Users//Code", "C:\Users\\Documents\Code" - | - */ - - 'remote_sites_path' => env('IGNITION_REMOTE_SITES_PATH', ''), - 'local_sites_path' => env('IGNITION_LOCAL_SITES_PATH', ''), - - /* - |-------------------------------------------------------------------------- - | Housekeeping Endpoint Prefix - |-------------------------------------------------------------------------- - | - | Ignition registers a couple of routes when it is enabled. Below you may - | specify a route prefix that will be used to host all internal links. - | - */ - 'housekeeping_endpoint_prefix' => '_ignition', - -]; diff --git a/config/laratrust.php b/config/laratrust.php deleted file mode 100644 index 3ce7412e..00000000 --- a/config/laratrust.php +++ /dev/null @@ -1,334 +0,0 @@ - false, - - /* - |-------------------------------------------------------------------------- - | Which permissions and role checker to use. - |-------------------------------------------------------------------------- - | - | Defines if you want to use the roles and permissions checker. - | Available: - | - default: Check for the roles and permissions using the method that Laratrust - has always used. - | - query: Check for the roles and permissions using direct queries to the database. - | This method doesn't support cache yet. - | - */ - 'checker' => 'default', - - /* - |-------------------------------------------------------------------------- - | Cache - |-------------------------------------------------------------------------- - | - | Manage Laratrust's cache configurations. It uses the driver defined in the - | config/cache.php file. - | - */ - 'cache' => [ - /* - |-------------------------------------------------------------------------- - | Use cache in the package - |-------------------------------------------------------------------------- - | - | Defines if Laratrust will use Laravel's Cache to cache the roles and permissions. - | NOTE: Currently the database check does not use cache. - | - */ - 'enabled' => env('LARATRUST_ENABLE_CACHE', true), - - /* - |-------------------------------------------------------------------------- - | Time to store in cache Laratrust's roles and permissions. - |-------------------------------------------------------------------------- - | - | Determines the time in SECONDS to store Laratrust's roles and permissions in the cache. - | - */ - 'expiration_time' => 3600, - ], - - /* - |-------------------------------------------------------------------------- - | Laratrust User Models - |-------------------------------------------------------------------------- - | - | This is the array that contains the information of the user models. - | This information is used in the add-trait command, for the roles and - | permissions relationships with the possible user models, and the - | administration panel to attach roles and permissions to the users. - | - | The key in the array is the name of the relationship inside the roles and permissions. - | - */ - 'user_models' => [ - 'users' => \App\Models\User::class, - ], - - /* - |-------------------------------------------------------------------------- - | Laratrust Models - |-------------------------------------------------------------------------- - | - | These are the models used by Laratrust to define the roles, permissions and teams. - | If you want the Laratrust models to be in a different namespace or - | to have a different name, you can do it here. - | - */ - 'models' => [ - - 'role' => \App\Models\Role::class, - - 'permission' => \App\Models\Permission::class, - - /** - * Will be used only if the teams functionality is enabled. - */ - 'team' => \App\Models\Team::class, - ], - - /* - |-------------------------------------------------------------------------- - | Laratrust Tables - |-------------------------------------------------------------------------- - | - | These are the tables used by Laratrust to store all the authorization data. - | - */ - 'tables' => [ - - 'roles' => 'roles', - - 'permissions' => 'permissions', - - /** - * Will be used only if the teams functionality is enabled. - */ - 'teams' => 'teams', - - 'role_user' => 'role_user', - - 'permission_user' => 'permission_user', - - 'permission_role' => 'permission_role', - ], - - /* - |-------------------------------------------------------------------------- - | Laratrust Foreign Keys - |-------------------------------------------------------------------------- - | - | These are the foreign keys used by laratrust in the intermediate tables. - | - */ - 'foreign_keys' => [ - /** - * User foreign key on Laratrust's role_user and permission_user tables. - */ - 'user' => 'user_id', - - /** - * Role foreign key on Laratrust's role_user and permission_role tables. - */ - 'role' => 'role_id', - - /** - * Role foreign key on Laratrust's permission_user and permission_role tables. - */ - 'permission' => 'permission_id', - - /** - * Role foreign key on Laratrust's role_user and permission_user tables. - */ - 'team' => 'team_id', - ], - - /* - |-------------------------------------------------------------------------- - | Laratrust Middleware - |-------------------------------------------------------------------------- - | - | This configuration helps to customize the Laratrust middleware behavior. - | - */ - 'middleware' => [ - /** - * Define if the laratrust middleware are registered automatically in the service provider - */ - 'register' => true, - - /** - * Method to be called in the middleware return case. - * Available: abort|redirect - */ - 'handling' => 'abort', - - /** - * Handlers for the unauthorized method in the middlewares. - * The name of the handler must be the same as the handling. - */ - 'handlers' => [ - /** - * Aborts the execution with a 403 code and allows you to provide the response text - */ - 'abort' => [ - 'code' => 403, - 'message' => 'User does not have any of the necessary access rights.', - ], - - /** - * Redirects the user to the given url. - * If you want to flash a key to the session, - * you can do it by setting the key and the content of the message - * If the message content is empty it won't be added to the redirection. - */ - 'redirect' => [ - 'url' => '/home', - 'message' => [ - 'key' => 'error', - 'content' => '', - ], - ], - ], - ], - - 'teams' => [ - /* - |-------------------------------------------------------------------------- - | Use teams feature in the package - |-------------------------------------------------------------------------- - | - | Defines if Laratrust will use the teams feature. - | Please check the docs to see what you need to do in case you have the package already configured. - | - */ - 'enabled' => false, - - /* - |-------------------------------------------------------------------------- - | Strict check for roles/permissions inside teams - |-------------------------------------------------------------------------- - | - | Determines if a strict check should be done when checking if a role or permission - | is attached inside a team. - | If it's false, when checking a role/permission without specifying the team, - | it will check only if the user has attached that role/permission ignoring the team. - | - */ - 'strict_check' => false, - ], - - /* - |-------------------------------------------------------------------------- - | Laratrust Magic 'isAbleTo' Method - |-------------------------------------------------------------------------- - | - | Supported cases for the magic is able to method (Refer to the docs). - | Available: camel_case|snake_case|kebab_case - | - */ - 'magic_is_able_to_method_case' => 'kebab_case', - - /* - |-------------------------------------------------------------------------- - | Laratrust Permissions as Gates - |-------------------------------------------------------------------------- - | - | Determines if you can check if a user has a permission using the "can" method. - | - */ - 'permissions_as_gates' => false, - - /* - |-------------------------------------------------------------------------- - | Laratrust Panel - |-------------------------------------------------------------------------- - | - | Section to manage everything related with the admin panel for the roles and permissions. - | - */ - 'panel' => [ - /* - |-------------------------------------------------------------------------- - | Laratrust Panel Register - |-------------------------------------------------------------------------- - | - | This manages if routes used for the admin panel should be registered. - | Turn this value to false if you don't want to use Laratrust admin panel - | - */ - 'register' => false, - - /* - |-------------------------------------------------------------------------- - | Laratrust Panel Path - |-------------------------------------------------------------------------- - | - | This is the URI path where Laratrust panel for roles and permissions - | will be accessible from. - | - */ - 'path' => 'laratrust', - - /* - |-------------------------------------------------------------------------- - | Laratrust Panel Path - |-------------------------------------------------------------------------- - | - | The route where the go back link should point - | - */ - 'go_back_route' => '/', - - /* - |-------------------------------------------------------------------------- - | Laratrust Panel Route Middleware - |-------------------------------------------------------------------------- - | - | These middleware will get attached onto each Laratrust panel route. - | - */ - 'middleware' => ['web'], - - /* - |-------------------------------------------------------------------------- - | Enable permissions assignment - |-------------------------------------------------------------------------- - | - | Enable/Disable the permissions assignment to the users. - | - */ - 'assign_permissions_to_user' => true, - - /* - |-------------------------------------------------------------------------- - | Add restriction to roles in the panel - |-------------------------------------------------------------------------- - | - | Configure which roles can not be editable, deletable and removable. - | To add a role to the restriction, use name of the role here. - | - */ - 'roles_restrictions' => [ - // The user won't be able to remove roles already assigned to users. - 'not_removable' => [], - - // The user won't be able to edit the role and the permissions assigned. - 'not_editable' => [], - - // The user won't be able to delete the role. - 'not_deletable' => [], - ], - ], -]; diff --git a/config/teamwork.php b/config/teamwork.php deleted file mode 100644 index 58656d1b..00000000 --- a/config/teamwork.php +++ /dev/null @@ -1,84 +0,0 @@ - config('auth.providers.users.model', App\User::class), - - /* - |-------------------------------------------------------------------------- - | Teamwork users Table - |-------------------------------------------------------------------------- - | - | This is the users table name used by Teamwork. - | - */ - 'users_table' => 'users', - - /* - |-------------------------------------------------------------------------- - | Teamwork Team Model - |-------------------------------------------------------------------------- - | - | This is the Team model used by Teamwork to create correct relations. Update - | the team if it is in a different namespace. - | - */ - 'team_model' => Mpociot\Teamwork\TeamworkTeam::class, - - /* - |-------------------------------------------------------------------------- - | Teamwork teams Table - |-------------------------------------------------------------------------- - | - | This is the teams table name used by Teamwork to save teams to the database. - | - */ - 'teams_table' => 'teams', - - /* - |-------------------------------------------------------------------------- - | Teamwork team_user Table - |-------------------------------------------------------------------------- - | - | This is the team_user table used by Teamwork to save assigned teams to the - | database. - | - */ - 'team_user_table' => 'team_user', - - /* - |-------------------------------------------------------------------------- - | User Foreign key on Teamwork's team_user Table (Pivot) - |-------------------------------------------------------------------------- - */ - 'user_foreign_key' => 'id', - - /* - |-------------------------------------------------------------------------- - | Teamwork Team Invite Model - |-------------------------------------------------------------------------- - | - | This is the Team Invite model used by Teamwork to create correct relations. - | Update the team if it is in a different namespace. - | - */ - 'invite_model' => Mpociot\Teamwork\TeamInvite::class, - - /* - |-------------------------------------------------------------------------- - | Teamwork team invites Table - |-------------------------------------------------------------------------- - | - | This is the team invites table name used by Teamwork to save sent/pending - | invitation into teams to the database. - | - */ - 'team_invites_table' => 'team_invites', -]; diff --git a/config/twigbridge.php b/config/twigbridge.php deleted file mode 100644 index 1cbaa15a..00000000 --- a/config/twigbridge.php +++ /dev/null @@ -1,230 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Configuration options for Twig. - */ -return [ - - 'twig' => [ - /* - |-------------------------------------------------------------------------- - | Extension - |-------------------------------------------------------------------------- - | - | File extension for Twig view files. - | - */ - 'extension' => 'twig', - - /* - |-------------------------------------------------------------------------- - | Accepts all Twig environment configuration options - |-------------------------------------------------------------------------- - | - | http://twig.sensiolabs.org/doc/api.html#environment-options - | - */ - 'environment' => [ - - // When set to true, the generated templates have a __toString() method - // that you can use to display the generated nodes. - // default: false - 'debug' => env('APP_DEBUG', false), - - // The charset used by the templates. - // default: utf-8 - 'charset' => 'utf-8', - - // The base template class to use for generated templates. - // default: TwigBridge\Twig\Template - 'base_template_class' => 'TwigBridge\Twig\Template', - - // An absolute path where to store the compiled templates, or false to disable caching. If null - // then the cache file path is used. - // default: cache file storage path - 'cache' => null, - - // When developing with Twig, it's useful to recompile the template - // whenever the source code changes. If you don't provide a value - // for the auto_reload option, it will be determined automatically based on the debug value. - 'auto_reload' => true, - - // If set to false, Twig will silently ignore invalid variables - // (variables and or attributes/methods that do not exist) and - // replace them with a null value. When set to true, Twig throws an exception instead. - // default: false - 'strict_variables' => false, - - // If set to true, auto-escaping will be enabled by default for all templates. - // default: 'html' - 'autoescape' => 'html', - - // A flag that indicates which optimizations to apply - // (default to -1 -- all optimizations are enabled; set it to 0 to disable) - 'optimizations' => -1, - ], - - /* - |-------------------------------------------------------------------------- - | Safe Classes - |-------------------------------------------------------------------------- - | - | When set, the output of the `__string` method of the following classes will not be escaped. - | default: Laravel's Htmlable, which the HtmlString class implements. - | - */ - 'safe_classes' => [ - \Illuminate\Contracts\Support\Htmlable::class => ['html'], - ], - - /* - |-------------------------------------------------------------------------- - | Global variables - |-------------------------------------------------------------------------- - | - | These will always be passed in and can be accessed as Twig variables. - | NOTE: these will be overwritten if you pass data into the view with the same key. - | - */ - 'globals' => [], - ], - - 'extensions' => [ - - /* - |-------------------------------------------------------------------------- - | Extensions - |-------------------------------------------------------------------------- - | - | Enabled extensions. - | - | `Twig\Extension\DebugExtension` is enabled automatically if twig.debug is TRUE. - | - */ - 'enabled' => [ - 'TwigBridge\Extension\Loader\Facades', - 'TwigBridge\Extension\Loader\Filters', - 'TwigBridge\Extension\Loader\Functions', - - 'TwigBridge\Extension\Laravel\Auth', - 'TwigBridge\Extension\Laravel\Config', - 'TwigBridge\Extension\Laravel\Dump', - 'TwigBridge\Extension\Laravel\Input', - 'TwigBridge\Extension\Laravel\Session', - 'TwigBridge\Extension\Laravel\Str', - 'TwigBridge\Extension\Laravel\Translator', - 'TwigBridge\Extension\Laravel\Url', - 'TwigBridge\Extension\Laravel\Model', - // 'TwigBridge\Extension\Laravel\Gate', - - // 'TwigBridge\Extension\Laravel\Form', - // 'TwigBridge\Extension\Laravel\Html', - // 'TwigBridge\Extension\Laravel\Legacy\Facades', - ], - - /* - |-------------------------------------------------------------------------- - | Facades - |-------------------------------------------------------------------------- - | - | Available facades. Access like `{{ Config.get('foo.bar') }}`. - | - | Each facade can take an optional array of options. To mark the whole facade - | as safe you can set the option `'is_safe' => true`. Setting the facade as - | safe means that any HTML returned will not be escaped. - | - | It is advisable to not set the whole facade as safe and instead mark the - | each appropriate method as safe for security reasons. You can do that with - | the following syntax: - | - | - | 'Form' => [ - | 'is_safe' => [ - | 'open' - | ] - | ] - | - | - | The values of the `is_safe` array must match the called method on the facade - | in order to be marked as safe. - | - */ - 'facades' => [], - - /* - |-------------------------------------------------------------------------- - | Functions - |-------------------------------------------------------------------------- - | - | Available functions. Access like `{{ secure_url(...) }}`. - | - | Each function can take an optional array of options. These options are - | passed directly to `Twig\TwigFunction`. - | - | So for example, to mark a function as safe you can do the following: - | - | - | 'link_to' => [ - | 'is_safe' => ['html'] - | ] - | - | - | The options array also takes a `callback` that allows you to name the - | function differently in your Twig templates than what it's actually called. - | - | - | 'link' => [ - | 'callback' => 'link_to' - | ] - | - | - */ - 'functions' => [ - 'elixir', - 'head', - 'last', - 'mix', - ], - - /* - |-------------------------------------------------------------------------- - | Filters - |-------------------------------------------------------------------------- - | - | Available filters. Access like `{{ variable|filter }}`. - | - | Each filter can take an optional array of options. These options are - | passed directly to `Twig\TwigFilter`. - | - | So for example, to mark a filter as safe you can do the following: - | - | - | 'studly_case' => [ - | 'is_safe' => ['html'] - | ] - | - | - | The options array also takes a `callback` that allows you to name the - | filter differently in your Twig templates than what is actually called. - | - | - | 'snake' => [ - | 'callback' => 'snake_case' - | ] - | - | - */ - 'filters' => [ - 'get' => 'data_get', - ], - ], -]; diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php deleted file mode 100644 index 741edead..00000000 --- a/database/factories/UserFactory.php +++ /dev/null @@ -1,28 +0,0 @@ -define(User::class, function (Faker $faker) { - return [ - 'name' => $faker->name, - 'email' => $faker->unique()->safeEmail, - 'email_verified_at' => now(), - 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password - 'remember_token' => Str::random(10), - ]; -}); diff --git a/routes/Admin/Shop/Producers.php b/routes/Admin/Shop/Producers.php index b3dd9064..5cf79a6d 100644 --- a/routes/Admin/Shop/Producers.php +++ b/routes/Admin/Shop/Producers.php @@ -11,5 +11,4 @@ Route::prefix('Producers')->name('Producers.')->group(function () { Route::post('getSelect', 'ProducerController@getOptions')->name('getSelect'); Route::post('deleteImage', 'ProducerController@deleteImage')->name('deleteImage'); Route::any('getImages/{id?}/{can_edit?}', 'ProducerController@getImages')->name('getImages'); - Route::any('exportExcel', 'ProducerController@exportExcel')->name('exportExcel'); });