first commit
This commit is contained in:
18
.editorconfig
Normal file
18
.editorconfig
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
charset = utf-8
|
||||||
|
end_of_line = lf
|
||||||
|
indent_size = 4
|
||||||
|
indent_style = space
|
||||||
|
insert_final_newline = true
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
|
||||||
|
[*.md]
|
||||||
|
trim_trailing_whitespace = false
|
||||||
|
|
||||||
|
[*.{yml,yaml}]
|
||||||
|
indent_size = 2
|
||||||
|
|
||||||
|
[docker-compose.yml]
|
||||||
|
indent_size = 4
|
61
.env.example
Normal file
61
.env.example
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
APP_NAME=Laravel
|
||||||
|
APP_ENV=local
|
||||||
|
APP_KEY=base64:Fm7KoD+NfXaxQJwuqrGIf9VPJtTl+zLr3GFfnjeWrig=
|
||||||
|
APP_DEBUG=true
|
||||||
|
APP_URL=http://coreality-inc.awesome-tech.com.tw
|
||||||
|
|
||||||
|
LOG_CHANNEL=stack
|
||||||
|
LOG_DEPRECATIONS_CHANNEL=null
|
||||||
|
LOG_LEVEL=debug
|
||||||
|
|
||||||
|
DB_CONNECTION=mysql
|
||||||
|
DB_HOST=mysql5.7
|
||||||
|
DB_PORT=3306
|
||||||
|
DB_DATABASE=laravel
|
||||||
|
DB_USERNAME=root
|
||||||
|
DB_PASSWORD=secret
|
||||||
|
|
||||||
|
BROADCAST_DRIVER=log
|
||||||
|
CACHE_DRIVER=file
|
||||||
|
FILESYSTEM_DISK=local
|
||||||
|
QUEUE_CONNECTION=sync
|
||||||
|
SESSION_DRIVER=file
|
||||||
|
SESSION_LIFETIME=120
|
||||||
|
|
||||||
|
MEMCACHED_HOST=127.0.0.1
|
||||||
|
|
||||||
|
REDIS_HOST=redis6
|
||||||
|
REDIS_PASSWORD=null
|
||||||
|
REDIS_PORT=6379
|
||||||
|
|
||||||
|
MAIL_MAILER=smtp
|
||||||
|
MAIL_HOST=mailpit
|
||||||
|
MAIL_PORT=1025
|
||||||
|
MAIL_USERNAME=null
|
||||||
|
MAIL_PASSWORD=null
|
||||||
|
MAIL_ENCRYPTION=null
|
||||||
|
MAIL_FROM_ADDRESS="hello@example.com"
|
||||||
|
MAIL_FROM_NAME="${APP_NAME}"
|
||||||
|
|
||||||
|
AWS_ACCESS_KEY_ID=
|
||||||
|
AWS_SECRET_ACCESS_KEY=
|
||||||
|
AWS_DEFAULT_REGION=us-east-1
|
||||||
|
AWS_BUCKET=
|
||||||
|
AWS_USE_PATH_STYLE_ENDPOINT=false
|
||||||
|
|
||||||
|
PUSHER_APP_ID=
|
||||||
|
PUSHER_APP_KEY=
|
||||||
|
PUSHER_APP_SECRET=
|
||||||
|
PUSHER_HOST=
|
||||||
|
PUSHER_PORT=443
|
||||||
|
PUSHER_SCHEME=https
|
||||||
|
PUSHER_APP_CLUSTER=mt1
|
||||||
|
|
||||||
|
VITE_APP_NAME="${APP_NAME}"
|
||||||
|
VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
|
||||||
|
VITE_PUSHER_HOST="${PUSHER_HOST}"
|
||||||
|
VITE_PUSHER_PORT="${PUSHER_PORT}"
|
||||||
|
VITE_PUSHER_SCHEME="${PUSHER_SCHEME}"
|
||||||
|
VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
|
||||||
|
# SYSTEM PHP VERSION
|
||||||
|
SYS_PHP_VER=8.1
|
11
.gitattributes
vendored
Normal file
11
.gitattributes
vendored
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
* text=auto eol=lf
|
||||||
|
|
||||||
|
*.blade.php diff=html
|
||||||
|
*.css diff=css
|
||||||
|
*.html diff=html
|
||||||
|
*.md diff=markdown
|
||||||
|
*.php diff=php
|
||||||
|
|
||||||
|
/.github export-ignore
|
||||||
|
CHANGELOG.md export-ignore
|
||||||
|
.styleci.yml export-ignore
|
19
.gitignore
vendored
Normal file
19
.gitignore
vendored
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
/.phpunit.cache
|
||||||
|
/node_modules
|
||||||
|
/public/build
|
||||||
|
/public/hot
|
||||||
|
/public/storage
|
||||||
|
/storage/*.key
|
||||||
|
/vendor
|
||||||
|
.env
|
||||||
|
.env.backup
|
||||||
|
.env.production
|
||||||
|
.phpunit.result.cache
|
||||||
|
Homestead.json
|
||||||
|
Homestead.yaml
|
||||||
|
auth.json
|
||||||
|
npm-debug.log
|
||||||
|
yarn-error.log
|
||||||
|
/.fleet
|
||||||
|
/.idea
|
||||||
|
/.vscode
|
66
README.md
Normal file
66
README.md
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
<p align="center"><a href="https://laravel.com" target="_blank"><img src="https://raw.githubusercontent.com/laravel/art/master/logo-lockup/5%20SVG/2%20CMYK/1%20Full%20Color/laravel-logolockup-cmyk-red.svg" width="400" alt="Laravel Logo"></a></p>
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
|
<a href="https://github.com/laravel/framework/actions"><img src="https://github.com/laravel/framework/workflows/tests/badge.svg" alt="Build Status"></a>
|
||||||
|
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/dt/laravel/framework" alt="Total Downloads"></a>
|
||||||
|
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/v/laravel/framework" alt="Latest Stable Version"></a>
|
||||||
|
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/l/laravel/framework" alt="License"></a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
## About Laravel
|
||||||
|
|
||||||
|
Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:
|
||||||
|
|
||||||
|
- [Simple, fast routing engine](https://laravel.com/docs/routing).
|
||||||
|
- [Powerful dependency injection container](https://laravel.com/docs/container).
|
||||||
|
- Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage.
|
||||||
|
- Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent).
|
||||||
|
- Database agnostic [schema migrations](https://laravel.com/docs/migrations).
|
||||||
|
- [Robust background job processing](https://laravel.com/docs/queues).
|
||||||
|
- [Real-time event broadcasting](https://laravel.com/docs/broadcasting).
|
||||||
|
|
||||||
|
Laravel is accessible, powerful, and provides tools required for large, robust applications.
|
||||||
|
|
||||||
|
## Learning Laravel
|
||||||
|
|
||||||
|
Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework.
|
||||||
|
|
||||||
|
You may also try the [Laravel Bootcamp](https://bootcamp.laravel.com), where you will be guided through building a modern Laravel application from scratch.
|
||||||
|
|
||||||
|
If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains thousands of video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.
|
||||||
|
|
||||||
|
## Laravel Sponsors
|
||||||
|
|
||||||
|
We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the [Laravel Partners program](https://partners.laravel.com).
|
||||||
|
|
||||||
|
### Premium Partners
|
||||||
|
|
||||||
|
- **[Vehikl](https://vehikl.com/)**
|
||||||
|
- **[Tighten Co.](https://tighten.co)**
|
||||||
|
- **[WebReinvent](https://webreinvent.com/)**
|
||||||
|
- **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)**
|
||||||
|
- **[64 Robots](https://64robots.com)**
|
||||||
|
- **[Curotec](https://www.curotec.com/services/technologies/laravel/)**
|
||||||
|
- **[Cyber-Duck](https://cyber-duck.co.uk)**
|
||||||
|
- **[DevSquad](https://devsquad.com/hire-laravel-developers)**
|
||||||
|
- **[Jump24](https://jump24.co.uk)**
|
||||||
|
- **[Redberry](https://redberry.international/laravel/)**
|
||||||
|
- **[Active Logic](https://activelogic.com)**
|
||||||
|
- **[byte5](https://byte5.de)**
|
||||||
|
- **[OP.GG](https://op.gg)**
|
||||||
|
|
||||||
|
## Contributing
|
||||||
|
|
||||||
|
Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions).
|
||||||
|
|
||||||
|
## Code of Conduct
|
||||||
|
|
||||||
|
In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct).
|
||||||
|
|
||||||
|
## Security Vulnerabilities
|
||||||
|
|
||||||
|
If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [taylor@laravel.com](mailto:taylor@laravel.com). All security vulnerabilities will be promptly addressed.
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
|
27
app/Console/Kernel.php
Normal file
27
app/Console/Kernel.php
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Console;
|
||||||
|
|
||||||
|
use Illuminate\Console\Scheduling\Schedule;
|
||||||
|
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
||||||
|
|
||||||
|
class Kernel extends ConsoleKernel
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Define the application's command schedule.
|
||||||
|
*/
|
||||||
|
protected function schedule(Schedule $schedule): void
|
||||||
|
{
|
||||||
|
// $schedule->command('inspire')->hourly();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Register the commands for the application.
|
||||||
|
*/
|
||||||
|
protected function commands(): void
|
||||||
|
{
|
||||||
|
$this->load(__DIR__.'/Commands');
|
||||||
|
|
||||||
|
require base_path('routes/console.php');
|
||||||
|
}
|
||||||
|
}
|
30
app/Exceptions/Handler.php
Normal file
30
app/Exceptions/Handler.php
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Exceptions;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
||||||
|
use Throwable;
|
||||||
|
|
||||||
|
class Handler extends ExceptionHandler
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The list of the inputs that are never flashed to the session on validation exceptions.
|
||||||
|
*
|
||||||
|
* @var array<int, string>
|
||||||
|
*/
|
||||||
|
protected $dontFlash = [
|
||||||
|
'current_password',
|
||||||
|
'password',
|
||||||
|
'password_confirmation',
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Register the exception handling callbacks for the application.
|
||||||
|
*/
|
||||||
|
public function register(): void
|
||||||
|
{
|
||||||
|
$this->reportable(function (Throwable $e) {
|
||||||
|
//
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
13
app/Http/Controllers/AboutController.php
Normal file
13
app/Http/Controllers/AboutController.php
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class AboutController extends Controller
|
||||||
|
{
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
return view('about');
|
||||||
|
}
|
||||||
|
}
|
93
app/Http/Controllers/Admin/EventCatalogCrudController.php
Normal file
93
app/Http/Controllers/Admin/EventCatalogCrudController.php
Normal file
@ -0,0 +1,93 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin;
|
||||||
|
|
||||||
|
use App\Http\Requests\EventCatalogRequest;
|
||||||
|
use Backpack\CRUD\app\Http\Controllers\CrudController;
|
||||||
|
use Backpack\CRUD\app\Library\CrudPanel\CrudPanelFacade as CRUD;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class EventCatalogCrudController
|
||||||
|
* @package App\Http\Controllers\Admin
|
||||||
|
* @property-read \Backpack\CRUD\app\Library\CrudPanel\CrudPanel $crud
|
||||||
|
*/
|
||||||
|
class EventCatalogCrudController extends CrudController
|
||||||
|
{
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\ListOperation;
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\CreateOperation;
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\UpdateOperation;
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\DeleteOperation;
|
||||||
|
// use \Backpack\CRUD\app\Http\Controllers\Operations\ShowOperation;
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\ReorderOperation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configure the CrudPanel object. Apply settings to all operations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function setup()
|
||||||
|
{
|
||||||
|
CRUD::setModel(\App\Models\EventCatalog::class);
|
||||||
|
CRUD::setRoute(config('backpack.base.route_prefix') . '/event-catalog');
|
||||||
|
CRUD::setEntityNameStrings(trans('backend.event.catalog.item'), trans('backend.event.catalog.items'));
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function setupReorderOperation()
|
||||||
|
{
|
||||||
|
CRUD::set('reorder.label', 'name');
|
||||||
|
CRUD::set('reorder.max_level', 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define what happens when the List operation is loaded.
|
||||||
|
*
|
||||||
|
* @see https://backpackforlaravel.com/docs/crud-operation-list-entries
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
protected function setupListOperation()
|
||||||
|
{
|
||||||
|
if (! $this->crud->getRequest()->has('order')){
|
||||||
|
$this->crud->orderBy('lft', 'asc')->orderBy('id', 'desc');
|
||||||
|
}
|
||||||
|
|
||||||
|
CRUD::addColumn('#');
|
||||||
|
CRUD::column('is_front_show')->label(trans('backend.columnName.is_front_show'))->type('checkbox');
|
||||||
|
CRUD::column('name')->label(trans('backend.columnName.name'))->type('textarea_nl2br')->escaped(false)->searchLogic('text');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define what happens when the Create operation is loaded.
|
||||||
|
*
|
||||||
|
* @see https://backpackforlaravel.com/docs/crud-operation-create
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
protected function setupCreateOperation()
|
||||||
|
{
|
||||||
|
CRUD::setValidation(EventCatalogRequest::class);
|
||||||
|
CRUD::addFields([
|
||||||
|
[
|
||||||
|
'name' => 'is_front_show',
|
||||||
|
'label' => trans('backend.columnName.is_front_show'),
|
||||||
|
'type' => 'boolean',
|
||||||
|
'default' => true,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'name',
|
||||||
|
'lable' => 'Name',
|
||||||
|
'type' => 'text',
|
||||||
|
],
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define what happens when the Update operation is loaded.
|
||||||
|
*
|
||||||
|
* @see https://backpackforlaravel.com/docs/crud-operation-update
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
protected function setupUpdateOperation()
|
||||||
|
{
|
||||||
|
$this->setupCreateOperation();
|
||||||
|
}
|
||||||
|
}
|
156
app/Http/Controllers/Admin/EventCrudController.php
Normal file
156
app/Http/Controllers/Admin/EventCrudController.php
Normal file
@ -0,0 +1,156 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin;
|
||||||
|
|
||||||
|
use App\Http\Requests\EventRequest;
|
||||||
|
use Backpack\CRUD\app\Http\Controllers\CrudController;
|
||||||
|
use Backpack\CRUD\app\Library\CrudPanel\CrudPanelFacade as CRUD;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class EventCrudController
|
||||||
|
* @package App\Http\Controllers\Admin
|
||||||
|
* @property-read \Backpack\CRUD\app\Library\CrudPanel\CrudPanel $crud
|
||||||
|
*/
|
||||||
|
class EventCrudController extends CrudController
|
||||||
|
{
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\ListOperation;
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\CreateOperation;
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\UpdateOperation;
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\DeleteOperation;
|
||||||
|
// use \Backpack\CRUD\app\Http\Controllers\Operations\ShowOperation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configure the CrudPanel object. Apply settings to all operations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function setup()
|
||||||
|
{
|
||||||
|
CRUD::setModel(\App\Models\Event::class);
|
||||||
|
CRUD::setRoute(config('backpack.base.route_prefix') . '/event');
|
||||||
|
CRUD::setEntityNameStrings(trans('backend.event.content.item'), trans('backend.event.content.items'));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define what happens when the List operation is loaded.
|
||||||
|
*
|
||||||
|
* @see https://backpackforlaravel.com/docs/crud-operation-list-entries
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
protected function setupListOperation()
|
||||||
|
{
|
||||||
|
$this->crud->addColumns([
|
||||||
|
[
|
||||||
|
'name' => 'post_at',
|
||||||
|
'label' => trans('backend.columnName.post_at'),
|
||||||
|
'type' => 'datetime',
|
||||||
|
'format' => 'YYYY/MM/DD HH:mm:SS',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'is_front_show',
|
||||||
|
'label' => trans('backend.columnName.is_front_show'),
|
||||||
|
'type' => 'checkbox'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'title',
|
||||||
|
'label' => trans('backend.columnName.title'),
|
||||||
|
'type' => 'text'
|
||||||
|
]
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define what happens when the Create operation is loaded.
|
||||||
|
*
|
||||||
|
* @see https://backpackforlaravel.com/docs/crud-operation-create
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
protected function setupCreateOperation()
|
||||||
|
{
|
||||||
|
CRUD::setValidation(EventRequest::class);
|
||||||
|
$this->crud->addFields([
|
||||||
|
[
|
||||||
|
'name' => 'event_catalog_id',
|
||||||
|
'label' => trans('backend.columnName.catalog'),
|
||||||
|
'type' => 'select2_nested',
|
||||||
|
'entity' => 'eventCatalog',
|
||||||
|
'attribute' => 'name',
|
||||||
|
'model' => 'App\Models\EventCatalog',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'post_at',
|
||||||
|
'label' => trans('backend.columnName.post_at'),
|
||||||
|
'type' => 'datetime',
|
||||||
|
'format' => 'YYYY/MM/DD HH:mm:SS',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'is_front_show',
|
||||||
|
'label' => trans('backend.columnName.is_front_show'),
|
||||||
|
'type' => 'boolean'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'title',
|
||||||
|
'label' => trans('backend.columnName.title'),
|
||||||
|
'type' => 'text'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'photos',
|
||||||
|
'label' => trans('backend.columnName.cover'),
|
||||||
|
'type' => 'upload_img_multiple',
|
||||||
|
'upload' => true,
|
||||||
|
'disk' => 'public',
|
||||||
|
'hint' => '',
|
||||||
|
'qty' => 1, // 0=no limit, >0=limit
|
||||||
|
'showSingleChoise' => '0', // 0=hidden, 1=show(default)
|
||||||
|
'showComment' => '0', // 0=hidden, 1=show(default)
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'venue',
|
||||||
|
'label' => trans('backend.columnName.venue'),
|
||||||
|
'type' => 'text'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'contact',
|
||||||
|
'label' => trans('backend.columnName.contact'),
|
||||||
|
'type' => 'text'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'body',
|
||||||
|
'lable' => trans('backend.columnName.body'),
|
||||||
|
'type' => 'tinymce',
|
||||||
|
// optional overwrite of the configuration array
|
||||||
|
'options' => [
|
||||||
|
//'selector' => 'textarea.tinymce',
|
||||||
|
//'skin' => 'dick-light',
|
||||||
|
'plugins' => 'lists advlist image link media anchor table hr imagetools importcss insertdatetime paste searchreplace textcolor textpattern help',
|
||||||
|
'menubar' => 'edit insert view format help',
|
||||||
|
'toolbar' => 'undo redo bold italic alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | table image media link',
|
||||||
|
'language' => str_replace('-', '_', app()->getLocale()),
|
||||||
|
'height' => '500px',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
[
|
||||||
|
'name' => 'seo_keyword',
|
||||||
|
'label' => trans('backend.columnName.seo_keyword'),
|
||||||
|
'type' => 'text'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'seo_description',
|
||||||
|
'label' => trans('backend.columnName.seo_description'),
|
||||||
|
'type' => 'textarea'
|
||||||
|
],
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define what happens when the Update operation is loaded.
|
||||||
|
*
|
||||||
|
* @see https://backpackforlaravel.com/docs/crud-operation-update
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
protected function setupUpdateOperation()
|
||||||
|
{
|
||||||
|
$this->setupCreateOperation();
|
||||||
|
}
|
||||||
|
}
|
123
app/Http/Controllers/Admin/HomeCarouselCrudController.php
Normal file
123
app/Http/Controllers/Admin/HomeCarouselCrudController.php
Normal file
@ -0,0 +1,123 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin;
|
||||||
|
|
||||||
|
use App\Http\Requests\HomeCarouselRequest;
|
||||||
|
use Backpack\CRUD\app\Http\Controllers\CrudController;
|
||||||
|
use Backpack\CRUD\app\Library\CrudPanel\CrudPanelFacade as CRUD;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class HomeCarouselCrudController
|
||||||
|
* @package App\Http\Controllers\Admin
|
||||||
|
* @property-read \Backpack\CRUD\app\Library\CrudPanel\CrudPanel $crud
|
||||||
|
*/
|
||||||
|
class HomeCarouselCrudController extends CrudController
|
||||||
|
{
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\ListOperation;
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\CreateOperation;
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\UpdateOperation;
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\DeleteOperation;
|
||||||
|
//use \Backpack\CRUD\app\Http\Controllers\Operations\ShowOperation;
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\ReorderOperation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configure the CrudPanel object. Apply settings to all operations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function setup()
|
||||||
|
{
|
||||||
|
CRUD::setModel(\App\Models\HomeCarousel::class);
|
||||||
|
CRUD::setRoute(config('backpack.base.route_prefix') . '/home-carousel');
|
||||||
|
CRUD::setEntityNameStrings(trans('backend.home_carousel.content.item'), trans('backend.home_carousel.content.items'));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function setupReorderOperation()
|
||||||
|
{
|
||||||
|
CRUD::set('reorder.label', 'title');
|
||||||
|
CRUD::set('reorder.max_level', 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define what happens when the List operation is loaded.
|
||||||
|
*
|
||||||
|
* @see https://backpackforlaravel.com/docs/crud-operation-list-entries
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
protected function setupListOperation()
|
||||||
|
{
|
||||||
|
if (! $this->crud->getRequest()->has('order')){
|
||||||
|
$this->crud->orderBy('lft', 'asc')->orderBy('id', 'desc');
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->crud->addColumns([
|
||||||
|
[
|
||||||
|
'name' => 'is_front_show',
|
||||||
|
'label' => trans('backend.columnName.is_front_show'),
|
||||||
|
'type' => 'checkbox'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'title',
|
||||||
|
'label' => trans('backend.columnName.title'),
|
||||||
|
'type' => 'text'
|
||||||
|
]
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define what happens when the Create operation is loaded.
|
||||||
|
*
|
||||||
|
* @see https://backpackforlaravel.com/docs/crud-operation-create
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
protected function setupCreateOperation()
|
||||||
|
{
|
||||||
|
CRUD::setValidation(HomeCarouselRequest::class);
|
||||||
|
CRUD::addFields([
|
||||||
|
[
|
||||||
|
'name' => 'is_front_show',
|
||||||
|
'label' => trans('backend.columnName.is_front_show'),
|
||||||
|
'type' => 'boolean',
|
||||||
|
'default' => true,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'title',
|
||||||
|
'label' => trans('backend.columnName.title'),
|
||||||
|
'type' => 'text'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'body',
|
||||||
|
'label' => trans('backend.columnName.body'),
|
||||||
|
'type' => 'textarea'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'link',
|
||||||
|
'label' => trans('backend.columnName.link'),
|
||||||
|
'type' => 'text'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'photos',
|
||||||
|
'label' => trans('backend.columnName.cover'),
|
||||||
|
'type' => 'upload_img_multiple',
|
||||||
|
'upload' => true,
|
||||||
|
'disk' => 'public',
|
||||||
|
'hint' => '',
|
||||||
|
'qty' => 1, // 0=no limit, >0=limit
|
||||||
|
'showSingleChoise' => '0', // 0=hidden, 1=show(default)
|
||||||
|
'showComment' => '0', // 0=hidden, 1=show(default)
|
||||||
|
],
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define what happens when the Update operation is loaded.
|
||||||
|
*
|
||||||
|
* @see https://backpackforlaravel.com/docs/crud-operation-update
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
protected function setupUpdateOperation()
|
||||||
|
{
|
||||||
|
$this->setupCreateOperation();
|
||||||
|
}
|
||||||
|
}
|
93
app/Http/Controllers/Admin/NewsCatalogCrudController.php
Normal file
93
app/Http/Controllers/Admin/NewsCatalogCrudController.php
Normal file
@ -0,0 +1,93 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin;
|
||||||
|
|
||||||
|
use App\Http\Requests\NewsCatalogRequest;
|
||||||
|
use Backpack\CRUD\app\Http\Controllers\CrudController;
|
||||||
|
use Backpack\CRUD\app\Library\CrudPanel\CrudPanelFacade as CRUD;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class NewsCatalogCrudController
|
||||||
|
* @package App\Http\Controllers\Admin
|
||||||
|
* @property-read \Backpack\CRUD\app\Library\CrudPanel\CrudPanel $crud
|
||||||
|
*/
|
||||||
|
class NewsCatalogCrudController extends CrudController
|
||||||
|
{
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\ListOperation;
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\CreateOperation;
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\UpdateOperation;
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\DeleteOperation;
|
||||||
|
// use \Backpack\CRUD\app\Http\Controllers\Operations\ShowOperation;
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\ReorderOperation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configure the CrudPanel object. Apply settings to all operations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function setup()
|
||||||
|
{
|
||||||
|
CRUD::setModel(\App\Models\NewsCatalog::class);
|
||||||
|
CRUD::setRoute(config('backpack.base.route_prefix') . '/news-catalog');
|
||||||
|
CRUD::setEntityNameStrings(trans('backend.news.catalog.item'), trans('backend.news.catalog.items'));
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function setupReorderOperation()
|
||||||
|
{
|
||||||
|
CRUD::set('reorder.label', 'name');
|
||||||
|
CRUD::set('reorder.max_level', 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define what happens when the List operation is loaded.
|
||||||
|
*
|
||||||
|
* @see https://backpackforlaravel.com/docs/crud-operation-list-entries
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
protected function setupListOperation()
|
||||||
|
{
|
||||||
|
if (! $this->crud->getRequest()->has('order')){
|
||||||
|
$this->crud->orderBy('lft', 'asc')->orderBy('id', 'desc');
|
||||||
|
}
|
||||||
|
|
||||||
|
CRUD::addColumn('#');
|
||||||
|
CRUD::column('is_front_show')->label(trans('backend.columnName.is_front_show'))->type('checkbox');
|
||||||
|
CRUD::column('name')->label(trans('backend.columnName.name'))->type('textarea_nl2br')->escaped(false)->searchLogic('text');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define what happens when the Create operation is loaded.
|
||||||
|
*
|
||||||
|
* @see https://backpackforlaravel.com/docs/crud-operation-create
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
protected function setupCreateOperation()
|
||||||
|
{
|
||||||
|
CRUD::setValidation(NewsCatalogRequest::class);
|
||||||
|
CRUD::addFields([
|
||||||
|
[
|
||||||
|
'name' => 'is_front_show',
|
||||||
|
'label' => trans('backend.columnName.is_front_show'),
|
||||||
|
'type' => 'boolean',
|
||||||
|
'default' => true,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'name',
|
||||||
|
'lable' => 'Name',
|
||||||
|
'type' => 'text',
|
||||||
|
],
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define what happens when the Update operation is loaded.
|
||||||
|
*
|
||||||
|
* @see https://backpackforlaravel.com/docs/crud-operation-update
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
protected function setupUpdateOperation()
|
||||||
|
{
|
||||||
|
$this->setupCreateOperation();
|
||||||
|
}
|
||||||
|
}
|
155
app/Http/Controllers/Admin/NewsCrudController.php
Normal file
155
app/Http/Controllers/Admin/NewsCrudController.php
Normal file
@ -0,0 +1,155 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin;
|
||||||
|
|
||||||
|
use App\Http\Requests\NewsRequest;
|
||||||
|
use Backpack\CRUD\app\Http\Controllers\CrudController;
|
||||||
|
use Backpack\CRUD\app\Library\CrudPanel\CrudPanelFacade as CRUD;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class NewsCrudController
|
||||||
|
* @package App\Http\Controllers\Admin
|
||||||
|
* @property-read \Backpack\CRUD\app\Library\CrudPanel\CrudPanel $crud
|
||||||
|
*/
|
||||||
|
class NewsCrudController extends CrudController
|
||||||
|
{
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\ListOperation;
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\CreateOperation;
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\UpdateOperation;
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\DeleteOperation;
|
||||||
|
// use \Backpack\CRUD\app\Http\Controllers\Operations\ShowOperation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configure the CrudPanel object. Apply settings to all operations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function setup()
|
||||||
|
{
|
||||||
|
CRUD::setModel(\App\Models\News::class);
|
||||||
|
CRUD::setRoute(config('backpack.base.route_prefix') . '/news');
|
||||||
|
CRUD::setEntityNameStrings(trans('backend.news.content.item'), trans('backend.news.content.items'));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define what happens when the List operation is loaded.
|
||||||
|
*
|
||||||
|
* @see https://backpackforlaravel.com/docs/crud-operation-list-entries
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
protected function setupListOperation()
|
||||||
|
{
|
||||||
|
$this->crud->addColumns([
|
||||||
|
[
|
||||||
|
'name' => 'post_at',
|
||||||
|
'label' => trans('backend.columnName.post_at'),
|
||||||
|
'type' => 'datetime',
|
||||||
|
'format' => 'YYYY/MM/DD HH:mm:SS',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'is_front_show',
|
||||||
|
'label' => trans('backend.columnName.is_front_show'),
|
||||||
|
'type' => 'checkbox'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'title',
|
||||||
|
'label' => trans('backend.columnName.title'),
|
||||||
|
'type' => 'text'
|
||||||
|
]
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define what happens when the Create operation is loaded.
|
||||||
|
*
|
||||||
|
* @see https://backpackforlaravel.com/docs/crud-operation-create
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
protected function setupCreateOperation()
|
||||||
|
{
|
||||||
|
CRUD::setValidation(NewsRequest::class);
|
||||||
|
$this->crud->addFields([
|
||||||
|
[
|
||||||
|
'name' => 'news_catalog_id',
|
||||||
|
'label' => trans('backend.columnName.catalog'),
|
||||||
|
'type' => 'select2_nested',
|
||||||
|
'entity' => 'newsCatalog',
|
||||||
|
'attribute' => 'name',
|
||||||
|
'model' => 'App\Models\NewsCatalog',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'post_at',
|
||||||
|
'label' => trans('backend.columnName.post_at'),
|
||||||
|
'type' => 'datetime',
|
||||||
|
'format' => 'YYYY/MM/DD HH:mm:SS',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'is_front_show',
|
||||||
|
'label' => trans('backend.columnName.is_front_show'),
|
||||||
|
'type' => 'boolean'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'title',
|
||||||
|
'label' => trans('backend.columnName.title'),
|
||||||
|
'type' => 'text'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'photos',
|
||||||
|
'label' => trans('backend.columnName.cover'),
|
||||||
|
'type' => 'upload_img_multiple',
|
||||||
|
'upload' => true,
|
||||||
|
'disk' => 'public',
|
||||||
|
'hint' => '',
|
||||||
|
'qty' => 1, // 0=no limit, >0=limit
|
||||||
|
'showSingleChoise' => '0', // 0=hidden, 1=show(default)
|
||||||
|
'showComment' => '0', // 0=hidden, 1=show(default)
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'description',
|
||||||
|
'label' => trans('backend.columnName.description'),
|
||||||
|
'type' => 'textarea'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'body',
|
||||||
|
'lable' => trans('backend.columnName.body'),
|
||||||
|
'type' => 'tinymce',
|
||||||
|
// optional overwrite of the configuration array
|
||||||
|
'options' => [
|
||||||
|
//'selector' => 'textarea.tinymce',
|
||||||
|
//'skin' => 'dick-light',
|
||||||
|
'plugins' => 'lists advlist image link media anchor table hr imagetools importcss insertdatetime paste searchreplace textcolor textpattern help',
|
||||||
|
'menubar' => 'edit insert view format help',
|
||||||
|
'toolbar' => 'undo redo bold italic alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | table image media link',
|
||||||
|
'language' => str_replace('-', '_', app()->getLocale()),
|
||||||
|
'height' => '500px',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'source_links',
|
||||||
|
'lable' => 'Source Links',
|
||||||
|
'type' => 'key_val_multiple',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'seo_keyword',
|
||||||
|
'label' => trans('backend.columnName.seo_keyword'),
|
||||||
|
'type' => 'text'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'seo_description',
|
||||||
|
'label' => trans('backend.columnName.seo_description'),
|
||||||
|
'type' => 'textarea'
|
||||||
|
],
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define what happens when the Update operation is loaded.
|
||||||
|
*
|
||||||
|
* @see https://backpackforlaravel.com/docs/crud-operation-update
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
protected function setupUpdateOperation()
|
||||||
|
{
|
||||||
|
$this->setupCreateOperation();
|
||||||
|
}
|
||||||
|
}
|
75
app/Http/Controllers/Admin/PermissionCrudController.php
Normal file
75
app/Http/Controllers/Admin/PermissionCrudController.php
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin;
|
||||||
|
|
||||||
|
use Backpack\PermissionManager\app\Http\Controllers\PermissionCrudController as OrgController;
|
||||||
|
use Backpack\PermissionManager\app\Http\Requests\PermissionStoreCrudRequest as StoreRequest;
|
||||||
|
use Backpack\PermissionManager\app\Http\Requests\PermissionUpdateCrudRequest as UpdateRequest;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class PermissionCrudController
|
||||||
|
* @package App\Http\Controllers\Admin
|
||||||
|
* @property-read \Backpack\CRUD\app\Library\CrudPanel\CrudPanel $crud
|
||||||
|
*/
|
||||||
|
class PermissionCrudController extends OrgController
|
||||||
|
{
|
||||||
|
public function setupCreateOperation()
|
||||||
|
{
|
||||||
|
$this->addFields();
|
||||||
|
$this->crud->setValidation(StoreRequest::class);
|
||||||
|
|
||||||
|
//otherwise, changes won't have effect
|
||||||
|
\Cache::forget('spatie.permission.cache');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setupUpdateOperation()
|
||||||
|
{
|
||||||
|
$this->addFields();
|
||||||
|
$this->crud->setValidation(UpdateRequest::class);
|
||||||
|
|
||||||
|
//otherwise, changes won't have effect
|
||||||
|
\Cache::forget('spatie.permission.cache');
|
||||||
|
}
|
||||||
|
|
||||||
|
private function addFields()
|
||||||
|
{
|
||||||
|
$this->crud->addField([
|
||||||
|
'name' => 'slug',
|
||||||
|
'label' => 'Slug',
|
||||||
|
'type' => 'text',
|
||||||
|
]);
|
||||||
|
|
||||||
|
$this->crud->addField([
|
||||||
|
'name' => 'name',
|
||||||
|
'label' => trans('backpack::permissionmanager.name'),
|
||||||
|
'type' => 'text',
|
||||||
|
]);
|
||||||
|
|
||||||
|
if (config('backpack.permissionmanager.multiple_guards')) {
|
||||||
|
$this->crud->addField([
|
||||||
|
'name' => 'guard_name',
|
||||||
|
'label' => trans('backpack::permissionmanager.guard_type'),
|
||||||
|
'type' => 'select_from_array',
|
||||||
|
'options' => $this->getGuardTypes(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Get an array list of all available guard types
|
||||||
|
* that have been defined in app/config/auth.php
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
**/
|
||||||
|
private function getGuardTypes()
|
||||||
|
{
|
||||||
|
$guards = config('auth.guards');
|
||||||
|
|
||||||
|
$returnable = [];
|
||||||
|
foreach ($guards as $key => $details) {
|
||||||
|
$returnable[$key] = $key;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $returnable;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,99 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin;
|
||||||
|
|
||||||
|
use App\Http\Requests\ProductApplicationRequest;
|
||||||
|
use Backpack\CRUD\app\Http\Controllers\CrudController;
|
||||||
|
use Backpack\CRUD\app\Library\CrudPanel\CrudPanelFacade as CRUD;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class ProductApplicationCrudController
|
||||||
|
* @package App\Http\Controllers\Admin
|
||||||
|
* @property-read \Backpack\CRUD\app\Library\CrudPanel\CrudPanel $crud
|
||||||
|
*/
|
||||||
|
class ProductApplicationCrudController extends CrudController
|
||||||
|
{
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\ListOperation;
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\CreateOperation;
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\UpdateOperation;
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\DeleteOperation;
|
||||||
|
// use \Backpack\CRUD\app\Http\Controllers\Operations\ShowOperation;
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\ReorderOperation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configure the CrudPanel object. Apply settings to all operations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function setup()
|
||||||
|
{
|
||||||
|
CRUD::setModel(\App\Models\ProductApplication::class);
|
||||||
|
CRUD::setRoute(config('backpack.base.route_prefix') . '/product-application');
|
||||||
|
CRUD::setEntityNameStrings(trans('backend.product.application.item'), trans('backend.product.application.items'));
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function setupReorderOperation()
|
||||||
|
{
|
||||||
|
CRUD::set('reorder.label', 'name');
|
||||||
|
CRUD::set('reorder.max_level', 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define what happens when the List operation is loaded.
|
||||||
|
*
|
||||||
|
* @see https://backpackforlaravel.com/docs/crud-operation-list-entries
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
protected function setupListOperation()
|
||||||
|
{
|
||||||
|
if (! $this->crud->getRequest()->has('order')){
|
||||||
|
$this->crud->orderBy('lft', 'asc')->orderBy('id', 'desc');
|
||||||
|
}
|
||||||
|
|
||||||
|
CRUD::addColumn('#');
|
||||||
|
CRUD::column('is_front_show')->label(trans('backend.columnName.is_front_show'))->type('checkbox');
|
||||||
|
CRUD::column('slug')->label(trans('backend.columnName.slug'))->type('textarea_nl2br')->escaped(false)->searchLogic('text');
|
||||||
|
CRUD::column('name')->label(trans('backend.columnName.name'))->type('textarea_nl2br')->escaped(false)->searchLogic('text');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define what happens when the Create operation is loaded.
|
||||||
|
*
|
||||||
|
* @see https://backpackforlaravel.com/docs/crud-operation-create
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
protected function setupCreateOperation()
|
||||||
|
{
|
||||||
|
CRUD::setValidation(ProductApplicationRequest::class);
|
||||||
|
CRUD::addFields([
|
||||||
|
[
|
||||||
|
'name' => 'is_front_show',
|
||||||
|
'label' => trans('backend.columnName.is_front_show'),
|
||||||
|
'type' => 'boolean',
|
||||||
|
'default' => true,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'slug',
|
||||||
|
'lable' => trans('backend.columnName.slug'),
|
||||||
|
'type' => 'text',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'name',
|
||||||
|
'lable' => trans('backend.columnName.name'),
|
||||||
|
'type' => 'text',
|
||||||
|
],
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define what happens when the Update operation is loaded.
|
||||||
|
*
|
||||||
|
* @see https://backpackforlaravel.com/docs/crud-operation-update
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
protected function setupUpdateOperation()
|
||||||
|
{
|
||||||
|
$this->setupCreateOperation();
|
||||||
|
}
|
||||||
|
}
|
99
app/Http/Controllers/Admin/ProductCatalogCrudController.php
Normal file
99
app/Http/Controllers/Admin/ProductCatalogCrudController.php
Normal file
@ -0,0 +1,99 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin;
|
||||||
|
|
||||||
|
use App\Http\Requests\ProductCatalogRequest;
|
||||||
|
use Backpack\CRUD\app\Http\Controllers\CrudController;
|
||||||
|
use Backpack\CRUD\app\Library\CrudPanel\CrudPanelFacade as CRUD;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class ProductCatalogCrudController
|
||||||
|
* @package App\Http\Controllers\Admin
|
||||||
|
* @property-read \Backpack\CRUD\app\Library\CrudPanel\CrudPanel $crud
|
||||||
|
*/
|
||||||
|
class ProductCatalogCrudController extends CrudController
|
||||||
|
{
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\ListOperation;
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\CreateOperation;
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\UpdateOperation;
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\DeleteOperation;
|
||||||
|
// use \Backpack\CRUD\app\Http\Controllers\Operations\ShowOperation;
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\ReorderOperation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configure the CrudPanel object. Apply settings to all operations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function setup()
|
||||||
|
{
|
||||||
|
CRUD::setModel(\App\Models\ProductCatalog::class);
|
||||||
|
CRUD::setRoute(config('backpack.base.route_prefix') . '/product-catalog');
|
||||||
|
CRUD::setEntityNameStrings(trans('backend.product.catalog.item'), trans('backend.product.catalog.items'));
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function setupReorderOperation()
|
||||||
|
{
|
||||||
|
CRUD::set('reorder.label', 'name');
|
||||||
|
CRUD::set('reorder.max_level', 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define what happens when the List operation is loaded.
|
||||||
|
*
|
||||||
|
* @see https://backpackforlaravel.com/docs/crud-operation-list-entries
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
protected function setupListOperation()
|
||||||
|
{
|
||||||
|
if (! $this->crud->getRequest()->has('order')){
|
||||||
|
$this->crud->orderBy('lft', 'asc')->orderBy('id', 'desc');
|
||||||
|
}
|
||||||
|
|
||||||
|
CRUD::addColumn('#');
|
||||||
|
CRUD::column('is_front_show')->label(trans('backend.columnName.is_front_show'))->type('checkbox');
|
||||||
|
CRUD::column('slug')->label(trans('backend.columnName.slug'))->type('textarea_nl2br')->escaped(false)->searchLogic('text');
|
||||||
|
CRUD::column('name')->label(trans('backend.columnName.name'))->type('textarea_nl2br')->escaped(false)->searchLogic('text');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define what happens when the Create operation is loaded.
|
||||||
|
*
|
||||||
|
* @see https://backpackforlaravel.com/docs/crud-operation-create
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
protected function setupCreateOperation()
|
||||||
|
{
|
||||||
|
CRUD::setValidation(ProductCatalogRequest::class);
|
||||||
|
CRUD::addFields([
|
||||||
|
[
|
||||||
|
'name' => 'is_front_show',
|
||||||
|
'label' => trans('backend.columnName.is_front_show'),
|
||||||
|
'type' => 'boolean',
|
||||||
|
'default' => true,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'slug',
|
||||||
|
'lable' => trans('backend.columnName.slug'),
|
||||||
|
'type' => 'text',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'name',
|
||||||
|
'lable' => trans('backend.columnName.name'),
|
||||||
|
'type' => 'text',
|
||||||
|
],
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define what happens when the Update operation is loaded.
|
||||||
|
*
|
||||||
|
* @see https://backpackforlaravel.com/docs/crud-operation-update
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
protected function setupUpdateOperation()
|
||||||
|
{
|
||||||
|
$this->setupCreateOperation();
|
||||||
|
}
|
||||||
|
}
|
233
app/Http/Controllers/Admin/ProductCrudController.php
Normal file
233
app/Http/Controllers/Admin/ProductCrudController.php
Normal file
@ -0,0 +1,233 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin;
|
||||||
|
|
||||||
|
use App\Http\Requests\ProductRequest;
|
||||||
|
use Backpack\CRUD\app\Http\Controllers\CrudController;
|
||||||
|
use Backpack\CRUD\app\Library\CrudPanel\CrudPanelFacade as CRUD;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class ProductCrudController
|
||||||
|
* @package App\Http\Controllers\Admin
|
||||||
|
* @property-read \Backpack\CRUD\app\Library\CrudPanel\CrudPanel $crud
|
||||||
|
*/
|
||||||
|
class ProductCrudController extends CrudController
|
||||||
|
{
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\ListOperation;
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\CreateOperation;
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\UpdateOperation;
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\DeleteOperation;
|
||||||
|
//use \Backpack\CRUD\app\Http\Controllers\Operations\ShowOperation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configure the CrudPanel object. Apply settings to all operations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function setup()
|
||||||
|
{
|
||||||
|
CRUD::setModel(\App\Models\Product::class);
|
||||||
|
CRUD::setRoute(config('backpack.base.route_prefix') . '/product');
|
||||||
|
CRUD::setEntityNameStrings(trans('backend.product.content.item'), trans('backend.product.content.items'));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define what happens when the List operation is loaded.
|
||||||
|
*
|
||||||
|
* @see https://backpackforlaravel.com/docs/crud-operation-list-entries
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
protected function setupListOperation()
|
||||||
|
{
|
||||||
|
$this->crud->addColumns([
|
||||||
|
[
|
||||||
|
'name' => 'product_catalog_id',
|
||||||
|
'label' => trans('backend.columnName.catalog'),
|
||||||
|
'type' => 'select',
|
||||||
|
'entity' => 'productCatalog',
|
||||||
|
'attribute' => 'name',
|
||||||
|
'model' => 'App\Models\ProductCatalog',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'title',
|
||||||
|
'label' => trans('backend.columnName.title'),
|
||||||
|
'type' => 'text'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'is_front_show',
|
||||||
|
'label' => trans('backend.columnName.is_front_show'),
|
||||||
|
'type' => 'checkbox'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'tip',
|
||||||
|
'label' => trans('backend.columnName.tip'),
|
||||||
|
'type' => 'select_from_array',
|
||||||
|
'options' => [
|
||||||
|
'none' => trans('backend.product.tip_options.none'),
|
||||||
|
'new' => trans('backend.product.tip_options.new'),
|
||||||
|
'on_sale' => trans('backend.product.tip_options.on_sale'),
|
||||||
|
],
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'description',
|
||||||
|
'label' => trans('backend.columnName.description'),
|
||||||
|
'type' => 'text'
|
||||||
|
],
|
||||||
|
]);
|
||||||
|
|
||||||
|
$this->crud->addFilter(
|
||||||
|
[
|
||||||
|
'name' => 'product_catalog_id',
|
||||||
|
'type' => 'dropdown',
|
||||||
|
'label' => trans('backend.columnName.catalog'),
|
||||||
|
],
|
||||||
|
\App\Models\ProductCatalog::all()->pluck('name', 'id')->toArray(),
|
||||||
|
function ($value) { // if the filter is active
|
||||||
|
$this->crud->addClause('whereHas', 'productCatalog', function ($query) use ($value) {
|
||||||
|
$query->where('product_catalog_id', '=', $value);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define what happens when the Create operation is loaded.
|
||||||
|
*
|
||||||
|
* @see https://backpackforlaravel.com/docs/crud-operation-create
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
protected function setupCreateOperation()
|
||||||
|
{
|
||||||
|
CRUD::setValidation(ProductRequest::class);
|
||||||
|
$this->crud->addFields([
|
||||||
|
[
|
||||||
|
'name' => 'product_catalog_id',
|
||||||
|
'label' => trans('backend.columnName.catalog'),
|
||||||
|
'type' => 'select2_nested',
|
||||||
|
'entity' => 'productCatalog',
|
||||||
|
'attribute' => 'name',
|
||||||
|
'model' => 'App\Models\ProductCatalog',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'productApplications',
|
||||||
|
'label' => trans('backend.columnName.application'),
|
||||||
|
'type' => 'select2_multiple',
|
||||||
|
'entity' => 'productApplications',
|
||||||
|
'attribute' => 'name',
|
||||||
|
'model' => 'App\Models\ProductApplication',
|
||||||
|
'pivot' => true,
|
||||||
|
'allows_null' => true,
|
||||||
|
'select_all' => true,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'slug',
|
||||||
|
'lable' => trans('backend.columnName.slug'),
|
||||||
|
'type' => 'text',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'title',
|
||||||
|
'label' => trans('backend.columnName.title'),
|
||||||
|
'type' => 'text'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'is_front_show',
|
||||||
|
'label' => trans('backend.columnName.is_front_show'),
|
||||||
|
'type' => 'boolean'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'tip',
|
||||||
|
'label' => trans('backend.columnName.tip'),
|
||||||
|
'type' => 'select2_from_array',
|
||||||
|
'options' => [
|
||||||
|
'none' => trans('backend.product.tip_options.none'),
|
||||||
|
'new' => trans('backend.product.tip_options.new'),
|
||||||
|
'on_sale' => trans('backend.product.tip_options.on_sale'),
|
||||||
|
],
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'photos',
|
||||||
|
'label' => trans('backend.columnName.photos'),
|
||||||
|
'type' => 'upload_img_multiple',
|
||||||
|
'upload' => true,
|
||||||
|
'disk' => 'public',
|
||||||
|
'hint' => '',
|
||||||
|
'qty' => 0, // 0=no limit, >0=limit
|
||||||
|
'showSingleChoise' => '1', // 0=hidden, 1=show(default)
|
||||||
|
'showComment' => '1', // 0=hidden, 1=show(default)
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'description',
|
||||||
|
'label' => trans('backend.columnName.description'),
|
||||||
|
'type' => 'textarea'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'body',
|
||||||
|
'lable' => trans('backend.columnName.body'),
|
||||||
|
'type' => 'tinymce',
|
||||||
|
// optional overwrite of the configuration array
|
||||||
|
'options' => [
|
||||||
|
//'selector' => 'textarea.tinymce',
|
||||||
|
//'skin' => 'dick-light',
|
||||||
|
'plugins' => 'lists advlist image link media anchor table hr imagetools importcss insertdatetime paste searchreplace textcolor textpattern help',
|
||||||
|
'menubar' => 'edit insert view format help',
|
||||||
|
'toolbar' => 'undo redo bold italic alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | table image media link',
|
||||||
|
'language' => str_replace('-', '_', app()->getLocale()),
|
||||||
|
'height' => '500px',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'feature_overview',
|
||||||
|
'lable' => trans('backend.columnName.feature_overview'),
|
||||||
|
'type' => 'tinymce',
|
||||||
|
// optional overwrite of the configuration array
|
||||||
|
'options' => [
|
||||||
|
//'selector' => 'textarea.tinymce',
|
||||||
|
//'skin' => 'dick-light',
|
||||||
|
'plugins' => 'lists advlist image link media anchor table hr imagetools importcss insertdatetime paste searchreplace textcolor textpattern help',
|
||||||
|
'menubar' => 'edit insert view format help',
|
||||||
|
'toolbar' => 'undo redo bold italic alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | table image media link',
|
||||||
|
'language' => str_replace('-', '_', app()->getLocale()),
|
||||||
|
'height' => '500px',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
[
|
||||||
|
'name' => 'feature_spec',
|
||||||
|
'lable' => trans('backend.columnName.feature_spec'),
|
||||||
|
'type' => 'tinymce',
|
||||||
|
// optional overwrite of the configuration array
|
||||||
|
'options' => [
|
||||||
|
//'selector' => 'textarea.tinymce',
|
||||||
|
//'skin' => 'dick-light',
|
||||||
|
'plugins' => 'lists advlist image link media anchor table hr imagetools importcss insertdatetime paste searchreplace textcolor textpattern help',
|
||||||
|
'menubar' => 'edit insert view format help',
|
||||||
|
'toolbar' => 'undo redo bold italic alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | table image media link',
|
||||||
|
'language' => str_replace('-', '_', app()->getLocale()),
|
||||||
|
'height' => '500px',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
[
|
||||||
|
'name' => 'seo_keyword',
|
||||||
|
'label' => trans('backend.columnName.seo_keyword'),
|
||||||
|
'type' => 'text'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'seo_description',
|
||||||
|
'label' => trans('backend.columnName.seo_description'),
|
||||||
|
'type' => 'textarea'
|
||||||
|
],
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define what happens when the Update operation is loaded.
|
||||||
|
*
|
||||||
|
* @see https://backpackforlaravel.com/docs/crud-operation-update
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
protected function setupUpdateOperation()
|
||||||
|
{
|
||||||
|
$this->setupCreateOperation();
|
||||||
|
}
|
||||||
|
}
|
85
app/Http/Controllers/Admin/RoleCrudController.php
Normal file
85
app/Http/Controllers/Admin/RoleCrudController.php
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin;
|
||||||
|
|
||||||
|
use Backpack\PermissionManager\app\Http\Controllers\RoleCrudController as OrgController;
|
||||||
|
use Backpack\PermissionManager\app\Http\Requests\RoleStoreCrudRequest as StoreRequest;
|
||||||
|
use Backpack\PermissionManager\app\Http\Requests\RoleUpdateCrudRequest as UpdateRequest;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class RoleCrudController
|
||||||
|
* @package App\Http\Controllers\Admin
|
||||||
|
* @property-read \Backpack\CRUD\app\Library\CrudPanel\CrudPanel $crud
|
||||||
|
*/
|
||||||
|
class RoleCrudController extends OrgController
|
||||||
|
{
|
||||||
|
public function setupCreateOperation()
|
||||||
|
{
|
||||||
|
$this->addFields();
|
||||||
|
$this->crud->setValidation(StoreRequest::class);
|
||||||
|
|
||||||
|
//otherwise, changes won't have effect
|
||||||
|
\Cache::forget('spatie.permission.cache');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setupUpdateOperation()
|
||||||
|
{
|
||||||
|
$this->addFields();
|
||||||
|
$this->crud->setValidation(UpdateRequest::class);
|
||||||
|
|
||||||
|
//otherwise, changes won't have effect
|
||||||
|
\Cache::forget('spatie.permission.cache');
|
||||||
|
}
|
||||||
|
|
||||||
|
private function addFields()
|
||||||
|
{
|
||||||
|
$this->crud->addField([
|
||||||
|
'name' => 'slug',
|
||||||
|
'label' => 'Slug',
|
||||||
|
'type' => 'text',
|
||||||
|
]);
|
||||||
|
|
||||||
|
$this->crud->addField([
|
||||||
|
'name' => 'name',
|
||||||
|
'label' => trans('backpack::permissionmanager.name'),
|
||||||
|
'type' => 'text',
|
||||||
|
]);
|
||||||
|
|
||||||
|
if (config('backpack.permissionmanager.multiple_guards')) {
|
||||||
|
$this->crud->addField([
|
||||||
|
'name' => 'guard_name',
|
||||||
|
'label' => trans('backpack::permissionmanager.guard_type'),
|
||||||
|
'type' => 'select_from_array',
|
||||||
|
'options' => $this->getGuardTypes(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->crud->addField([
|
||||||
|
'label' => mb_ucfirst(trans('backpack::permissionmanager.permission_plural')),
|
||||||
|
'type' => 'checklist',
|
||||||
|
'name' => 'permissions',
|
||||||
|
'entity' => 'permissions',
|
||||||
|
'attribute' => 'name',
|
||||||
|
'model' => $this->permission_model,
|
||||||
|
'pivot' => true,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Get an array list of all available guard types
|
||||||
|
* that have been defined in app/config/auth.php
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
**/
|
||||||
|
private function getGuardTypes()
|
||||||
|
{
|
||||||
|
$guards = config('auth.guards');
|
||||||
|
|
||||||
|
$returnable = [];
|
||||||
|
foreach ($guards as $key => $details) {
|
||||||
|
$returnable[$key] = $key;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $returnable;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,93 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin;
|
||||||
|
|
||||||
|
use App\Http\Requests\SupportDistributionPartnerCatalogRequest;
|
||||||
|
use Backpack\CRUD\app\Http\Controllers\CrudController;
|
||||||
|
use Backpack\CRUD\app\Library\CrudPanel\CrudPanelFacade as CRUD;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class SupportDistributionPartnerCatalogCrudController
|
||||||
|
* @package App\Http\Controllers\Admin
|
||||||
|
* @property-read \Backpack\CRUD\app\Library\CrudPanel\CrudPanel $crud
|
||||||
|
*/
|
||||||
|
class SupportDistributionPartnerCatalogCrudController extends CrudController
|
||||||
|
{
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\ListOperation;
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\CreateOperation;
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\UpdateOperation;
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\DeleteOperation;
|
||||||
|
// use \Backpack\CRUD\app\Http\Controllers\Operations\ShowOperation;
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\ReorderOperation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configure the CrudPanel object. Apply settings to all operations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function setup()
|
||||||
|
{
|
||||||
|
CRUD::setModel(\App\Models\SupportDistributionPartnerCatalog::class);
|
||||||
|
CRUD::setRoute(config('backpack.base.route_prefix') . '/support-distribution-partner-catalog');
|
||||||
|
CRUD::setEntityNameStrings(trans('backend.support.distribution_partner.catalog.item'), trans('backend.support.distribution_partner.catalog.items'));
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function setupReorderOperation()
|
||||||
|
{
|
||||||
|
CRUD::set('reorder.label', 'name');
|
||||||
|
CRUD::set('reorder.max_level', 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define what happens when the List operation is loaded.
|
||||||
|
*
|
||||||
|
* @see https://backpackforlaravel.com/docs/crud-operation-list-entries
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
protected function setupListOperation()
|
||||||
|
{
|
||||||
|
if (! $this->crud->getRequest()->has('order')){
|
||||||
|
$this->crud->orderBy('lft', 'asc')->orderBy('id', 'desc');
|
||||||
|
}
|
||||||
|
|
||||||
|
CRUD::addColumn('#');
|
||||||
|
CRUD::column('is_front_show')->label(trans('backend.columnName.is_front_show'))->type('checkbox');
|
||||||
|
CRUD::column('name')->label(trans('backend.columnName.name'))->type('textarea_nl2br')->escaped(false)->searchLogic('text');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define what happens when the Create operation is loaded.
|
||||||
|
*
|
||||||
|
* @see https://backpackforlaravel.com/docs/crud-operation-create
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
protected function setupCreateOperation()
|
||||||
|
{
|
||||||
|
CRUD::setValidation(SupportDistributionPartnerCatalogRequest::class);
|
||||||
|
CRUD::addFields([
|
||||||
|
[
|
||||||
|
'name' => 'is_front_show',
|
||||||
|
'label' => trans('backend.columnName.is_front_show'),
|
||||||
|
'type' => 'boolean',
|
||||||
|
'default' => true,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'name',
|
||||||
|
'lable' => 'Name',
|
||||||
|
'type' => 'text',
|
||||||
|
],
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define what happens when the Update operation is loaded.
|
||||||
|
*
|
||||||
|
* @see https://backpackforlaravel.com/docs/crud-operation-update
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
protected function setupUpdateOperation()
|
||||||
|
{
|
||||||
|
$this->setupCreateOperation();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,136 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin;
|
||||||
|
|
||||||
|
use App\Http\Requests\SupportDistributionPartnerRequest;
|
||||||
|
use Backpack\CRUD\app\Http\Controllers\CrudController;
|
||||||
|
use Backpack\CRUD\app\Library\CrudPanel\CrudPanelFacade as CRUD;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class SupportDistributionPartnerCrudController
|
||||||
|
* @package App\Http\Controllers\Admin
|
||||||
|
* @property-read \Backpack\CRUD\app\Library\CrudPanel\CrudPanel $crud
|
||||||
|
*/
|
||||||
|
class SupportDistributionPartnerCrudController extends CrudController
|
||||||
|
{
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\ListOperation;
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\CreateOperation;
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\UpdateOperation;
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\DeleteOperation;
|
||||||
|
//use \Backpack\CRUD\app\Http\Controllers\Operations\ShowOperation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configure the CrudPanel object. Apply settings to all operations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function setup()
|
||||||
|
{
|
||||||
|
CRUD::setModel(\App\Models\SupportDistributionPartner::class);
|
||||||
|
CRUD::setRoute(config('backpack.base.route_prefix') . '/support-distribution-partner');
|
||||||
|
CRUD::setEntityNameStrings(trans('backend.support.distribution_partner.content.item'), trans('backend.support.distribution_partner.content.items'));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define what happens when the List operation is loaded.
|
||||||
|
*
|
||||||
|
* @see https://backpackforlaravel.com/docs/crud-operation-list-entries
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
protected function setupListOperation()
|
||||||
|
{
|
||||||
|
$this->crud->addColumns([
|
||||||
|
[
|
||||||
|
'name' => 'support_distribution_partner_catalog_id',
|
||||||
|
'label' => trans('backend.columnName.catalog'),
|
||||||
|
'type' => 'select',
|
||||||
|
'entity' => 'supportDistributionPartnerCatalog',
|
||||||
|
'attribute' => 'name',
|
||||||
|
'model' => 'App\Models\SupportDistributionPartnerCatalog',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'title',
|
||||||
|
'label' => trans('backend.columnName.title'),
|
||||||
|
'type' => 'text'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'is_front_show',
|
||||||
|
'label' => trans('backend.columnName.is_front_show'),
|
||||||
|
'type' => 'checkbox'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'description',
|
||||||
|
'label' => trans('backend.columnName.description'),
|
||||||
|
'type' => 'text'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'website',
|
||||||
|
'label' => trans('backend.columnName.website'),
|
||||||
|
'type' => 'text'
|
||||||
|
],
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define what happens when the Create operation is loaded.
|
||||||
|
*
|
||||||
|
* @see https://backpackforlaravel.com/docs/crud-operation-create
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
protected function setupCreateOperation()
|
||||||
|
{
|
||||||
|
CRUD::setValidation(SupportDistributionPartnerRequest::class);
|
||||||
|
$this->crud->addFields([
|
||||||
|
[
|
||||||
|
'name' => 'support_distribution_partner_catalog_id',
|
||||||
|
'label' => trans('backend.columnName.catalog'),
|
||||||
|
'type' => 'select2_nested',
|
||||||
|
'entity' => 'supportDistributionPartnerCatalog',
|
||||||
|
'attribute' => 'name',
|
||||||
|
'model' => 'App\Models\SupportDistributionPartnerCatalog',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'title',
|
||||||
|
'label' => trans('backend.columnName.title'),
|
||||||
|
'type' => 'text'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'is_front_show',
|
||||||
|
'label' => trans('backend.columnName.is_front_show'),
|
||||||
|
'type' => 'boolean'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'photos',
|
||||||
|
'label' => trans('backend.columnName.cover'),
|
||||||
|
'type' => 'upload_img_multiple',
|
||||||
|
'upload' => true,
|
||||||
|
'disk' => 'public',
|
||||||
|
'hint' => '',
|
||||||
|
'qty' => 1, // 0=no limit, >0=limit
|
||||||
|
'showSingleChoise' => '0', // 0=hidden, 1=show(default)
|
||||||
|
'showComment' => '0', // 0=hidden, 1=show(default)
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'description',
|
||||||
|
'label' => trans('backend.columnName.description'),
|
||||||
|
'type' => 'textarea'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'website',
|
||||||
|
'label' => trans('backend.columnName.website'),
|
||||||
|
'type' => 'text'
|
||||||
|
],
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define what happens when the Update operation is loaded.
|
||||||
|
*
|
||||||
|
* @see https://backpackforlaravel.com/docs/crud-operation-update
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
protected function setupUpdateOperation()
|
||||||
|
{
|
||||||
|
$this->setupCreateOperation();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,93 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin;
|
||||||
|
|
||||||
|
use App\Http\Requests\SupportEcosystemPartnerCatalogRequest;
|
||||||
|
use Backpack\CRUD\app\Http\Controllers\CrudController;
|
||||||
|
use Backpack\CRUD\app\Library\CrudPanel\CrudPanelFacade as CRUD;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class SupportEcosystemPartnerCatalogCrudController
|
||||||
|
* @package App\Http\Controllers\Admin
|
||||||
|
* @property-read \Backpack\CRUD\app\Library\CrudPanel\CrudPanel $crud
|
||||||
|
*/
|
||||||
|
class SupportEcosystemPartnerCatalogCrudController extends CrudController
|
||||||
|
{
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\ListOperation;
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\CreateOperation;
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\UpdateOperation;
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\DeleteOperation;
|
||||||
|
// use \Backpack\CRUD\app\Http\Controllers\Operations\ShowOperation;
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\ReorderOperation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configure the CrudPanel object. Apply settings to all operations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function setup()
|
||||||
|
{
|
||||||
|
CRUD::setModel(\App\Models\SupportEcosystemPartnerCatalog::class);
|
||||||
|
CRUD::setRoute(config('backpack.base.route_prefix') . '/support-ecosystem-partner-catalog');
|
||||||
|
CRUD::setEntityNameStrings(trans('backend.support.ecosystem_partner.catalog.item'), trans('backend.support.ecosystem_partner.catalog.items'));
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function setupReorderOperation()
|
||||||
|
{
|
||||||
|
CRUD::set('reorder.label', 'name');
|
||||||
|
CRUD::set('reorder.max_level', 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define what happens when the List operation is loaded.
|
||||||
|
*
|
||||||
|
* @see https://backpackforlaravel.com/docs/crud-operation-list-entries
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
protected function setupListOperation()
|
||||||
|
{
|
||||||
|
if (! $this->crud->getRequest()->has('order')){
|
||||||
|
$this->crud->orderBy('lft', 'asc')->orderBy('id', 'desc');
|
||||||
|
}
|
||||||
|
|
||||||
|
CRUD::addColumn('#');
|
||||||
|
CRUD::column('is_front_show')->label(trans('backend.columnName.is_front_show'))->type('checkbox');
|
||||||
|
CRUD::column('name')->label(trans('backend.columnName.name'))->type('textarea_nl2br')->escaped(false)->searchLogic('text');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define what happens when the Create operation is loaded.
|
||||||
|
*
|
||||||
|
* @see https://backpackforlaravel.com/docs/crud-operation-create
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
protected function setupCreateOperation()
|
||||||
|
{
|
||||||
|
CRUD::setValidation(SupportEcosystemPartnerCatalogRequest::class);
|
||||||
|
CRUD::addFields([
|
||||||
|
[
|
||||||
|
'name' => 'is_front_show',
|
||||||
|
'label' => trans('backend.columnName.is_front_show'),
|
||||||
|
'type' => 'boolean',
|
||||||
|
'default' => true,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'name',
|
||||||
|
'lable' => 'Name',
|
||||||
|
'type' => 'text',
|
||||||
|
],
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define what happens when the Update operation is loaded.
|
||||||
|
*
|
||||||
|
* @see https://backpackforlaravel.com/docs/crud-operation-update
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
protected function setupUpdateOperation()
|
||||||
|
{
|
||||||
|
$this->setupCreateOperation();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,136 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin;
|
||||||
|
|
||||||
|
use App\Http\Requests\SupportEcosystemPartnerRequest;
|
||||||
|
use Backpack\CRUD\app\Http\Controllers\CrudController;
|
||||||
|
use Backpack\CRUD\app\Library\CrudPanel\CrudPanelFacade as CRUD;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class SupportEcosystemPartnerCrudController
|
||||||
|
* @package App\Http\Controllers\Admin
|
||||||
|
* @property-read \Backpack\CRUD\app\Library\CrudPanel\CrudPanel $crud
|
||||||
|
*/
|
||||||
|
class SupportEcosystemPartnerCrudController extends CrudController
|
||||||
|
{
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\ListOperation;
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\CreateOperation;
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\UpdateOperation;
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\DeleteOperation;
|
||||||
|
// use \Backpack\CRUD\app\Http\Controllers\Operations\ShowOperation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configure the CrudPanel object. Apply settings to all operations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function setup()
|
||||||
|
{
|
||||||
|
CRUD::setModel(\App\Models\SupportEcosystemPartner::class);
|
||||||
|
CRUD::setRoute(config('backpack.base.route_prefix') . '/support-ecosystem-partner');
|
||||||
|
CRUD::setEntityNameStrings(trans('backend.support.ecosystem_partner.content.item'), trans('backend.support.ecosystem_partner.content.items'));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define what happens when the List operation is loaded.
|
||||||
|
*
|
||||||
|
* @see https://backpackforlaravel.com/docs/crud-operation-list-entries
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
protected function setupListOperation()
|
||||||
|
{
|
||||||
|
$this->crud->addColumns([
|
||||||
|
[
|
||||||
|
'name' => 'support_ecosystem_partner_catalog_id',
|
||||||
|
'label' => trans('backend.columnName.catalog'),
|
||||||
|
'type' => 'select',
|
||||||
|
'entity' => 'supportEcosystemPartnerCatalog',
|
||||||
|
'attribute' => 'name',
|
||||||
|
'model' => 'App\Models\SupportEcosystemPartnerCatalog',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'title',
|
||||||
|
'label' => trans('backend.columnName.title'),
|
||||||
|
'type' => 'text'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'is_front_show',
|
||||||
|
'label' => trans('backend.columnName.is_front_show'),
|
||||||
|
'type' => 'checkbox'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'description',
|
||||||
|
'label' => trans('backend.columnName.description'),
|
||||||
|
'type' => 'text'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'website',
|
||||||
|
'label' => trans('backend.columnName.website'),
|
||||||
|
'type' => 'text'
|
||||||
|
],
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define what happens when the Create operation is loaded.
|
||||||
|
*
|
||||||
|
* @see https://backpackforlaravel.com/docs/crud-operation-create
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
protected function setupCreateOperation()
|
||||||
|
{
|
||||||
|
CRUD::setValidation(SupportEcosystemPartnerRequest::class);
|
||||||
|
$this->crud->addFields([
|
||||||
|
[
|
||||||
|
'name' => 'support_ecosystem_partner_catalog_id',
|
||||||
|
'label' => trans('backend.columnName.catalog'),
|
||||||
|
'type' => 'select2_nested',
|
||||||
|
'entity' => 'supportEcosystemPartnerCatalog',
|
||||||
|
'attribute' => 'name',
|
||||||
|
'model' => 'App\Models\SupportEcosystemPartnerCatalog',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'title',
|
||||||
|
'label' => trans('backend.columnName.title'),
|
||||||
|
'type' => 'text'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'is_front_show',
|
||||||
|
'label' => trans('backend.columnName.is_front_show'),
|
||||||
|
'type' => 'boolean'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'photos',
|
||||||
|
'label' => trans('backend.columnName.cover'),
|
||||||
|
'type' => 'upload_img_multiple',
|
||||||
|
'upload' => true,
|
||||||
|
'disk' => 'public',
|
||||||
|
'hint' => '',
|
||||||
|
'qty' => 1, // 0=no limit, >0=limit
|
||||||
|
'showSingleChoise' => '0', // 0=hidden, 1=show(default)
|
||||||
|
'showComment' => '0', // 0=hidden, 1=show(default)
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'description',
|
||||||
|
'label' => trans('backend.columnName.description'),
|
||||||
|
'type' => 'textarea'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'website',
|
||||||
|
'label' => trans('backend.columnName.website'),
|
||||||
|
'type' => 'text'
|
||||||
|
],
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define what happens when the Update operation is loaded.
|
||||||
|
*
|
||||||
|
* @see https://backpackforlaravel.com/docs/crud-operation-update
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
protected function setupUpdateOperation()
|
||||||
|
{
|
||||||
|
$this->setupCreateOperation();
|
||||||
|
}
|
||||||
|
}
|
77
app/Http/Controllers/Admin/SupportSaleCrudController.php
Normal file
77
app/Http/Controllers/Admin/SupportSaleCrudController.php
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin;
|
||||||
|
|
||||||
|
use App\Http\Requests\SupportSaleRequest;
|
||||||
|
use Backpack\CRUD\app\Http\Controllers\CrudController;
|
||||||
|
use Backpack\CRUD\app\Library\CrudPanel\CrudPanelFacade as CRUD;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class SupportSaleCrudController
|
||||||
|
* @package App\Http\Controllers\Admin
|
||||||
|
* @property-read \Backpack\CRUD\app\Library\CrudPanel\CrudPanel $crud
|
||||||
|
*/
|
||||||
|
class SupportSaleCrudController extends CrudController
|
||||||
|
{
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\ListOperation;
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\CreateOperation;
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\UpdateOperation;
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\DeleteOperation;
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\ShowOperation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configure the CrudPanel object. Apply settings to all operations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function setup()
|
||||||
|
{
|
||||||
|
CRUD::setModel(\App\Models\SupportSale::class);
|
||||||
|
CRUD::setRoute(config('backpack.base.route_prefix') . '/support-sale');
|
||||||
|
CRUD::setEntityNameStrings('support sale', 'support sales');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define what happens when the List operation is loaded.
|
||||||
|
*
|
||||||
|
* @see https://backpackforlaravel.com/docs/crud-operation-list-entries
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
protected function setupListOperation()
|
||||||
|
{
|
||||||
|
CRUD::setFromDb(); // set columns from db columns.
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Columns can be defined using the fluent syntax:
|
||||||
|
* - CRUD::column('price')->type('number');
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define what happens when the Create operation is loaded.
|
||||||
|
*
|
||||||
|
* @see https://backpackforlaravel.com/docs/crud-operation-create
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
protected function setupCreateOperation()
|
||||||
|
{
|
||||||
|
CRUD::setValidation(SupportSaleRequest::class);
|
||||||
|
CRUD::setFromDb(); // set fields from db columns.
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fields can be defined using the fluent syntax:
|
||||||
|
* - CRUD::field('price')->type('number');
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define what happens when the Update operation is loaded.
|
||||||
|
*
|
||||||
|
* @see https://backpackforlaravel.com/docs/crud-operation-update
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
protected function setupUpdateOperation()
|
||||||
|
{
|
||||||
|
$this->setupCreateOperation();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,77 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin;
|
||||||
|
|
||||||
|
use App\Http\Requests\SupportTechnicalRequest;
|
||||||
|
use Backpack\CRUD\app\Http\Controllers\CrudController;
|
||||||
|
use Backpack\CRUD\app\Library\CrudPanel\CrudPanelFacade as CRUD;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class SupportTechnicalCrudController
|
||||||
|
* @package App\Http\Controllers\Admin
|
||||||
|
* @property-read \Backpack\CRUD\app\Library\CrudPanel\CrudPanel $crud
|
||||||
|
*/
|
||||||
|
class SupportTechnicalCrudController extends CrudController
|
||||||
|
{
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\ListOperation;
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\CreateOperation;
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\UpdateOperation;
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\DeleteOperation;
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\ShowOperation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configure the CrudPanel object. Apply settings to all operations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function setup()
|
||||||
|
{
|
||||||
|
CRUD::setModel(\App\Models\SupportTechnical::class);
|
||||||
|
CRUD::setRoute(config('backpack.base.route_prefix') . '/support-technical');
|
||||||
|
CRUD::setEntityNameStrings('support technical', 'support technicals');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define what happens when the List operation is loaded.
|
||||||
|
*
|
||||||
|
* @see https://backpackforlaravel.com/docs/crud-operation-list-entries
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
protected function setupListOperation()
|
||||||
|
{
|
||||||
|
CRUD::setFromDb(); // set columns from db columns.
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Columns can be defined using the fluent syntax:
|
||||||
|
* - CRUD::column('price')->type('number');
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define what happens when the Create operation is loaded.
|
||||||
|
*
|
||||||
|
* @see https://backpackforlaravel.com/docs/crud-operation-create
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
protected function setupCreateOperation()
|
||||||
|
{
|
||||||
|
CRUD::setValidation(SupportTechnicalRequest::class);
|
||||||
|
CRUD::setFromDb(); // set fields from db columns.
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fields can be defined using the fluent syntax:
|
||||||
|
* - CRUD::field('price')->type('number');
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define what happens when the Update operation is loaded.
|
||||||
|
*
|
||||||
|
* @see https://backpackforlaravel.com/docs/crud-operation-update
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
protected function setupUpdateOperation()
|
||||||
|
{
|
||||||
|
$this->setupCreateOperation();
|
||||||
|
}
|
||||||
|
}
|
77
app/Http/Controllers/Admin/UserCrudController.php
Normal file
77
app/Http/Controllers/Admin/UserCrudController.php
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin;
|
||||||
|
|
||||||
|
use Backpack\PermissionManager\app\Http\Controllers\UserCrudController as OrgController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class UserCrudController
|
||||||
|
* @package App\Http\Controllers\Admin
|
||||||
|
* @property-read \Backpack\CRUD\app\Library\CrudPanel\CrudPanel $crud
|
||||||
|
*/
|
||||||
|
class UserCrudController extends OrgController
|
||||||
|
{
|
||||||
|
public function setupListOperation()
|
||||||
|
{
|
||||||
|
$this->crud->addColumns([
|
||||||
|
[
|
||||||
|
'name' => 'name',
|
||||||
|
'label' => trans('backpack::permissionmanager.name'),
|
||||||
|
'type' => 'text',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'email',
|
||||||
|
'label' => trans('backpack::permissionmanager.email'),
|
||||||
|
'type' => 'email',
|
||||||
|
],
|
||||||
|
[ // n-n relationship (with pivot table)
|
||||||
|
'label' => trans('backpack::permissionmanager.roles'), // Table column heading
|
||||||
|
'type' => 'select_multiple',
|
||||||
|
'name' => 'roles', // the method that defines the relationship in your Model
|
||||||
|
'entity' => 'roles', // the method that defines the relationship in your Model
|
||||||
|
'attribute' => 'name', // foreign key attribute that is shown to user
|
||||||
|
'model' => config('permission.models.role'), // foreign key model
|
||||||
|
],
|
||||||
|
[ // n-n relationship (with pivot table)
|
||||||
|
'label' => trans('backpack::permissionmanager.extra_permissions'), // Table column heading
|
||||||
|
'type' => 'select_multiple',
|
||||||
|
'name' => 'permissions', // the method that defines the relationship in your Model
|
||||||
|
'entity' => 'permissions', // the method that defines the relationship in your Model
|
||||||
|
'attribute' => 'name', // foreign key attribute that is shown to user
|
||||||
|
'model' => config('permission.models.permission'), // foreign key model
|
||||||
|
],
|
||||||
|
]);
|
||||||
|
|
||||||
|
if (backpack_pro()) {
|
||||||
|
// Role Filter
|
||||||
|
$this->crud->addFilter(
|
||||||
|
[
|
||||||
|
'name' => 'role',
|
||||||
|
'type' => 'dropdown',
|
||||||
|
'label' => trans('backpack::permissionmanager.role'),
|
||||||
|
],
|
||||||
|
config('permission.models.role')::all()->pluck('name', 'id')->toArray(),
|
||||||
|
function ($value) { // if the filter is active
|
||||||
|
$this->crud->addClause('whereHas', 'roles', function ($query) use ($value) {
|
||||||
|
$query->where('role_id', '=', $value);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
// Extra Permission Filter
|
||||||
|
$this->crud->addFilter(
|
||||||
|
[
|
||||||
|
'name' => 'permissions',
|
||||||
|
'type' => 'select2',
|
||||||
|
'label' => trans('backpack::permissionmanager.extra_permissions'),
|
||||||
|
],
|
||||||
|
config('permission.models.permission')::all()->pluck('name', 'id')->toArray(),
|
||||||
|
function ($value) { // if the filter is active
|
||||||
|
$this->crud->addClause('whereHas', 'permissions', function ($query) use ($value) {
|
||||||
|
$query->where('permission_id', '=', $value);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
13
app/Http/Controllers/ContactController.php
Normal file
13
app/Http/Controllers/ContactController.php
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class ContactController extends Controller
|
||||||
|
{
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
return view('contact');
|
||||||
|
}
|
||||||
|
}
|
12
app/Http/Controllers/Controller.php
Normal file
12
app/Http/Controllers/Controller.php
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
|
||||||
|
use Illuminate\Foundation\Validation\ValidatesRequests;
|
||||||
|
use Illuminate\Routing\Controller as BaseController;
|
||||||
|
|
||||||
|
class Controller extends BaseController
|
||||||
|
{
|
||||||
|
use AuthorizesRequests, ValidatesRequests;
|
||||||
|
}
|
37
app/Http/Controllers/EventsController.php
Normal file
37
app/Http/Controllers/EventsController.php
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class EventsController extends Controller
|
||||||
|
{
|
||||||
|
public function index(Request $request)
|
||||||
|
{
|
||||||
|
$perPageItems = 12;
|
||||||
|
$page = $request->get("p");
|
||||||
|
$page = (!$page || $page < 1) ? 1 : $page;
|
||||||
|
$pageOffset = $perPageItems * ($page - 1);
|
||||||
|
|
||||||
|
$dataRows = \App\Models\Event::where('is_front_show', '=', true)
|
||||||
|
->orderBy('post_at', 'desc')
|
||||||
|
->select('id', 'title', 'venue', 'contact', 'photos', 'post_at');
|
||||||
|
|
||||||
|
return view('events', [
|
||||||
|
'dataRows' => $dataRows->skip($pageOffset)->take($perPageItems)->get(),
|
||||||
|
'dataCurrentPage' => $page,
|
||||||
|
'dataPerPageItems' => $perPageItems,
|
||||||
|
'dataTotalCount' => $dataRows->count(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function detail(Request $request, $id)
|
||||||
|
{
|
||||||
|
$dataRow = \App\Models\Event::where('id', '=', $id)
|
||||||
|
->where('is_front_show', '=', true);
|
||||||
|
|
||||||
|
return view('events_detail', [
|
||||||
|
'dataRow' => $dataRow->first(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
26
app/Http/Controllers/HomeController.php
Normal file
26
app/Http/Controllers/HomeController.php
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class HomeController extends Controller
|
||||||
|
{
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
$carouselRows = \App\Models\HomeCarousel::where('is_front_show', '=', true)
|
||||||
|
->orderBy('lft', 'asc')
|
||||||
|
->orderBy('id', 'desc');
|
||||||
|
$newsRows = \App\Models\News::where('is_front_show', '=', true)
|
||||||
|
->orderBy('post_at', 'desc')
|
||||||
|
->take('3');
|
||||||
|
$eventRows = \App\Models\News::where('is_front_show', '=', true)
|
||||||
|
->orderBy('post_at', 'desc')
|
||||||
|
->take('3');
|
||||||
|
return view('home', [
|
||||||
|
'carouselRows' => $carouselRows->get(),
|
||||||
|
'newsRows' => $newsRows->get(),
|
||||||
|
'eventRows' => $eventRows->get(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
37
app/Http/Controllers/NewsController.php
Normal file
37
app/Http/Controllers/NewsController.php
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class NewsController extends Controller
|
||||||
|
{
|
||||||
|
public function index(Request $request)
|
||||||
|
{
|
||||||
|
$perPageItems = 12;
|
||||||
|
$page = $request->get("p");
|
||||||
|
$page = (!$page || $page < 1) ? 1 : $page;
|
||||||
|
$pageOffset = $perPageItems * ($page - 1);
|
||||||
|
|
||||||
|
$dataRows = \App\Models\News::where('is_front_show', '=', true)
|
||||||
|
->orderBy('post_at', 'desc')
|
||||||
|
->select('id', 'title', 'description', 'photos', 'post_at');
|
||||||
|
|
||||||
|
return view('news', [
|
||||||
|
'dataRows' => $dataRows->skip($pageOffset)->take($perPageItems)->get(),
|
||||||
|
'dataCurrentPage' => $page,
|
||||||
|
'dataPerPageItems' => $perPageItems,
|
||||||
|
'dataTotalCount' => $dataRows->count(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function detail(Request $request, $id)
|
||||||
|
{
|
||||||
|
$dataRow = \App\Models\News::where('id', '=', $id)
|
||||||
|
->where('is_front_show', '=', true);
|
||||||
|
|
||||||
|
return view('news_detail', [
|
||||||
|
'dataRow' => $dataRow->first(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
111
app/Http/Controllers/ProductsController.php
Normal file
111
app/Http/Controllers/ProductsController.php
Normal file
@ -0,0 +1,111 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class ProductsController extends Controller
|
||||||
|
{
|
||||||
|
public function index(Request $request, $catalogs = null)
|
||||||
|
{
|
||||||
|
$catalogs = explode('/', $catalogs);
|
||||||
|
$catalogSlug = array_pop($catalogs);
|
||||||
|
$applications = $request->get('tags');
|
||||||
|
$currentApplications = explode(',', $applications);
|
||||||
|
$currentApplications = array_values(array_filter($currentApplications));
|
||||||
|
$perPageItems = 10;
|
||||||
|
$page = $request->get("p");
|
||||||
|
$page = (!$page || $page < 1) ? 1 : $page;
|
||||||
|
$pageOffset = $perPageItems * ($page - 1);
|
||||||
|
|
||||||
|
$productRows = \App\Models\Product::where('is_front_show', '=', true)
|
||||||
|
->orderByRaw("CASE
|
||||||
|
WHEN tip = 'none' THEN 1
|
||||||
|
WHEN tip = 'new' THEN 2
|
||||||
|
WHEN tip = 'on_sale' THEN 3
|
||||||
|
END DESC")
|
||||||
|
->orderBy('id', 'DESC');
|
||||||
|
|
||||||
|
$dataCatalogs = \App\Models\ProductCatalog::where('is_front_show', '=', true)
|
||||||
|
->orderBy('lft', 'asc')
|
||||||
|
->select('id', 'slug', 'name', \DB::raw('(
|
||||||
|
SELECT COUNT(id) FROM products
|
||||||
|
WHERE products.product_catalog_id = product_catalogs.id AND products.is_front_show = true
|
||||||
|
) as qty'));
|
||||||
|
|
||||||
|
$dataApplications = \App\Models\ProductApplication::where('is_front_show', '=', true)
|
||||||
|
->orderBy('lft', 'asc')
|
||||||
|
->select('id', 'slug', 'name');
|
||||||
|
|
||||||
|
$currentCatalogName = \App\Models\ProductCatalog::where('slug', 'like', $catalogSlug)->first();
|
||||||
|
if ($currentCatalogName)
|
||||||
|
{
|
||||||
|
$currentCatalogName = $currentCatalogName->name;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (count($currentApplications) > 0)
|
||||||
|
{
|
||||||
|
$productRows = $productRows->whereHas('productApplications',
|
||||||
|
function($query) use ($currentApplications) {
|
||||||
|
$query->whereIn('slug', $currentApplications);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($catalogSlug)
|
||||||
|
{
|
||||||
|
$productRows = $productRows->whereHas('productCatalog',
|
||||||
|
function($query) use ($catalogSlug) {
|
||||||
|
$query->where('slug', 'like', $catalogSlug);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$productCount = $productRows->count();
|
||||||
|
$productRows = $productRows->skip($pageOffset)->take($perPageItems)->get();
|
||||||
|
foreach ($productRows as $row)
|
||||||
|
{
|
||||||
|
$row->{'applications'} = \App\Models\Product::find($row->id)->productApplications()->get();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return view('products', [
|
||||||
|
'dataCatalogs' => $dataCatalogs->get(),
|
||||||
|
'currentCatalogName' => $currentCatalogName,
|
||||||
|
'dataApplications' => $dataApplications->get(),
|
||||||
|
'currentApplications' => $currentApplications,
|
||||||
|
'dataRows' => $productRows,
|
||||||
|
'dataCurrentPage' => $page,
|
||||||
|
'dataPerPageItems' => $perPageItems,
|
||||||
|
'dataTotalCount' => $productCount,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function catalogs($catalogs, Request $request)
|
||||||
|
{
|
||||||
|
return $this->index($request, $catalogs);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function detail($product, Request $request)
|
||||||
|
{
|
||||||
|
$dataRow = \App\Models\Product::where('slug', 'like', $product)
|
||||||
|
->where('is_front_show', '=', true)
|
||||||
|
->first();
|
||||||
|
|
||||||
|
$catalogName = '';
|
||||||
|
$catalogSlug = '';
|
||||||
|
$catalog = $dataRow->productCatalog()->first();
|
||||||
|
if ($catalog)
|
||||||
|
{
|
||||||
|
$catalogName = $catalog->name;
|
||||||
|
$catalogSlug = $catalog->slug;
|
||||||
|
}
|
||||||
|
|
||||||
|
return view('products_detail', [
|
||||||
|
'dataRow' => $dataRow,
|
||||||
|
'catalogName' => $catalogName,
|
||||||
|
'catalogSlug' => $catalogSlug,
|
||||||
|
'productApplications' => $dataRow->productApplications()->get(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,49 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class SupportDistributionPartnersController extends Controller
|
||||||
|
{
|
||||||
|
public function index(Request $request)
|
||||||
|
{
|
||||||
|
$catalogId = $request->get('cid');
|
||||||
|
$catalogId = (!$catalogId || $catalogId < 1) ? 0 : $catalogId;
|
||||||
|
$perPageItems = 20;
|
||||||
|
$page = $request->get("p");
|
||||||
|
$page = (!$page || $page < 1) ? 1 : $page;
|
||||||
|
$pageOffset = $perPageItems * ($page - 1);
|
||||||
|
|
||||||
|
$catalogRows = \App\Models\SupportDistributionPartnerCatalog::where('is_front_show', '=', true)
|
||||||
|
->orderBy('lft', 'asc')
|
||||||
|
->orderBy('id', 'desc')
|
||||||
|
->select('id', 'name');
|
||||||
|
if ($catalogId == 0)
|
||||||
|
{
|
||||||
|
$catalogRowsGet = $catalogRows->get();
|
||||||
|
foreach ($catalogRowsGet as $row)
|
||||||
|
{
|
||||||
|
$catalogId = $row->id;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$dataRows = \App\Models\SupportDistributionPartner::where('support_distribution_partner_catalog_id', '=', $catalogId)
|
||||||
|
->where('is_front_show', '=', true)
|
||||||
|
->orderBy('title', 'desc')
|
||||||
|
->select('id', 'title', 'description', 'photos', 'website');
|
||||||
|
|
||||||
|
return view('support-distribution-partners', [
|
||||||
|
'catalogRows' => $catalogRows->get(),
|
||||||
|
'catalogCurrentId' => $catalogId,
|
||||||
|
'dataRows' => $dataRows->skip($pageOffset)->take($perPageItems)->get(),
|
||||||
|
'dataCurrentPage' => $page,
|
||||||
|
'dataPerPageItems' => $perPageItems,
|
||||||
|
'dataTotalCount' => $dataRows->count()
|
||||||
|
]);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
40
app/Http/Controllers/SupportEcosystemPartnersController.php
Normal file
40
app/Http/Controllers/SupportEcosystemPartnersController.php
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class SupportEcosystemPartnersController extends Controller
|
||||||
|
{
|
||||||
|
public function index(Request $request)
|
||||||
|
{
|
||||||
|
$catalogId = $request->get('cid');
|
||||||
|
$catalogId = (!$catalogId || $catalogId < 1) ? 0 : $catalogId;
|
||||||
|
$appclitionId = $request->get('aid');
|
||||||
|
$appclitionId = (!$appclitionId || $appclitionId < 1) ? 0 : $appclitionId;
|
||||||
|
$perPageItems = 20;
|
||||||
|
$page = $request->get("p");
|
||||||
|
$page = (!$page || $page < 1) ? 1 : $page;
|
||||||
|
$pageOffset = $perPageItems * ($page - 1);
|
||||||
|
|
||||||
|
$catalogRows = \App\Models\SupportEcosystemPartnerCatalog::where('is_front_show', '=', true)
|
||||||
|
->orderBy('lft', 'asc')
|
||||||
|
->orderBy('id', 'desc')
|
||||||
|
->select('id', 'name');
|
||||||
|
|
||||||
|
$dataRows = \App\Models\SupportEcosystemPartner::where('support_ecosystem_partner_catalog_id', '=', $catalogId)
|
||||||
|
->where('is_front_show', '=', true)
|
||||||
|
->orderBy('title', 'desc')
|
||||||
|
->select('id', 'title', 'description', 'photos', 'website');
|
||||||
|
|
||||||
|
return view('support-ecosystem-partners', [
|
||||||
|
'catalogRows' => $catalogRows->get(),
|
||||||
|
'catalogCurrentId' => $catalogId,
|
||||||
|
'dataRows' => $dataRows->skip($pageOffset)->take($perPageItems)->get(),
|
||||||
|
'dataCurrentPage' => $page,
|
||||||
|
'dataPerPageItems' => $perPageItems,
|
||||||
|
'dataTotalCount' => $dataRows->count()
|
||||||
|
]);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
39
app/Http/Controllers/SupportSalesInquiryController.php
Normal file
39
app/Http/Controllers/SupportSalesInquiryController.php
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use \App\Http\Requests\SupportSaleRequest;
|
||||||
|
use Carbon\Carbon;
|
||||||
|
|
||||||
|
class SupportSalesInquiryController extends Controller
|
||||||
|
{
|
||||||
|
public function index(Request $request)
|
||||||
|
{
|
||||||
|
$pid = $request->get('pid');
|
||||||
|
$product = \App\Models\Product::where('id', '=', $pid)->where('is_front_show', '=', true)->first();
|
||||||
|
if ($product)
|
||||||
|
{
|
||||||
|
$product = 'I am interested in ' . $product->title;
|
||||||
|
}
|
||||||
|
return view('support-sales-inquiry',[
|
||||||
|
'productName' => $product,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function indexPost(SupportSaleRequest $request)
|
||||||
|
{
|
||||||
|
\App\Models\SupportSale::insert([
|
||||||
|
'name_first' => $request->input('name_first'),
|
||||||
|
'name_last' => $request->input('name_last'),
|
||||||
|
'company_name' => $request->input('company_name'),
|
||||||
|
'job_title' => $request->input('job_title'),
|
||||||
|
'email' => $request->input('email'),
|
||||||
|
'phone' => $request->input('phone'),
|
||||||
|
'contry' => $request->input('contry'),
|
||||||
|
'comments' => $request->input('comments'),
|
||||||
|
'created_at' => Carbon::now(),
|
||||||
|
]);
|
||||||
|
return redirect()->back()->with('success', 'We have received your sales inquiry!');
|
||||||
|
}
|
||||||
|
}
|
31
app/Http/Controllers/SupportTechnicalController.php
Normal file
31
app/Http/Controllers/SupportTechnicalController.php
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use \App\Http\Requests\SupportTechnicalRequest;
|
||||||
|
use Carbon\Carbon;
|
||||||
|
|
||||||
|
class SupportTechnicalController extends Controller
|
||||||
|
{
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
return view('support-technical');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function indexPost(SupportTechnicalRequest $request)
|
||||||
|
{
|
||||||
|
\App\Models\SupportTechnical::insert([
|
||||||
|
'name_first' => $request->input('name_first'),
|
||||||
|
'name_last' => $request->input('name_last'),
|
||||||
|
'company_name' => $request->input('company_name'),
|
||||||
|
'job_title' => $request->input('job_title'),
|
||||||
|
'email' => $request->input('email'),
|
||||||
|
'phone' => $request->input('phone'),
|
||||||
|
'contry' => $request->input('contry'),
|
||||||
|
'comments' => $request->input('comments'),
|
||||||
|
'created_at' => Carbon::now(),
|
||||||
|
]);
|
||||||
|
return redirect()->back()->with('success', 'We have received your technical inquiry!');
|
||||||
|
}
|
||||||
|
}
|
69
app/Http/Kernel.php
Normal file
69
app/Http/Kernel.php
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Http\Kernel as HttpKernel;
|
||||||
|
|
||||||
|
class Kernel extends HttpKernel
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The application's global HTTP middleware stack.
|
||||||
|
*
|
||||||
|
* These middleware are run during every request to your application.
|
||||||
|
*
|
||||||
|
* @var array<int, class-string|string>
|
||||||
|
*/
|
||||||
|
protected $middleware = [
|
||||||
|
// \App\Http\Middleware\TrustHosts::class,
|
||||||
|
\App\Http\Middleware\TrustProxies::class,
|
||||||
|
\Illuminate\Http\Middleware\HandleCors::class,
|
||||||
|
\App\Http\Middleware\PreventRequestsDuringMaintenance::class,
|
||||||
|
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
|
||||||
|
\App\Http\Middleware\TrimStrings::class,
|
||||||
|
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
|
||||||
|
\Spatie\CookieConsent\CookieConsentMiddleware::class,
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The application's route middleware groups.
|
||||||
|
*
|
||||||
|
* @var array<string, array<int, class-string|string>>
|
||||||
|
*/
|
||||||
|
protected $middlewareGroups = [
|
||||||
|
'web' => [
|
||||||
|
\App\Http\Middleware\EncryptCookies::class,
|
||||||
|
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
|
||||||
|
\Illuminate\Session\Middleware\StartSession::class,
|
||||||
|
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
|
||||||
|
\App\Http\Middleware\VerifyCsrfToken::class,
|
||||||
|
\Illuminate\Routing\Middleware\SubstituteBindings::class,
|
||||||
|
],
|
||||||
|
|
||||||
|
'api' => [
|
||||||
|
// \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
|
||||||
|
\Illuminate\Routing\Middleware\ThrottleRequests::class.':api',
|
||||||
|
\Illuminate\Routing\Middleware\SubstituteBindings::class,
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The application's middleware aliases.
|
||||||
|
*
|
||||||
|
* Aliases may be used instead of class names to conveniently assign middleware to routes and groups.
|
||||||
|
*
|
||||||
|
* @var array<string, class-string|string>
|
||||||
|
*/
|
||||||
|
protected $middlewareAliases = [
|
||||||
|
'auth' => \App\Http\Middleware\Authenticate::class,
|
||||||
|
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
|
||||||
|
'auth.session' => \Illuminate\Session\Middleware\AuthenticateSession::class,
|
||||||
|
'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
|
||||||
|
'can' => \Illuminate\Auth\Middleware\Authorize::class,
|
||||||
|
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
|
||||||
|
'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class,
|
||||||
|
'precognitive' => \Illuminate\Foundation\Http\Middleware\HandlePrecognitiveRequests::class,
|
||||||
|
'signed' => \App\Http\Middleware\ValidateSignature::class,
|
||||||
|
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
|
||||||
|
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
|
||||||
|
];
|
||||||
|
}
|
17
app/Http/Middleware/Authenticate.php
Normal file
17
app/Http/Middleware/Authenticate.php
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Middleware;
|
||||||
|
|
||||||
|
use Illuminate\Auth\Middleware\Authenticate as Middleware;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class Authenticate extends Middleware
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Get the path the user should be redirected to when they are not authenticated.
|
||||||
|
*/
|
||||||
|
protected function redirectTo(Request $request): ?string
|
||||||
|
{
|
||||||
|
return $request->expectsJson() ? null : route('login');
|
||||||
|
}
|
||||||
|
}
|
68
app/Http/Middleware/CheckIfAdmin.php
Normal file
68
app/Http/Middleware/CheckIfAdmin.php
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Middleware;
|
||||||
|
|
||||||
|
use Closure;
|
||||||
|
|
||||||
|
class CheckIfAdmin
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Checked that the logged in user is an administrator.
|
||||||
|
*
|
||||||
|
* --------------
|
||||||
|
* VERY IMPORTANT
|
||||||
|
* --------------
|
||||||
|
* If you have both regular users and admins inside the same table, change
|
||||||
|
* the contents of this method to check that the logged in user
|
||||||
|
* is an admin, and not a regular user.
|
||||||
|
*
|
||||||
|
* Additionally, in Laravel 7+, you should change app/Providers/RouteServiceProvider::HOME
|
||||||
|
* which defines the route where a logged in user (but not admin) gets redirected
|
||||||
|
* when trying to access an admin route. By default it's '/home' but Backpack
|
||||||
|
* does not have a '/home' route, use something you've built for your users
|
||||||
|
* (again - users, not admins).
|
||||||
|
*
|
||||||
|
* @param \Illuminate\Contracts\Auth\Authenticatable|null $user
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
private function checkIfUserIsAdmin($user)
|
||||||
|
{
|
||||||
|
// return ($user->is_admin == 1);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Answer to unauthorized access request.
|
||||||
|
*
|
||||||
|
* @param \Illuminate\Http\Request $request
|
||||||
|
* @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse
|
||||||
|
*/
|
||||||
|
private function respondToUnauthorizedRequest($request)
|
||||||
|
{
|
||||||
|
if ($request->ajax() || $request->wantsJson()) {
|
||||||
|
return response(trans('backpack::base.unauthorized'), 401);
|
||||||
|
} else {
|
||||||
|
return redirect()->guest(backpack_url('login'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle an incoming request.
|
||||||
|
*
|
||||||
|
* @param \Illuminate\Http\Request $request
|
||||||
|
* @param \Closure $next
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public function handle($request, Closure $next)
|
||||||
|
{
|
||||||
|
if (backpack_auth()->guest()) {
|
||||||
|
return $this->respondToUnauthorizedRequest($request);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! $this->checkIfUserIsAdmin(backpack_user())) {
|
||||||
|
return $this->respondToUnauthorizedRequest($request);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $next($request);
|
||||||
|
}
|
||||||
|
}
|
17
app/Http/Middleware/EncryptCookies.php
Normal file
17
app/Http/Middleware/EncryptCookies.php
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Middleware;
|
||||||
|
|
||||||
|
use Illuminate\Cookie\Middleware\EncryptCookies as Middleware;
|
||||||
|
|
||||||
|
class EncryptCookies extends Middleware
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The names of the cookies that should not be encrypted.
|
||||||
|
*
|
||||||
|
* @var array<int, string>
|
||||||
|
*/
|
||||||
|
protected $except = [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
17
app/Http/Middleware/PreventRequestsDuringMaintenance.php
Normal file
17
app/Http/Middleware/PreventRequestsDuringMaintenance.php
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Middleware;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance as Middleware;
|
||||||
|
|
||||||
|
class PreventRequestsDuringMaintenance extends Middleware
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The URIs that should be reachable while maintenance mode is enabled.
|
||||||
|
*
|
||||||
|
* @var array<int, string>
|
||||||
|
*/
|
||||||
|
protected $except = [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
30
app/Http/Middleware/RedirectIfAuthenticated.php
Normal file
30
app/Http/Middleware/RedirectIfAuthenticated.php
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Middleware;
|
||||||
|
|
||||||
|
use App\Providers\RouteServiceProvider;
|
||||||
|
use Closure;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
|
|
||||||
|
class RedirectIfAuthenticated
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Handle an incoming request.
|
||||||
|
*
|
||||||
|
* @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next
|
||||||
|
*/
|
||||||
|
public function handle(Request $request, Closure $next, string ...$guards): Response
|
||||||
|
{
|
||||||
|
$guards = empty($guards) ? [null] : $guards;
|
||||||
|
|
||||||
|
foreach ($guards as $guard) {
|
||||||
|
if (Auth::guard($guard)->check()) {
|
||||||
|
return redirect(RouteServiceProvider::HOME);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $next($request);
|
||||||
|
}
|
||||||
|
}
|
19
app/Http/Middleware/TrimStrings.php
Normal file
19
app/Http/Middleware/TrimStrings.php
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Middleware;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Http\Middleware\TrimStrings as Middleware;
|
||||||
|
|
||||||
|
class TrimStrings extends Middleware
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The names of the attributes that should not be trimmed.
|
||||||
|
*
|
||||||
|
* @var array<int, string>
|
||||||
|
*/
|
||||||
|
protected $except = [
|
||||||
|
'current_password',
|
||||||
|
'password',
|
||||||
|
'password_confirmation',
|
||||||
|
];
|
||||||
|
}
|
20
app/Http/Middleware/TrustHosts.php
Normal file
20
app/Http/Middleware/TrustHosts.php
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Middleware;
|
||||||
|
|
||||||
|
use Illuminate\Http\Middleware\TrustHosts as Middleware;
|
||||||
|
|
||||||
|
class TrustHosts extends Middleware
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Get the host patterns that should be trusted.
|
||||||
|
*
|
||||||
|
* @return array<int, string|null>
|
||||||
|
*/
|
||||||
|
public function hosts(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
$this->allSubdomainsOfApplicationUrl(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
28
app/Http/Middleware/TrustProxies.php
Normal file
28
app/Http/Middleware/TrustProxies.php
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Middleware;
|
||||||
|
|
||||||
|
use Illuminate\Http\Middleware\TrustProxies as Middleware;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class TrustProxies extends Middleware
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The trusted proxies for this application.
|
||||||
|
*
|
||||||
|
* @var array<int, string>|string|null
|
||||||
|
*/
|
||||||
|
protected $proxies;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The headers that should be used to detect proxies.
|
||||||
|
*
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
|
protected $headers =
|
||||||
|
Request::HEADER_X_FORWARDED_FOR |
|
||||||
|
Request::HEADER_X_FORWARDED_HOST |
|
||||||
|
Request::HEADER_X_FORWARDED_PORT |
|
||||||
|
Request::HEADER_X_FORWARDED_PROTO |
|
||||||
|
Request::HEADER_X_FORWARDED_AWS_ELB;
|
||||||
|
}
|
22
app/Http/Middleware/ValidateSignature.php
Normal file
22
app/Http/Middleware/ValidateSignature.php
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Middleware;
|
||||||
|
|
||||||
|
use Illuminate\Routing\Middleware\ValidateSignature as Middleware;
|
||||||
|
|
||||||
|
class ValidateSignature extends Middleware
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The names of the query string parameters that should be ignored.
|
||||||
|
*
|
||||||
|
* @var array<int, string>
|
||||||
|
*/
|
||||||
|
protected $except = [
|
||||||
|
// 'fbclid',
|
||||||
|
// 'utm_campaign',
|
||||||
|
// 'utm_content',
|
||||||
|
// 'utm_medium',
|
||||||
|
// 'utm_source',
|
||||||
|
// 'utm_term',
|
||||||
|
];
|
||||||
|
}
|
17
app/Http/Middleware/VerifyCsrfToken.php
Normal file
17
app/Http/Middleware/VerifyCsrfToken.php
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Middleware;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware;
|
||||||
|
|
||||||
|
class VerifyCsrfToken extends Middleware
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The URIs that should be excluded from CSRF verification.
|
||||||
|
*
|
||||||
|
* @var array<int, string>
|
||||||
|
*/
|
||||||
|
protected $except = [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
55
app/Http/Requests/EventCatalogRequest.php
Normal file
55
app/Http/Requests/EventCatalogRequest.php
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
|
|
||||||
|
class EventCatalogRequest extends FormRequest
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Determine if the user is authorized to make this request.
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function authorize()
|
||||||
|
{
|
||||||
|
// only allow updates if the user is logged in
|
||||||
|
return backpack_auth()->check();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the validation rules that apply to the request.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function rules()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
// 'name' => 'required|min:5|max:255'
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the validation attributes that apply to the request.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function attributes()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the validation messages that apply to the request.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function messages()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
55
app/Http/Requests/EventRequest.php
Normal file
55
app/Http/Requests/EventRequest.php
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
|
|
||||||
|
class EventRequest extends FormRequest
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Determine if the user is authorized to make this request.
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function authorize()
|
||||||
|
{
|
||||||
|
// only allow updates if the user is logged in
|
||||||
|
return backpack_auth()->check();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the validation rules that apply to the request.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function rules()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
// 'name' => 'required|min:5|max:255'
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the validation attributes that apply to the request.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function attributes()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the validation messages that apply to the request.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function messages()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
55
app/Http/Requests/HomeCarouselRequest.php
Normal file
55
app/Http/Requests/HomeCarouselRequest.php
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
|
|
||||||
|
class HomeCarouselRequest extends FormRequest
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Determine if the user is authorized to make this request.
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function authorize()
|
||||||
|
{
|
||||||
|
// only allow updates if the user is logged in
|
||||||
|
return backpack_auth()->check();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the validation rules that apply to the request.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function rules()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
// 'name' => 'required|min:5|max:255'
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the validation attributes that apply to the request.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function attributes()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the validation messages that apply to the request.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function messages()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
55
app/Http/Requests/NewsCatalogRequest.php
Normal file
55
app/Http/Requests/NewsCatalogRequest.php
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
|
|
||||||
|
class NewsCatalogRequest extends FormRequest
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Determine if the user is authorized to make this request.
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function authorize()
|
||||||
|
{
|
||||||
|
// only allow updates if the user is logged in
|
||||||
|
return backpack_auth()->check();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the validation rules that apply to the request.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function rules()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
// 'name' => 'required|min:5|max:255'
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the validation attributes that apply to the request.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function attributes()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the validation messages that apply to the request.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function messages()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
55
app/Http/Requests/NewsRequest.php
Normal file
55
app/Http/Requests/NewsRequest.php
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
|
|
||||||
|
class NewsRequest extends FormRequest
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Determine if the user is authorized to make this request.
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function authorize()
|
||||||
|
{
|
||||||
|
// only allow updates if the user is logged in
|
||||||
|
return backpack_auth()->check();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the validation rules that apply to the request.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function rules()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
// 'name' => 'required|min:5|max:255'
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the validation attributes that apply to the request.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function attributes()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the validation messages that apply to the request.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function messages()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
55
app/Http/Requests/ProductApplicationRequest.php
Normal file
55
app/Http/Requests/ProductApplicationRequest.php
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
|
|
||||||
|
class ProductApplicationRequest extends FormRequest
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Determine if the user is authorized to make this request.
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function authorize()
|
||||||
|
{
|
||||||
|
// only allow updates if the user is logged in
|
||||||
|
return backpack_auth()->check();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the validation rules that apply to the request.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function rules()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'slug' => 'required|unique:product_applications,slug',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the validation attributes that apply to the request.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function attributes()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the validation messages that apply to the request.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function messages()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
55
app/Http/Requests/ProductCatalogRequest.php
Normal file
55
app/Http/Requests/ProductCatalogRequest.php
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
|
|
||||||
|
class ProductCatalogRequest extends FormRequest
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Determine if the user is authorized to make this request.
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function authorize()
|
||||||
|
{
|
||||||
|
// only allow updates if the user is logged in
|
||||||
|
return backpack_auth()->check();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the validation rules that apply to the request.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function rules()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'slug' => 'required|unique:product_catalogs,slug',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the validation attributes that apply to the request.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function attributes()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the validation messages that apply to the request.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function messages()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
55
app/Http/Requests/ProductRequest.php
Normal file
55
app/Http/Requests/ProductRequest.php
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
|
|
||||||
|
class ProductRequest extends FormRequest
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Determine if the user is authorized to make this request.
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function authorize()
|
||||||
|
{
|
||||||
|
// only allow updates if the user is logged in
|
||||||
|
return backpack_auth()->check();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the validation rules that apply to the request.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function rules()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
// 'slug' => 'required|unique:products,slug',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the validation attributes that apply to the request.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function attributes()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the validation messages that apply to the request.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function messages()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,55 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
|
|
||||||
|
class SupportDistributionPartnerCatalogRequest extends FormRequest
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Determine if the user is authorized to make this request.
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function authorize()
|
||||||
|
{
|
||||||
|
// only allow updates if the user is logged in
|
||||||
|
return backpack_auth()->check();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the validation rules that apply to the request.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function rules()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
// 'name' => 'required|min:5|max:255'
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the validation attributes that apply to the request.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function attributes()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the validation messages that apply to the request.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function messages()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
55
app/Http/Requests/SupportDistributionPartnerRequest.php
Normal file
55
app/Http/Requests/SupportDistributionPartnerRequest.php
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
|
|
||||||
|
class SupportDistributionPartnerRequest extends FormRequest
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Determine if the user is authorized to make this request.
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function authorize()
|
||||||
|
{
|
||||||
|
// only allow updates if the user is logged in
|
||||||
|
return backpack_auth()->check();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the validation rules that apply to the request.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function rules()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
// 'name' => 'required|min:5|max:255'
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the validation attributes that apply to the request.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function attributes()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the validation messages that apply to the request.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function messages()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
55
app/Http/Requests/SupportEcosystemPartnerCatalogRequest.php
Normal file
55
app/Http/Requests/SupportEcosystemPartnerCatalogRequest.php
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
|
|
||||||
|
class SupportEcosystemPartnerCatalogRequest extends FormRequest
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Determine if the user is authorized to make this request.
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function authorize()
|
||||||
|
{
|
||||||
|
// only allow updates if the user is logged in
|
||||||
|
return backpack_auth()->check();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the validation rules that apply to the request.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function rules()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
// 'name' => 'required|min:5|max:255'
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the validation attributes that apply to the request.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function attributes()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the validation messages that apply to the request.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function messages()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
55
app/Http/Requests/SupportEcosystemPartnerRequest.php
Normal file
55
app/Http/Requests/SupportEcosystemPartnerRequest.php
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
|
|
||||||
|
class SupportEcosystemPartnerRequest extends FormRequest
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Determine if the user is authorized to make this request.
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function authorize()
|
||||||
|
{
|
||||||
|
// only allow updates if the user is logged in
|
||||||
|
return backpack_auth()->check();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the validation rules that apply to the request.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function rules()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
// 'name' => 'required|min:5|max:255'
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the validation attributes that apply to the request.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function attributes()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the validation messages that apply to the request.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function messages()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
62
app/Http/Requests/SupportSaleRequest.php
Normal file
62
app/Http/Requests/SupportSaleRequest.php
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
|
|
||||||
|
class SupportSaleRequest extends FormRequest
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Determine if the user is authorized to make this request.
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function authorize()
|
||||||
|
{
|
||||||
|
// only allow updates if the user is logged in
|
||||||
|
return backpack_auth()->check();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the validation rules that apply to the request.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function rules()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'name_first' => 'required',
|
||||||
|
'name_last' => 'required',
|
||||||
|
'company_name' => 'required',
|
||||||
|
//'job_title' => 'required',
|
||||||
|
'email' => 'nullable|email',
|
||||||
|
'phone' => 'required',
|
||||||
|
'contry' => 'required',
|
||||||
|
'comments' => 'required',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the validation attributes that apply to the request.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function attributes()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the validation messages that apply to the request.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function messages()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
62
app/Http/Requests/SupportTechnicalRequest.php
Normal file
62
app/Http/Requests/SupportTechnicalRequest.php
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
|
|
||||||
|
class SupportTechnicalRequest extends FormRequest
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Determine if the user is authorized to make this request.
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function authorize()
|
||||||
|
{
|
||||||
|
// only allow updates if the user is logged in
|
||||||
|
return backpack_auth()->check();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the validation rules that apply to the request.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function rules()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'name_first' => 'required',
|
||||||
|
'name_last' => 'required',
|
||||||
|
'company_name' => 'required',
|
||||||
|
//'job_title' => 'required',
|
||||||
|
'email' => 'nullable|email',
|
||||||
|
'phone' => 'required',
|
||||||
|
'contry' => 'required',
|
||||||
|
'comments' => 'required',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the validation attributes that apply to the request.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function attributes()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the validation messages that apply to the request.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function messages()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
55
app/Http/Requests/UserRequest.php
Normal file
55
app/Http/Requests/UserRequest.php
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
|
|
||||||
|
class UserRequest extends FormRequest
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Determine if the user is authorized to make this request.
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function authorize()
|
||||||
|
{
|
||||||
|
// only allow updates if the user is logged in
|
||||||
|
return backpack_auth()->check();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the validation rules that apply to the request.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function rules()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
// 'name' => 'required|min:5|max:255'
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the validation attributes that apply to the request.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function attributes()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the validation messages that apply to the request.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function messages()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
85
app/Models/Event.php
Normal file
85
app/Models/Event.php
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Backpack\CRUD\app\Models\Traits\CrudTrait;
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Backpack\CRUD\app\Models\Traits\SpatieTranslatable\HasTranslations;
|
||||||
|
use Ericli1018\AwesomeFieldsForBackpack\Models\Traits\HasUploadImgFields;
|
||||||
|
|
||||||
|
class Event extends Model
|
||||||
|
{
|
||||||
|
use CrudTrait;
|
||||||
|
use HasFactory;
|
||||||
|
use HasTranslations;
|
||||||
|
use HasUploadImgFields;
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| GLOBAL VARIABLES
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
protected $table = 'events';
|
||||||
|
// protected $primaryKey = 'id';
|
||||||
|
// public $timestamps = false;
|
||||||
|
protected $guarded = ['id'];
|
||||||
|
// protected $fillable = [];
|
||||||
|
// protected $hidden = [];
|
||||||
|
public $translatable = ['title', 'body', 'venue', 'contact', 'seo_keyword', 'seo_description'];
|
||||||
|
protected $casts = [
|
||||||
|
'post_at' => 'datetime',
|
||||||
|
'photos' => 'array',
|
||||||
|
];
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| FUNCTIONS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
public static function boot()
|
||||||
|
{
|
||||||
|
parent::boot();
|
||||||
|
static::deleting(function($obj) {
|
||||||
|
if (count((array)$obj->photos)) {
|
||||||
|
foreach ($obj->photos as $item) {
|
||||||
|
\Storage::disk('public')->delete($item['file_path']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| RELATIONS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
public function eventCatalog()
|
||||||
|
{
|
||||||
|
return $this->belongsTo(EventCatalog::class, 'event_catalog_id');
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| SCOPES
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| ACCESSORS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| MUTATORS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
public function setPhotosAttribute($value)
|
||||||
|
{
|
||||||
|
$attribute_name = "photos";
|
||||||
|
$disk = "public";
|
||||||
|
$destination_path = "events";
|
||||||
|
|
||||||
|
$this->uploadImgMultipleFilesToDisk($value, $attribute_name, $disk, $destination_path);
|
||||||
|
}
|
||||||
|
}
|
67
app/Models/EventCatalog.php
Normal file
67
app/Models/EventCatalog.php
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Backpack\CRUD\app\Models\Traits\CrudTrait;
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Backpack\CRUD\app\Models\Traits\SpatieTranslatable\HasTranslations;
|
||||||
|
|
||||||
|
class EventCatalog extends Model
|
||||||
|
{
|
||||||
|
use CrudTrait;
|
||||||
|
use HasFactory;
|
||||||
|
use HasTranslations;
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| GLOBAL VARIABLES
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
protected $table = 'event_catalogs';
|
||||||
|
// protected $primaryKey = 'id';
|
||||||
|
// public $timestamps = false;
|
||||||
|
protected $guarded = ['id'];
|
||||||
|
// protected $fillable = [];
|
||||||
|
// protected $hidden = [];
|
||||||
|
public $translatable = ['name'];
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| FUNCTIONS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| RELATIONS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
public function parent()
|
||||||
|
{
|
||||||
|
return $this->belongsTo(EventCatalog::class, 'parent_id');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function children()
|
||||||
|
{
|
||||||
|
return $this->hasMany(EventCatalog::class, 'parent_id');
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| SCOPES
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| ACCESSORS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| MUTATORS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
}
|
90
app/Models/HomeCarousel.php
Normal file
90
app/Models/HomeCarousel.php
Normal file
@ -0,0 +1,90 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Backpack\CRUD\app\Models\Traits\CrudTrait;
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Backpack\CRUD\app\Models\Traits\SpatieTranslatable\HasTranslations;
|
||||||
|
use Ericli1018\AwesomeFieldsForBackpack\Models\Traits\HasUploadImgFields;
|
||||||
|
|
||||||
|
class HomeCarousel extends Model
|
||||||
|
{
|
||||||
|
use CrudTrait;
|
||||||
|
use HasFactory;
|
||||||
|
use HasTranslations;
|
||||||
|
use HasUploadImgFields;
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| GLOBAL VARIABLES
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
protected $table = 'home_carousel';
|
||||||
|
// protected $primaryKey = 'id';
|
||||||
|
// public $timestamps = false;
|
||||||
|
protected $guarded = ['id'];
|
||||||
|
// protected $fillable = [];
|
||||||
|
// protected $hidden = [];
|
||||||
|
public $translatable = ['title','body'];
|
||||||
|
protected $casts = [
|
||||||
|
'photos' => 'array',
|
||||||
|
];
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| FUNCTIONS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
public static function boot()
|
||||||
|
{
|
||||||
|
parent::boot();
|
||||||
|
static::deleting(function($obj) {
|
||||||
|
if (count((array)$obj->photos)) {
|
||||||
|
foreach ($obj->photos as $item) {
|
||||||
|
\Storage::disk('public')->delete($item['file_path']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| RELATIONS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
public function parent()
|
||||||
|
{
|
||||||
|
return $this->belongsTo(HomeCarousel::class, 'parent_id');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function children()
|
||||||
|
{
|
||||||
|
return $this->hasMany(HomeCarousel::class, 'parent_id');
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| SCOPES
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| ACCESSORS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| MUTATORS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
public function setPhotosAttribute($value)
|
||||||
|
{
|
||||||
|
$attribute_name = "photos";
|
||||||
|
$disk = "public";
|
||||||
|
$destination_path = "home_carousel";
|
||||||
|
|
||||||
|
$this->uploadImgMultipleFilesToDisk($value, $attribute_name, $disk, $destination_path);
|
||||||
|
}
|
||||||
|
}
|
86
app/Models/News.php
Normal file
86
app/Models/News.php
Normal file
@ -0,0 +1,86 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Backpack\CRUD\app\Models\Traits\CrudTrait;
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Backpack\CRUD\app\Models\Traits\SpatieTranslatable\HasTranslations;
|
||||||
|
use Ericli1018\AwesomeFieldsForBackpack\Models\Traits\HasUploadImgFields;
|
||||||
|
|
||||||
|
class News extends Model
|
||||||
|
{
|
||||||
|
use CrudTrait;
|
||||||
|
use HasFactory;
|
||||||
|
use HasTranslations;
|
||||||
|
use HasUploadImgFields;
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| GLOBAL VARIABLES
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
protected $table = 'news';
|
||||||
|
// protected $primaryKey = 'id';
|
||||||
|
// public $timestamps = false;
|
||||||
|
protected $guarded = ['id'];
|
||||||
|
// protected $fillable = [];
|
||||||
|
// protected $hidden = [];
|
||||||
|
public $translatable = ['title','description', 'body', 'seo_keyword', 'seo_description'];
|
||||||
|
protected $casts = [
|
||||||
|
'post_at' => 'datetime',
|
||||||
|
'photos' => 'array',
|
||||||
|
];
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| FUNCTIONS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
public static function boot()
|
||||||
|
{
|
||||||
|
parent::boot();
|
||||||
|
static::deleting(function($obj) {
|
||||||
|
if (count((array)$obj->photos)) {
|
||||||
|
foreach ($obj->photos as $item) {
|
||||||
|
\Storage::disk('public')->delete($item['file_path']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| RELATIONS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
public function newsCatalog()
|
||||||
|
{
|
||||||
|
return $this->belongsTo(NewsCatalog::class, 'news_catalog_id');
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| SCOPES
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| ACCESSORS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| MUTATORS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
public function setPhotosAttribute($value)
|
||||||
|
{
|
||||||
|
$attribute_name = "photos";
|
||||||
|
$disk = "public";
|
||||||
|
$destination_path = "news";
|
||||||
|
|
||||||
|
$this->uploadImgMultipleFilesToDisk($value, $attribute_name, $disk, $destination_path);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
67
app/Models/NewsCatalog.php
Normal file
67
app/Models/NewsCatalog.php
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Backpack\CRUD\app\Models\Traits\CrudTrait;
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Backpack\CRUD\app\Models\Traits\SpatieTranslatable\HasTranslations;
|
||||||
|
|
||||||
|
class NewsCatalog extends Model
|
||||||
|
{
|
||||||
|
use CrudTrait;
|
||||||
|
use HasFactory;
|
||||||
|
use HasTranslations;
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| GLOBAL VARIABLES
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
protected $table = 'news_catalogs';
|
||||||
|
// protected $primaryKey = 'id';
|
||||||
|
// public $timestamps = false;
|
||||||
|
protected $guarded = ['id'];
|
||||||
|
// protected $fillable = [];
|
||||||
|
// protected $hidden = [];
|
||||||
|
public $translatable = ['name'];
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| FUNCTIONS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| RELATIONS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
public function parent()
|
||||||
|
{
|
||||||
|
return $this->belongsTo(NewsCatalog::class, 'parent_id');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function children()
|
||||||
|
{
|
||||||
|
return $this->hasMany(NewsCatalog::class, 'parent_id');
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| SCOPES
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| ACCESSORS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| MUTATORS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
}
|
30
app/Models/Permission.php
Normal file
30
app/Models/Permission.php
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Backpack\PermissionManager\app\Models\Permission as OriginalPermission;
|
||||||
|
use Backpack\CRUD\app\Models\Traits\SpatieTranslatable\Sluggable;
|
||||||
|
use Backpack\CRUD\app\Models\Traits\SpatieTranslatable\SluggableScopeHelpers;
|
||||||
|
use Backpack\CRUD\app\Models\Traits\SpatieTranslatable\HasTranslations;
|
||||||
|
|
||||||
|
class Permission extends OriginalPermission
|
||||||
|
{
|
||||||
|
use HasTranslations;
|
||||||
|
use Sluggable, SluggableScopeHelpers;
|
||||||
|
public $translatable = ['name'];
|
||||||
|
protected $fillable = ['slug', 'name', 'guard_name', 'updated_at', 'created_at'];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the sluggable configuration array for this model.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function sluggable(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'slug' => [
|
||||||
|
'source' => 'slug_or_name',
|
||||||
|
],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
90
app/Models/Product.php
Normal file
90
app/Models/Product.php
Normal file
@ -0,0 +1,90 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Backpack\CRUD\app\Models\Traits\CrudTrait;
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Backpack\CRUD\app\Models\Traits\SpatieTranslatable\HasTranslations;
|
||||||
|
use Ericli1018\AwesomeFieldsForBackpack\Models\Traits\HasUploadImgFields;
|
||||||
|
|
||||||
|
class Product extends Model
|
||||||
|
{
|
||||||
|
use CrudTrait;
|
||||||
|
use HasFactory;
|
||||||
|
use HasTranslations;
|
||||||
|
use HasUploadImgFields;
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| GLOBAL VARIABLES
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
protected $table = 'products';
|
||||||
|
// protected $primaryKey = 'id';
|
||||||
|
// public $timestamps = false;
|
||||||
|
protected $guarded = ['id'];
|
||||||
|
// protected $fillable = [];
|
||||||
|
// protected $hidden = [];
|
||||||
|
public $translatable = ['title', 'tip', 'description', 'body', 'feature_overview', 'feature_spec', 'seo_keyword', 'seo_description'];
|
||||||
|
protected $casts = [
|
||||||
|
'photos' => 'array',
|
||||||
|
];
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| FUNCTIONS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
public static function boot()
|
||||||
|
{
|
||||||
|
parent::boot();
|
||||||
|
static::deleting(function($obj) {
|
||||||
|
if (count((array)$obj->photos)) {
|
||||||
|
foreach ($obj->photos as $item) {
|
||||||
|
\Storage::disk('public')->delete($item['file_path']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| RELATIONS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
public function productCatalog()
|
||||||
|
{
|
||||||
|
return $this->belongsTo(ProductCatalog::class, 'product_catalog_id');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function productApplications()
|
||||||
|
{
|
||||||
|
return $this->belongsToMany(ProductApplication::class, 'product_product_application');
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| SCOPES
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| ACCESSORS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| MUTATORS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
public function setPhotosAttribute($value)
|
||||||
|
{
|
||||||
|
$attribute_name = "photos";
|
||||||
|
$disk = "public";
|
||||||
|
$destination_path = "products";
|
||||||
|
|
||||||
|
$this->uploadImgMultipleFilesToDisk($value, $attribute_name, $disk, $destination_path);
|
||||||
|
}
|
||||||
|
}
|
62
app/Models/ProductApplication.php
Normal file
62
app/Models/ProductApplication.php
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Backpack\CRUD\app\Models\Traits\CrudTrait;
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Backpack\CRUD\app\Models\Traits\SpatieTranslatable\HasTranslations;
|
||||||
|
|
||||||
|
class ProductApplication extends Model
|
||||||
|
{
|
||||||
|
use CrudTrait;
|
||||||
|
use HasFactory;
|
||||||
|
use HasTranslations;
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| GLOBAL VARIABLES
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
protected $table = 'product_applications';
|
||||||
|
// protected $primaryKey = 'id';
|
||||||
|
// public $timestamps = false;
|
||||||
|
protected $guarded = ['id'];
|
||||||
|
// protected $fillable = [];
|
||||||
|
// protected $hidden = [];
|
||||||
|
public $translatable = ['name'];
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| FUNCTIONS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| RELATIONS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
public function products()
|
||||||
|
{
|
||||||
|
return $this->belongsToMany(Product::class, 'product_product_application');
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| SCOPES
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| ACCESSORS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| MUTATORS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
}
|
67
app/Models/ProductCatalog.php
Normal file
67
app/Models/ProductCatalog.php
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Backpack\CRUD\app\Models\Traits\CrudTrait;
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Backpack\CRUD\app\Models\Traits\SpatieTranslatable\HasTranslations;
|
||||||
|
|
||||||
|
class ProductCatalog extends Model
|
||||||
|
{
|
||||||
|
use CrudTrait;
|
||||||
|
use HasFactory;
|
||||||
|
use HasTranslations;
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| GLOBAL VARIABLES
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
protected $table = 'product_catalogs';
|
||||||
|
// protected $primaryKey = 'id';
|
||||||
|
// public $timestamps = false;
|
||||||
|
protected $guarded = ['id'];
|
||||||
|
// protected $fillable = [];
|
||||||
|
// protected $hidden = [];
|
||||||
|
public $translatable = ['name'];
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| FUNCTIONS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| RELATIONS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
public function parent()
|
||||||
|
{
|
||||||
|
return $this->belongsTo(ProductCatalog::class, 'parent_id');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function children()
|
||||||
|
{
|
||||||
|
return $this->hasMany(ProductCatalog::class, 'parent_id');
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| SCOPES
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| ACCESSORS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| MUTATORS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
}
|
30
app/Models/Role.php
Normal file
30
app/Models/Role.php
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Backpack\PermissionManager\app\Models\Role as OriginalRole;
|
||||||
|
use Backpack\CRUD\app\Models\Traits\SpatieTranslatable\Sluggable;
|
||||||
|
use Backpack\CRUD\app\Models\Traits\SpatieTranslatable\SluggableScopeHelpers;
|
||||||
|
use Backpack\CRUD\app\Models\Traits\SpatieTranslatable\HasTranslations;
|
||||||
|
|
||||||
|
class Role extends OriginalRole
|
||||||
|
{
|
||||||
|
use HasTranslations;
|
||||||
|
use Sluggable, SluggableScopeHelpers;
|
||||||
|
public $translatable = ['name'];
|
||||||
|
protected $fillable = ['slug', 'name', 'guard_name', 'updated_at', 'created_at'];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the sluggable configuration array for this model.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function sluggable(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'slug' => [
|
||||||
|
'source' => 'slug_or_name',
|
||||||
|
],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
85
app/Models/SupportDistributionPartner.php
Normal file
85
app/Models/SupportDistributionPartner.php
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Backpack\CRUD\app\Models\Traits\CrudTrait;
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Backpack\CRUD\app\Models\Traits\SpatieTranslatable\HasTranslations;
|
||||||
|
use Ericli1018\AwesomeFieldsForBackpack\Models\Traits\HasUploadImgFields;
|
||||||
|
|
||||||
|
class SupportDistributionPartner extends Model
|
||||||
|
{
|
||||||
|
use CrudTrait;
|
||||||
|
use HasFactory;
|
||||||
|
use HasTranslations;
|
||||||
|
use HasUploadImgFields;
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| GLOBAL VARIABLES
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
protected $table = 'support_distribution_partners';
|
||||||
|
// protected $primaryKey = 'id';
|
||||||
|
// public $timestamps = false;
|
||||||
|
protected $guarded = ['id'];
|
||||||
|
// protected $fillable = [];
|
||||||
|
// protected $hidden = [];
|
||||||
|
public $translatable = ['title', 'description', 'website'];
|
||||||
|
protected $casts = [
|
||||||
|
'photos' => 'array',
|
||||||
|
];
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| FUNCTIONS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
public static function boot()
|
||||||
|
{
|
||||||
|
parent::boot();
|
||||||
|
static::deleting(function($obj) {
|
||||||
|
if (count((array)$obj->photos)) {
|
||||||
|
foreach ($obj->photos as $item) {
|
||||||
|
\Storage::disk('public')->delete($item['file_path']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| RELATIONS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
public function supportDistributionPartnerCatalog()
|
||||||
|
{
|
||||||
|
return $this->belongsTo(SupportDistributionPartnerCatalog::class, 'support_distribution_partner_catalog_id');
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| SCOPES
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| ACCESSORS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| MUTATORS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
public function setPhotosAttribute($value)
|
||||||
|
{
|
||||||
|
$attribute_name = "photos";
|
||||||
|
$disk = "public";
|
||||||
|
$destination_path = "support_distribution_partners";
|
||||||
|
|
||||||
|
$this->uploadImgMultipleFilesToDisk($value, $attribute_name, $disk, $destination_path);
|
||||||
|
}
|
||||||
|
}
|
67
app/Models/SupportDistributionPartnerCatalog.php
Normal file
67
app/Models/SupportDistributionPartnerCatalog.php
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Backpack\CRUD\app\Models\Traits\CrudTrait;
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Backpack\CRUD\app\Models\Traits\SpatieTranslatable\HasTranslations;
|
||||||
|
|
||||||
|
class SupportDistributionPartnerCatalog extends Model
|
||||||
|
{
|
||||||
|
use CrudTrait;
|
||||||
|
use HasFactory;
|
||||||
|
use HasTranslations;
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| GLOBAL VARIABLES
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
protected $table = 'support_distribution_partner_catalogs';
|
||||||
|
// protected $primaryKey = 'id';
|
||||||
|
// public $timestamps = false;
|
||||||
|
protected $guarded = ['id'];
|
||||||
|
// protected $fillable = [];
|
||||||
|
// protected $hidden = [];
|
||||||
|
public $translatable = ['name'];
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| FUNCTIONS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| RELATIONS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
public function parent()
|
||||||
|
{
|
||||||
|
return $this->belongsTo(SupportDistributionPartnerCatalog::class, 'parent_id');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function children()
|
||||||
|
{
|
||||||
|
return $this->hasMany(SupportDistributionPartnerCatalog::class, 'parent_id');
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| SCOPES
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| ACCESSORS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| MUTATORS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
}
|
84
app/Models/SupportEcosystemPartner.php
Normal file
84
app/Models/SupportEcosystemPartner.php
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Backpack\CRUD\app\Models\Traits\CrudTrait;
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Backpack\CRUD\app\Models\Traits\SpatieTranslatable\HasTranslations;
|
||||||
|
use Ericli1018\AwesomeFieldsForBackpack\Models\Traits\HasUploadImgFields;
|
||||||
|
|
||||||
|
class SupportEcosystemPartner extends Model
|
||||||
|
{
|
||||||
|
use CrudTrait;
|
||||||
|
use HasFactory;
|
||||||
|
use HasTranslations;
|
||||||
|
use HasUploadImgFields;
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| GLOBAL VARIABLES
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
protected $table = 'support_ecosystem_partners';
|
||||||
|
// protected $primaryKey = 'id';
|
||||||
|
// public $timestamps = false;
|
||||||
|
protected $guarded = ['id'];
|
||||||
|
// protected $fillable = [];
|
||||||
|
// protected $hidden = [];
|
||||||
|
public $translatable = ['title', 'description', 'website'];
|
||||||
|
protected $casts = [
|
||||||
|
'photos' => 'array',
|
||||||
|
];
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| FUNCTIONS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
public static function boot()
|
||||||
|
{
|
||||||
|
parent::boot();
|
||||||
|
static::deleting(function($obj) {
|
||||||
|
if (count((array)$obj->photos)) {
|
||||||
|
foreach ($obj->photos as $item) {
|
||||||
|
\Storage::disk('public')->delete($item['file_path']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| RELATIONS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| SCOPES
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
public function supportEcosystemPartnerCatalog()
|
||||||
|
{
|
||||||
|
return $this->belongsTo(SupportEcosystemPartnerCatalog::class, 'support_ecosystem_partner_catalog_id');
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| ACCESSORS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| MUTATORS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
public function setPhotosAttribute($value)
|
||||||
|
{
|
||||||
|
$attribute_name = "photos";
|
||||||
|
$disk = "public";
|
||||||
|
$destination_path = "support_ecosystem_partners";
|
||||||
|
|
||||||
|
$this->uploadImgMultipleFilesToDisk($value, $attribute_name, $disk, $destination_path);
|
||||||
|
}
|
||||||
|
}
|
67
app/Models/SupportEcosystemPartnerCatalog.php
Normal file
67
app/Models/SupportEcosystemPartnerCatalog.php
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Backpack\CRUD\app\Models\Traits\CrudTrait;
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Backpack\CRUD\app\Models\Traits\SpatieTranslatable\HasTranslations;
|
||||||
|
|
||||||
|
class SupportEcosystemPartnerCatalog extends Model
|
||||||
|
{
|
||||||
|
use CrudTrait;
|
||||||
|
use HasFactory;
|
||||||
|
use HasTranslations;
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| GLOBAL VARIABLES
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
protected $table = 'support_ecosystem_partner_catalogs';
|
||||||
|
// protected $primaryKey = 'id';
|
||||||
|
// public $timestamps = false;
|
||||||
|
protected $guarded = ['id'];
|
||||||
|
// protected $fillable = [];
|
||||||
|
// protected $hidden = [];
|
||||||
|
public $translatable = ['name'];
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| FUNCTIONS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| RELATIONS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
public function parent()
|
||||||
|
{
|
||||||
|
return $this->belongsTo(SupportEcosystemPartnerCatalog::class, 'parent_id');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function children()
|
||||||
|
{
|
||||||
|
return $this->hasMany(SupportEcosystemPartnerCatalog::class, 'parent_id');
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| SCOPES
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| ACCESSORS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| MUTATORS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
}
|
56
app/Models/SupportSale.php
Normal file
56
app/Models/SupportSale.php
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Backpack\CRUD\app\Models\Traits\CrudTrait;
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class SupportSale extends Model
|
||||||
|
{
|
||||||
|
use CrudTrait;
|
||||||
|
use HasFactory;
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| GLOBAL VARIABLES
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
protected $table = 'support_sales';
|
||||||
|
// protected $primaryKey = 'id';
|
||||||
|
// public $timestamps = false;
|
||||||
|
protected $guarded = ['id'];
|
||||||
|
// protected $fillable = [];
|
||||||
|
// protected $hidden = [];
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| FUNCTIONS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| RELATIONS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| SCOPES
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| ACCESSORS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| MUTATORS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
}
|
56
app/Models/SupportTechnical.php
Normal file
56
app/Models/SupportTechnical.php
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Backpack\CRUD\app\Models\Traits\CrudTrait;
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class SupportTechnical extends Model
|
||||||
|
{
|
||||||
|
use CrudTrait;
|
||||||
|
use HasFactory;
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| GLOBAL VARIABLES
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
protected $table = 'support_technicals';
|
||||||
|
// protected $primaryKey = 'id';
|
||||||
|
// public $timestamps = false;
|
||||||
|
protected $guarded = ['id'];
|
||||||
|
// protected $fillable = [];
|
||||||
|
// protected $hidden = [];
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| FUNCTIONS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| RELATIONS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| SCOPES
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| ACCESSORS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| MUTATORS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
}
|
48
app/Models/User.php
Normal file
48
app/Models/User.php
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Backpack\CRUD\app\Models\Traits\CrudTrait;
|
||||||
|
// use Illuminate\Contracts\Auth\MustVerifyEmail;
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||||
|
use Illuminate\Notifications\Notifiable;
|
||||||
|
use Laravel\Sanctum\HasApiTokens;
|
||||||
|
use Spatie\Permission\Traits\HasRoles;
|
||||||
|
|
||||||
|
class User extends Authenticatable
|
||||||
|
{
|
||||||
|
use CrudTrait;
|
||||||
|
use HasApiTokens, HasFactory, Notifiable, HasRoles;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The attributes that are mass assignable.
|
||||||
|
*
|
||||||
|
* @var array<int, string>
|
||||||
|
*/
|
||||||
|
protected $fillable = [
|
||||||
|
'name',
|
||||||
|
'email',
|
||||||
|
'password',
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The attributes that should be hidden for serialization.
|
||||||
|
*
|
||||||
|
* @var array<int, string>
|
||||||
|
*/
|
||||||
|
protected $hidden = [
|
||||||
|
'password',
|
||||||
|
'remember_token',
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The attributes that should be cast.
|
||||||
|
*
|
||||||
|
* @var array<string, string>
|
||||||
|
*/
|
||||||
|
protected $casts = [
|
||||||
|
'email_verified_at' => 'datetime',
|
||||||
|
'password' => 'hashed',
|
||||||
|
];
|
||||||
|
}
|
405
app/Overrides/backpack/crud/src/helpers.php
Normal file
405
app/Overrides/backpack/crud/src/helpers.php
Normal file
@ -0,0 +1,405 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Backpack\Basset\Facades\Basset;
|
||||||
|
use Creativeorange\Gravatar\Facades\Gravatar;
|
||||||
|
use Illuminate\Support\Facades\Log;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
|
if (! function_exists('backpack_url')) {
|
||||||
|
/**
|
||||||
|
* Appends the configured backpack prefix and returns
|
||||||
|
* the URL using the standard Laravel helpers.
|
||||||
|
*
|
||||||
|
* @param $path
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function backpack_url($path = null, $parameters = [], $secure = null)
|
||||||
|
{
|
||||||
|
$path = ! $path || (substr($path, 0, 1) == '/') ? $path : '/'.$path;
|
||||||
|
|
||||||
|
return url(config('backpack.base.route_prefix', 'admin').$path, $parameters, $secure);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! function_exists('backpack_authentication_column')) {
|
||||||
|
/**
|
||||||
|
* Return the username column name.
|
||||||
|
* The Laravel default (and Backpack default) is 'email'.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function backpack_authentication_column()
|
||||||
|
{
|
||||||
|
return config('backpack.base.authentication_column', 'email');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! function_exists('backpack_email_column')) {
|
||||||
|
/**
|
||||||
|
* Return the email column name.
|
||||||
|
* The Laravel default (and Backpack default) is 'email'.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function backpack_email_column()
|
||||||
|
{
|
||||||
|
return config('backpack.base.email_column', 'email');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! function_exists('backpack_form_input')) {
|
||||||
|
/**
|
||||||
|
* Parse the submitted input in request('form') to an usable array.
|
||||||
|
* Joins the multiple[] fields in a single key and transform the dot notation fields into arrayed ones.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
function backpack_form_input()
|
||||||
|
{
|
||||||
|
$input = request('form') ?? [];
|
||||||
|
$result = [];
|
||||||
|
|
||||||
|
foreach ($input as $row) {
|
||||||
|
$repeatableRowKey = null;
|
||||||
|
|
||||||
|
// regular fields don't need any aditional parsing
|
||||||
|
if (strpos($row['name'], '[') === false) {
|
||||||
|
$result[$row['name']] = $row['value'];
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$isMultiple = substr($row['name'], -2, 2) === '[]';
|
||||||
|
|
||||||
|
if ($isMultiple && substr_count($row['name'], '[') === 1) {
|
||||||
|
$result[substr($row['name'], 0, -2)][] = $row['value'];
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// dot notation fields
|
||||||
|
if (substr_count($row['name'], '[') === 1) {
|
||||||
|
// start in the first occurence since it's HasOne/MorphOne with dot notation (address[street] in request) to get the input name (address)
|
||||||
|
$inputNameStart = strpos($row['name'], '[') + 1;
|
||||||
|
} else {
|
||||||
|
// repeatable fields, we need to get the input name and the row number
|
||||||
|
// start on the second occurence since it's a repeatable and we want to bypass the row number (repeatableName[rowNumber][inputName])
|
||||||
|
$inputNameStart = strpos($row['name'], '[', strpos($row['name'], '[') + 1) + 1;
|
||||||
|
|
||||||
|
// get the array key (aka repeatable row) from field name
|
||||||
|
$startKey = strpos($row['name'], '[') + 1;
|
||||||
|
$endKey = strpos($row['name'], ']', $startKey);
|
||||||
|
$lengthKey = $endKey - $startKey;
|
||||||
|
$repeatableRowKey = substr($row['name'], $startKey, $lengthKey);
|
||||||
|
}
|
||||||
|
|
||||||
|
$inputNameEnd = strpos($row['name'], ']', $inputNameStart);
|
||||||
|
$inputNameLength = $inputNameEnd - $inputNameStart;
|
||||||
|
$inputName = substr($row['name'], $inputNameStart, $inputNameLength);
|
||||||
|
$parentInputName = substr($row['name'], 0, strpos($row['name'], '['));
|
||||||
|
|
||||||
|
if (isset($repeatableRowKey)) {
|
||||||
|
if ($isMultiple) {
|
||||||
|
$result[$parentInputName][$repeatableRowKey][$inputName][] = $row['value'];
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$result[$parentInputName][$repeatableRowKey][$inputName] = $row['value'];
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($isMultiple) {
|
||||||
|
$result[$parentInputName][$inputName][] = $row['value'];
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
$result[$parentInputName][$inputName] = $row['value'];
|
||||||
|
}
|
||||||
|
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! function_exists('backpack_users_have_email')) {
|
||||||
|
/**
|
||||||
|
* Check if the email column is present on the user table.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function backpack_users_have_email()
|
||||||
|
{
|
||||||
|
$user_model_fqn = config('backpack.base.user_model_fqn');
|
||||||
|
$user = new $user_model_fqn();
|
||||||
|
|
||||||
|
return \Schema::hasColumn($user->getTable(), config('backpack.base.email_column') ?? 'email');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! function_exists('backpack_avatar_url')) {
|
||||||
|
/**
|
||||||
|
* Returns the avatar URL of a user.
|
||||||
|
*
|
||||||
|
* @param $user
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function backpack_avatar_url($user)
|
||||||
|
{
|
||||||
|
switch (config('backpack.base.avatar_type')) {
|
||||||
|
case 'gravatar':
|
||||||
|
if (backpack_users_have_email() && ! empty($user->email)) {
|
||||||
|
$avatarLink = Gravatar::fallback(config('backpack.base.gravatar_fallback'))->get($user->email, ['size' => 80]);
|
||||||
|
|
||||||
|
// if we can save it locally, for safer loading, let's do it
|
||||||
|
if (in_array(Basset::basset($avatarLink, false)->name, ['INTERNALIZED', 'IN_CACHE', 'LOADED'])) {
|
||||||
|
return Basset::getUrl($avatarLink);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $avatarLink;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return method_exists($user, config('backpack.base.avatar_type')) ? $user->{config('backpack.base.avatar_type')}() : $user->{config('backpack.base.avatar_type')};
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! function_exists('backpack_middleware')) {
|
||||||
|
/**
|
||||||
|
* Return the key of the middleware used across Backpack.
|
||||||
|
* That middleware checks if the visitor is an admin.
|
||||||
|
*
|
||||||
|
* @param $path
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function backpack_middleware()
|
||||||
|
{
|
||||||
|
return config('backpack.base.middleware_key', 'admin');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! function_exists('backpack_guard_name')) {
|
||||||
|
/*
|
||||||
|
* Returns the name of the guard defined
|
||||||
|
* by the application config
|
||||||
|
*/
|
||||||
|
function backpack_guard_name()
|
||||||
|
{
|
||||||
|
return config('backpack.base.guard', config('auth.defaults.guard'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! function_exists('backpack_auth')) {
|
||||||
|
/*
|
||||||
|
* Returns the user instance if it exists
|
||||||
|
* of the currently authenticated admin
|
||||||
|
* based off the defined guard.
|
||||||
|
*/
|
||||||
|
function backpack_auth()
|
||||||
|
{
|
||||||
|
return \Auth::guard(backpack_guard_name());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! function_exists('backpack_user')) {
|
||||||
|
/*
|
||||||
|
* Returns back a user instance without
|
||||||
|
* the admin guard, however allows you
|
||||||
|
* to pass in a custom guard if you like.
|
||||||
|
*/
|
||||||
|
function backpack_user()
|
||||||
|
{
|
||||||
|
return backpack_auth()->user();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! function_exists('mb_ucfirst')) {
|
||||||
|
/**
|
||||||
|
* Capitalize the first letter of a string,
|
||||||
|
* even if that string is multi-byte (non-latin alphabet).
|
||||||
|
*
|
||||||
|
* @param string $string String to have its first letter capitalized.
|
||||||
|
* @param encoding $encoding Character encoding
|
||||||
|
* @return string String with first letter capitalized.
|
||||||
|
*/
|
||||||
|
function mb_ucfirst($string, $encoding = false)
|
||||||
|
{
|
||||||
|
$encoding = $encoding ? $encoding : mb_internal_encoding();
|
||||||
|
|
||||||
|
$strlen = mb_strlen($string, $encoding);
|
||||||
|
$firstChar = mb_substr($string, 0, 1, $encoding);
|
||||||
|
$then = mb_substr($string, 1, $strlen - 1, $encoding);
|
||||||
|
|
||||||
|
return mb_strtoupper($firstChar, $encoding).$then;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! function_exists('backpack_view')) {
|
||||||
|
/**
|
||||||
|
* Returns a new displayable view path, based on the configured backpack view namespace.
|
||||||
|
* If that view doesn't exist, it falls back to the fallback namespace.
|
||||||
|
* If that view doesn't exist, it falls back to the one from the Backpack UI directory.
|
||||||
|
*
|
||||||
|
* @param string (see config/backpack/base.php)
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function backpack_view($view)
|
||||||
|
{
|
||||||
|
$viewPaths = [
|
||||||
|
config('backpack.ui.view_namespace').$view,
|
||||||
|
backpack_theme_config('view_namespace_fallback').$view,
|
||||||
|
'backpack.ui::'.$view,
|
||||||
|
];
|
||||||
|
|
||||||
|
foreach ($viewPaths as $view) {
|
||||||
|
if (view()->exists($view)) {
|
||||||
|
return $view;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$errorMessage = 'The view: ['.$view.'] was not found in any of the following view paths: ['.implode(' ], [ ', $viewPaths).']';
|
||||||
|
|
||||||
|
$errorDetails = (function () {
|
||||||
|
if (env('APP_ENV') === 'production' || ! env('APP_DEBUG')) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
$backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2) ?? [];
|
||||||
|
$functionCaller = $backtrace[1] ?? [];
|
||||||
|
$functionLine = $functionCaller['line'] ?? 'N/A';
|
||||||
|
$functionFile = $functionCaller['file'] ?? 'N/A';
|
||||||
|
|
||||||
|
return '- Called in: '.Str::after($functionFile, base_path()).' on line: '.$functionLine;
|
||||||
|
})();
|
||||||
|
|
||||||
|
abort(500, $errorMessage.$errorDetails);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! function_exists('backpack_theme_config')) {
|
||||||
|
/**
|
||||||
|
* Returns a config value from the current theme's config file.
|
||||||
|
* It assumes the theme's config namespace is the same as the view namespace.
|
||||||
|
*
|
||||||
|
* @param string
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function backpack_theme_config($key)
|
||||||
|
{
|
||||||
|
$namespacedKey = config('backpack.ui.view_namespace').$key;
|
||||||
|
$namespacedKey = str_replace('::', '.', $namespacedKey);
|
||||||
|
|
||||||
|
// if the config exists in the theme config file, use it
|
||||||
|
if (config()->has($namespacedKey)) {
|
||||||
|
return config($namespacedKey);
|
||||||
|
}
|
||||||
|
|
||||||
|
// if not, fall back to a general the config in the fallback theme
|
||||||
|
$namespacedKey = config('backpack.ui.view_namespace_fallback').$key;
|
||||||
|
$namespacedKey = str_replace('::', '.', $namespacedKey);
|
||||||
|
|
||||||
|
if (config()->has($namespacedKey)) {
|
||||||
|
return config($namespacedKey);
|
||||||
|
}
|
||||||
|
|
||||||
|
// if not, fall back to the config in ui
|
||||||
|
$namespacedKey = 'backpack.ui.'.$key;
|
||||||
|
|
||||||
|
if (config()->has($namespacedKey)) {
|
||||||
|
return config($namespacedKey);
|
||||||
|
}
|
||||||
|
|
||||||
|
Log::error('Could not find config key: '.$key.'. Neither in the Backpack theme, nor in the fallback theme, nor in ui.');
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! function_exists('square_brackets_to_dots')) {
|
||||||
|
/**
|
||||||
|
* Turns a string from bracket-type array to dot-notation array.
|
||||||
|
* Ex: array[0][property] turns into array.0.property.
|
||||||
|
*
|
||||||
|
* @param $path
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function square_brackets_to_dots($string)
|
||||||
|
{
|
||||||
|
$string = str_replace(['[', ']'], ['.', ''], $string);
|
||||||
|
|
||||||
|
return $string;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! function_exists('old_empty_or_null')) {
|
||||||
|
/**
|
||||||
|
* This method is an alternative to Laravel's old() helper, which mistakenly
|
||||||
|
* returns NULL it two cases:
|
||||||
|
* - if there is an old value, and it was empty or null
|
||||||
|
* - if there is no old value
|
||||||
|
* (this is because of the ConvertsEmptyStringsToNull middleware).
|
||||||
|
*
|
||||||
|
* In contrast, this method will return:
|
||||||
|
* - the old value, if there actually is an old value for that key;
|
||||||
|
* - the second parameter, if there is no old value for that key, but it was empty string or null;
|
||||||
|
* - null, if there is no old value at all for that key;
|
||||||
|
*
|
||||||
|
* @param string $key
|
||||||
|
* @param array|string $empty_value
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
function old_empty_or_null($key, $empty_value = '')
|
||||||
|
{
|
||||||
|
$key = square_brackets_to_dots($key);
|
||||||
|
$old_inputs = session()->getOldInput();
|
||||||
|
|
||||||
|
// if the input name is present in the old inputs we need to return earlier and not in a coalescing chain
|
||||||
|
// otherwise `null` aka empty will not pass the condition and the field value would be returned.
|
||||||
|
if (\Arr::has($old_inputs, $key)) {
|
||||||
|
return \Arr::get($old_inputs, $key) ?? $empty_value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! function_exists('is_multidimensional_array')) {
|
||||||
|
/**
|
||||||
|
* Check if the array is multidimensional.
|
||||||
|
*
|
||||||
|
* If $strict is enabled, the array is considered multidimensional only if all elements of the array are arrays.
|
||||||
|
*/
|
||||||
|
function is_multidimensional_array(array $array, bool $strict = false): bool
|
||||||
|
{
|
||||||
|
foreach ($array as $item) {
|
||||||
|
if ($strict && ! is_array($item)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (! $strict && is_array($item)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $strict;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! function_exists('backpack_pro')) {
|
||||||
|
/**
|
||||||
|
* Check if the backpack/pro package is installed.
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
function backpack_pro()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
if (app()->runningUnitTests()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (! \Composer\InstalledVersions::isInstalled('backpack/pro')) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return \Composer\InstalledVersions::getVersion('backpack/pro');
|
||||||
|
}
|
||||||
|
}
|
29
app/Providers/AppServiceProvider.php
Normal file
29
app/Providers/AppServiceProvider.php
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Providers;
|
||||||
|
|
||||||
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
|
||||||
|
class AppServiceProvider extends ServiceProvider
|
||||||
|
{
|
||||||
|
public $bindings = [
|
||||||
|
\Backpack\PermissionManager\app\Http\Controllers\PermissionCrudController::class => \App\Http\Controllers\Admin\PermissionCrudController::class,
|
||||||
|
\Backpack\PermissionManager\app\Http\Controllers\RoleCrudController::class => \App\Http\Controllers\Admin\RoleCrudController::class,
|
||||||
|
\Backpack\PermissionManager\app\Http\Controllers\UserCrudController::class => \App\Http\Controllers\Admin\UserCrudController::class,
|
||||||
|
];
|
||||||
|
/**
|
||||||
|
* Register any application services.
|
||||||
|
*/
|
||||||
|
public function register(): void
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Bootstrap any application services.
|
||||||
|
*/
|
||||||
|
public function boot(): void
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
}
|
26
app/Providers/AuthServiceProvider.php
Normal file
26
app/Providers/AuthServiceProvider.php
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Providers;
|
||||||
|
|
||||||
|
// use Illuminate\Support\Facades\Gate;
|
||||||
|
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
|
||||||
|
|
||||||
|
class AuthServiceProvider extends ServiceProvider
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The model to policy mappings for the application.
|
||||||
|
*
|
||||||
|
* @var array<class-string, class-string>
|
||||||
|
*/
|
||||||
|
protected $policies = [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Register any authentication / authorization services.
|
||||||
|
*/
|
||||||
|
public function boot(): void
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
}
|
19
app/Providers/BroadcastServiceProvider.php
Normal file
19
app/Providers/BroadcastServiceProvider.php
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Providers;
|
||||||
|
|
||||||
|
use Illuminate\Support\Facades\Broadcast;
|
||||||
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
|
||||||
|
class BroadcastServiceProvider extends ServiceProvider
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Bootstrap any application services.
|
||||||
|
*/
|
||||||
|
public function boot(): void
|
||||||
|
{
|
||||||
|
Broadcast::routes();
|
||||||
|
|
||||||
|
require base_path('routes/channels.php');
|
||||||
|
}
|
||||||
|
}
|
38
app/Providers/EventServiceProvider.php
Normal file
38
app/Providers/EventServiceProvider.php
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
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
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The event to listener mappings for the application.
|
||||||
|
*
|
||||||
|
* @var array<class-string, array<int, class-string>>
|
||||||
|
*/
|
||||||
|
protected $listen = [
|
||||||
|
Registered::class => [
|
||||||
|
SendEmailVerificationNotification::class,
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Register any events for your application.
|
||||||
|
*/
|
||||||
|
public function boot(): void
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine if events and listeners should be automatically discovered.
|
||||||
|
*/
|
||||||
|
public function shouldDiscoverEvents(): bool
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
40
app/Providers/RouteServiceProvider.php
Normal file
40
app/Providers/RouteServiceProvider.php
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Providers;
|
||||||
|
|
||||||
|
use Illuminate\Cache\RateLimiting\Limit;
|
||||||
|
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Facades\RateLimiter;
|
||||||
|
use Illuminate\Support\Facades\Route;
|
||||||
|
|
||||||
|
class RouteServiceProvider extends ServiceProvider
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The path to your application's "home" route.
|
||||||
|
*
|
||||||
|
* Typically, users are redirected here after authentication.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
public const HOME = '/home';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define your route model bindings, pattern filters, and other route configuration.
|
||||||
|
*/
|
||||||
|
public function boot(): void
|
||||||
|
{
|
||||||
|
RateLimiter::for('api', function (Request $request) {
|
||||||
|
return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip());
|
||||||
|
});
|
||||||
|
|
||||||
|
$this->routes(function () {
|
||||||
|
Route::middleware('api')
|
||||||
|
->prefix('api')
|
||||||
|
->group(base_path('routes/api.php'));
|
||||||
|
|
||||||
|
Route::middleware('web')
|
||||||
|
->group(base_path('routes/web.php'));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
53
artisan
Executable file
53
artisan
Executable file
@ -0,0 +1,53 @@
|
|||||||
|
#!/usr/bin/env php
|
||||||
|
<?php
|
||||||
|
|
||||||
|
define('LARAVEL_START', microtime(true));
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Register The Auto Loader
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Composer provides a convenient, automatically generated class loader
|
||||||
|
| for our application. We just need to utilize it! We'll require it
|
||||||
|
| into the script here so that we do not have to worry about the
|
||||||
|
| loading of any of our classes manually. It's great to relax.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
require __DIR__.'/vendor/autoload.php';
|
||||||
|
|
||||||
|
$app = require_once __DIR__.'/bootstrap/app.php';
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Run The Artisan Application
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| When we run the console application, the current CLI command will be
|
||||||
|
| executed in this console and the response sent back to a terminal
|
||||||
|
| or another output device for the developers. Here goes nothing!
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
$kernel = $app->make(Illuminate\Contracts\Console\Kernel::class);
|
||||||
|
|
||||||
|
$status = $kernel->handle(
|
||||||
|
$input = new Symfony\Component\Console\Input\ArgvInput,
|
||||||
|
new Symfony\Component\Console\Output\ConsoleOutput
|
||||||
|
);
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Shutdown The Application
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Once Artisan has finished running, we will fire off the shutdown events
|
||||||
|
| so that any final work may be done by the application before we shut
|
||||||
|
| down the process. This is the last thing to happen to the request.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
$kernel->terminate($input, $status);
|
||||||
|
|
||||||
|
exit($status);
|
55
bootstrap/app.php
Normal file
55
bootstrap/app.php
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Create The Application
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| The first thing we will do is create a new Laravel application instance
|
||||||
|
| which serves as the "glue" for all the components of Laravel, and is
|
||||||
|
| the IoC container for the system binding all of the various parts.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
$app = new Illuminate\Foundation\Application(
|
||||||
|
$_ENV['APP_BASE_PATH'] ?? dirname(__DIR__)
|
||||||
|
);
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Bind Important Interfaces
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Next, we need to bind some important interfaces into the container so
|
||||||
|
| we will be able to resolve them when needed. The kernels serve the
|
||||||
|
| incoming requests to this application from both the web and CLI.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
$app->singleton(
|
||||||
|
Illuminate\Contracts\Http\Kernel::class,
|
||||||
|
App\Http\Kernel::class
|
||||||
|
);
|
||||||
|
|
||||||
|
$app->singleton(
|
||||||
|
Illuminate\Contracts\Console\Kernel::class,
|
||||||
|
App\Console\Kernel::class
|
||||||
|
);
|
||||||
|
|
||||||
|
$app->singleton(
|
||||||
|
Illuminate\Contracts\Debug\ExceptionHandler::class,
|
||||||
|
App\Exceptions\Handler::class
|
||||||
|
);
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Return The Application
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| This script returns the application instance. The instance is given to
|
||||||
|
| the calling script so we can separate the building of the instances
|
||||||
|
| from the actual running of the application and sending responses.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
return $app;
|
2
bootstrap/cache/.gitignore
vendored
Normal file
2
bootstrap/cache/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
*
|
||||||
|
!.gitignore
|
88
composer copy.json
Normal file
88
composer copy.json
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
{
|
||||||
|
"name": "laravel/laravel",
|
||||||
|
"type": "project",
|
||||||
|
"description": "The skeleton application for the Laravel framework.",
|
||||||
|
"keywords": ["laravel", "framework"],
|
||||||
|
"license": "MIT",
|
||||||
|
"require": {
|
||||||
|
"php": "^8.1",
|
||||||
|
"backpack/crud": "^6.6",
|
||||||
|
"backpack/filemanager": "^3.0",
|
||||||
|
"backpack/language-switcher": "^2.0",
|
||||||
|
"backpack/permissionmanager": "^7.1",
|
||||||
|
"backpack/theme-tabler": "^1.2",
|
||||||
|
"cviebrock/eloquent-sluggable": "^10.0",
|
||||||
|
"diglactic/laravel-breadcrumbs": "^8.1",
|
||||||
|
"ericli1018/awesome-fields-for-backpack": "^1.0",
|
||||||
|
"guzzlehttp/guzzle": "^7.2",
|
||||||
|
"laravel/framework": "^10.10",
|
||||||
|
"laravel/sanctum": "^3.3",
|
||||||
|
"laravel/tinker": "^2.8",
|
||||||
|
"petercoles/multilingual-country-list": "^1.2",
|
||||||
|
"select2/select2": "^4.0",
|
||||||
|
"spatie/laravel-translatable": "^6.5"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"backpack/generators": "^4.0",
|
||||||
|
"fakerphp/faker": "^1.9.1",
|
||||||
|
"laracasts/generators": "^2.0",
|
||||||
|
"laravel-lang/lang": "^13",
|
||||||
|
"laravel-lang/publisher": "^14",
|
||||||
|
"laravel/pint": "^1.0",
|
||||||
|
"laravel/sail": "^1.18",
|
||||||
|
"mockery/mockery": "^1.4.4",
|
||||||
|
"nunomaduro/collision": "^7.0",
|
||||||
|
"phpunit/phpunit": "^10.1",
|
||||||
|
"spatie/laravel-ignition": "^2.0"
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"exclude-from-classmap": [
|
||||||
|
"vendor/backpack/crud/src/helpers.php"
|
||||||
|
],
|
||||||
|
"files": [
|
||||||
|
"app/Overrides/backpack/crud/src/helpers.php"
|
||||||
|
],
|
||||||
|
"psr-4": {
|
||||||
|
"App\\": "app/",
|
||||||
|
"Database\\Factories\\": "database/factories/",
|
||||||
|
"Database\\Seeders\\": "database/seeders/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload-dev": {
|
||||||
|
"psr-4": {
|
||||||
|
"Tests\\": "tests/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"post-autoload-dump": [
|
||||||
|
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
|
||||||
|
"@php artisan package:discover --ansi"
|
||||||
|
],
|
||||||
|
"post-update-cmd": [
|
||||||
|
"@php artisan vendor:publish --tag=laravel-assets --ansi --force"
|
||||||
|
],
|
||||||
|
"post-root-package-install": [
|
||||||
|
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
|
||||||
|
],
|
||||||
|
"post-create-project-cmd": [
|
||||||
|
"@php artisan key:generate --ansi"
|
||||||
|
],
|
||||||
|
"post-install-cmd": ["php artisan storage:link --quiet"]
|
||||||
|
},
|
||||||
|
"extra": {
|
||||||
|
"laravel": {
|
||||||
|
"dont-discover": []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"config": {
|
||||||
|
"optimize-autoloader": true,
|
||||||
|
"preferred-install": "dist",
|
||||||
|
"sort-packages": true,
|
||||||
|
"allow-plugins": {
|
||||||
|
"pestphp/pest-plugin": true,
|
||||||
|
"php-http/discovery": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"minimum-stability": "stable",
|
||||||
|
"prefer-stable": true
|
||||||
|
}
|
88
composer.json
Normal file
88
composer.json
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
{
|
||||||
|
"name": "laravel/laravel",
|
||||||
|
"type": "project",
|
||||||
|
"description": "The skeleton application for the Laravel framework.",
|
||||||
|
"keywords": ["laravel", "framework"],
|
||||||
|
"license": "MIT",
|
||||||
|
"require": {
|
||||||
|
"php": "^8.1",
|
||||||
|
"backpack/crud": "^6.6",
|
||||||
|
"backpack/filemanager": "^3.0",
|
||||||
|
"backpack/language-switcher": "^2.0",
|
||||||
|
"backpack/permissionmanager": "^7.1",
|
||||||
|
"backpack/theme-tabler": "^1.2",
|
||||||
|
"cviebrock/eloquent-sluggable": "^10.0",
|
||||||
|
"diglactic/laravel-breadcrumbs": "^8.1",
|
||||||
|
"ericli1018/awesome-fields-for-backpack": "^1.1",
|
||||||
|
"guzzlehttp/guzzle": "^7.2",
|
||||||
|
"laravel/framework": "^10.10",
|
||||||
|
"laravel/sanctum": "^3.3",
|
||||||
|
"laravel/tinker": "^2.8",
|
||||||
|
"petercoles/multilingual-country-list": "^1.2",
|
||||||
|
"spatie/laravel-cookie-consent": "^3.2",
|
||||||
|
"spatie/laravel-translatable": "^6.5"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"backpack/generators": "^4.0",
|
||||||
|
"fakerphp/faker": "^1.9.1",
|
||||||
|
"laracasts/generators": "^2.0",
|
||||||
|
"laravel-lang/lang": "^13",
|
||||||
|
"laravel-lang/publisher": "^14",
|
||||||
|
"laravel/pint": "^1.0",
|
||||||
|
"laravel/sail": "^1.18",
|
||||||
|
"mockery/mockery": "^1.4.4",
|
||||||
|
"nunomaduro/collision": "^7.0",
|
||||||
|
"phpunit/phpunit": "^10.1",
|
||||||
|
"spatie/laravel-ignition": "^2.0"
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"exclude-from-classmap": [
|
||||||
|
"vendor/backpack/crud/src/helpers.php"
|
||||||
|
],
|
||||||
|
"files": [
|
||||||
|
"app/Overrides/backpack/crud/src/helpers.php"
|
||||||
|
],
|
||||||
|
"psr-4": {
|
||||||
|
"App\\": "app/",
|
||||||
|
"Database\\Factories\\": "database/factories/",
|
||||||
|
"Database\\Seeders\\": "database/seeders/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload-dev": {
|
||||||
|
"psr-4": {
|
||||||
|
"Tests\\": "tests/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"post-autoload-dump": [
|
||||||
|
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
|
||||||
|
"@php artisan package:discover --ansi"
|
||||||
|
],
|
||||||
|
"post-update-cmd": [
|
||||||
|
"@php artisan vendor:publish --tag=laravel-assets --ansi --force"
|
||||||
|
],
|
||||||
|
"post-root-package-install": [
|
||||||
|
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
|
||||||
|
],
|
||||||
|
"post-create-project-cmd": [
|
||||||
|
"@php artisan key:generate --ansi"
|
||||||
|
],
|
||||||
|
"post-install-cmd": ["php artisan storage:link --quiet"]
|
||||||
|
},
|
||||||
|
"extra": {
|
||||||
|
"laravel": {
|
||||||
|
"dont-discover": []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"config": {
|
||||||
|
"optimize-autoloader": true,
|
||||||
|
"preferred-install": "dist",
|
||||||
|
"sort-packages": true,
|
||||||
|
"allow-plugins": {
|
||||||
|
"pestphp/pest-plugin": true,
|
||||||
|
"php-http/discovery": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"minimum-stability": "stable",
|
||||||
|
"prefer-stable": true
|
||||||
|
}
|
11098
composer.lock
generated
Normal file
11098
composer.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
188
config/app.php
Normal file
188
config/app.php
Normal file
@ -0,0 +1,188 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Support\Facades\Facade;
|
||||||
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| 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.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'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.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'debug' => (bool) 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.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'url' => env('APP_URL', 'http://localhost'),
|
||||||
|
|
||||||
|
'asset_url' => env('ASSET_URL'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| 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' => 'UTC',
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| 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' => 'en',
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| 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' => 'en',
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| 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'),
|
||||||
|
|
||||||
|
'cipher' => 'AES-256-CBC',
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Maintenance Mode Driver
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| These configuration options determine the driver used to determine and
|
||||||
|
| manage Laravel's "maintenance mode" status. The "cache" driver will
|
||||||
|
| allow maintenance mode to be controlled across multiple machines.
|
||||||
|
|
|
||||||
|
| Supported drivers: "file", "cache"
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'maintenance' => [
|
||||||
|
'driver' => 'file',
|
||||||
|
// 'store' => 'redis',
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| 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' => ServiceProvider::defaultProviders()->merge([
|
||||||
|
/*
|
||||||
|
* Package Service Providers...
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Application Service Providers...
|
||||||
|
*/
|
||||||
|
App\Providers\AppServiceProvider::class,
|
||||||
|
App\Providers\AuthServiceProvider::class,
|
||||||
|
// App\Providers\BroadcastServiceProvider::class,
|
||||||
|
App\Providers\EventServiceProvider::class,
|
||||||
|
App\Providers\RouteServiceProvider::class,
|
||||||
|
])->toArray(),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| 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' => Facade::defaultAliases()->merge([
|
||||||
|
// 'Example' => App\Facades\Example::class,
|
||||||
|
])->toArray(),
|
||||||
|
|
||||||
|
];
|
115
config/auth.php
Normal file
115
config/auth.php
Normal file
@ -0,0 +1,115 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'defaults' => [
|
||||||
|
'guard' => 'web',
|
||||||
|
'passwords' => 'users',
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| 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"
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'guards' => [
|
||||||
|
'web' => [
|
||||||
|
'driver' => 'session',
|
||||||
|
'provider' => 'users',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| 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' => [
|
||||||
|
'users' => [
|
||||||
|
'driver' => 'eloquent',
|
||||||
|
'model' => App\Models\User::class,
|
||||||
|
],
|
||||||
|
|
||||||
|
// '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 expiry time is the number of minutes that each reset token will be
|
||||||
|
| considered valid. This security feature keeps tokens short-lived so
|
||||||
|
| they have less time to be guessed. You may change this as needed.
|
||||||
|
|
|
||||||
|
| The throttle setting is the number of seconds a user must wait before
|
||||||
|
| generating more password reset tokens. This prevents the user from
|
||||||
|
| quickly generating a very large amount of password reset tokens.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'passwords' => [
|
||||||
|
'users' => [
|
||||||
|
'provider' => 'users',
|
||||||
|
'table' => 'password_reset_tokens',
|
||||||
|
'expire' => 60,
|
||||||
|
'throttle' => 60,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| 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,
|
||||||
|
|
||||||
|
];
|
195
config/backpack/base.php
Normal file
195
config/backpack/base.php
Normal file
@ -0,0 +1,195 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Registration Open
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Choose whether new users/admins are allowed to register.
|
||||||
|
| This will show the Register button on the login page and allow access to the
|
||||||
|
| Register functions in AuthController.
|
||||||
|
|
|
||||||
|
| By default the registration is open only on localhost.
|
||||||
|
*/
|
||||||
|
|
||||||
|
'registration_open' => env('BACKPACK_REGISTRATION_OPEN', env('APP_ENV') === 'local'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Routing
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
// The prefix used in all base routes (the 'admin' in admin/dashboard)
|
||||||
|
// You can make sure all your URLs use this prefix by using the backpack_url() helper instead of url()
|
||||||
|
'route_prefix' => 'admin',
|
||||||
|
|
||||||
|
// The web middleware (group) used in all base & CRUD routes
|
||||||
|
// If you've modified your "web" middleware group (ex: removed sessions), you can use a different
|
||||||
|
// route group, that has all the the middleware listed below in the comments.
|
||||||
|
'web_middleware' => 'web',
|
||||||
|
// Or you can comment the above, and uncomment the complete list below.
|
||||||
|
// 'web_middleware' => [
|
||||||
|
// \App\Http\Middleware\EncryptCookies::class,
|
||||||
|
// \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
|
||||||
|
// \Illuminate\Session\Middleware\StartSession::class,
|
||||||
|
// \Illuminate\View\Middleware\ShareErrorsFromSession::class,
|
||||||
|
// \App\Http\Middleware\VerifyCsrfToken::class,
|
||||||
|
// ],
|
||||||
|
|
||||||
|
// Set this to false if you would like to use your own AuthController and PasswordController
|
||||||
|
// (you then need to setup your auth routes manually in your routes.php file)
|
||||||
|
// Warning: if you disable this, the password recovery routes (below) will be disabled too!
|
||||||
|
'setup_auth_routes' => true,
|
||||||
|
|
||||||
|
// Set this to false if you would like to skip adding the dashboard routes
|
||||||
|
// (you then need to overwrite the login route on your AuthController)
|
||||||
|
'setup_dashboard_routes' => true,
|
||||||
|
|
||||||
|
// Set this to false if you would like to skip adding "my account" routes
|
||||||
|
// (you then need to manually define the routes in your web.php)
|
||||||
|
'setup_my_account_routes' => true,
|
||||||
|
|
||||||
|
// Set this to false if you would like to skip adding the password recovery routes
|
||||||
|
// (you then need to manually define the routes in your web.php)
|
||||||
|
'setup_password_recovery_routes' => false,
|
||||||
|
|
||||||
|
// Set this to true if you would like to enable email verification for your user model.
|
||||||
|
// Make sure your user model implements the MustVerifyEmail contract and your database
|
||||||
|
// table contains the `email_verified_at` column. Read the following before enabling:
|
||||||
|
// https://backpackforlaravel.com/docs/6.x/base-how-to#enable-email-verification-in-backpack-routes
|
||||||
|
'setup_email_verification_routes' => false,
|
||||||
|
|
||||||
|
// When email verification is enabled, automatically add the Verified middleware to Backpack routes?
|
||||||
|
// Set false if you want to use your own Verified middleware in `middleware_class`.
|
||||||
|
'setup_email_verification_middleware' => true,
|
||||||
|
|
||||||
|
// How many times in any given time period should the user be allowed to
|
||||||
|
// request a new verification email?
|
||||||
|
// Defaults to 1,10 - 1 time in 10 minutes.
|
||||||
|
'email_verification_throttle_access' => '3,15',
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Security
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Backpack will prevent visitors from requesting password recovery too many times
|
||||||
|
// for a certain email, to make sure they cannot be spammed that way.
|
||||||
|
// How many seconds should a visitor wait, after they've requested a
|
||||||
|
// password reset, before they can try again for the same email?
|
||||||
|
'password_recovery_throttle_notifications' => 600, // time in seconds
|
||||||
|
|
||||||
|
// How much time should the token sent to the user email be considered valid?
|
||||||
|
// After this time expires, user needs to request a new reset token.
|
||||||
|
'password_recovery_token_expiration' => 60, // time in minutes
|
||||||
|
|
||||||
|
// Backpack will prevent an IP from trying to reset the password too many times,
|
||||||
|
// so that a malicious actor cannot try too many emails, too see if they have
|
||||||
|
// accounts or to increase the AWS/SendGrid/etc bill.
|
||||||
|
//
|
||||||
|
// How many times in any given time period should the user be allowed to
|
||||||
|
// attempt a password reset? Take into account that user might wrongly
|
||||||
|
// type an email at first, so at least allow one more try.
|
||||||
|
// Defaults to 3,10 - 3 times in 10 minutes.
|
||||||
|
'password_recovery_throttle_access' => '3,10',
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Authentication
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Fully qualified namespace of the User model
|
||||||
|
'user_model_fqn' => config('auth.providers.users.model'),
|
||||||
|
// 'user_model_fqn' => App\User::class, // works on Laravel <= 7
|
||||||
|
// 'user_model_fqn' => App\Models\User::class, // works on Laravel >= 8
|
||||||
|
|
||||||
|
// The classes for the middleware to check if the visitor is an admin
|
||||||
|
// Can be a single class or an array of classes
|
||||||
|
'middleware_class' => [
|
||||||
|
App\Http\Middleware\CheckIfAdmin::class,
|
||||||
|
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
|
||||||
|
\Backpack\CRUD\app\Http\Middleware\AuthenticateSession::class,
|
||||||
|
// \Backpack\LanguageSwitcher\Http\Middleware\LanguageSwitcherMiddleware::class,
|
||||||
|
// \Backpack\CRUD\app\Http\Middleware\UseBackpackAuthGuardInsteadOfDefaultAuthGuard::class,
|
||||||
|
],
|
||||||
|
|
||||||
|
// Alias for that middleware
|
||||||
|
'middleware_key' => 'admin',
|
||||||
|
// Note: It's recommended to use the backpack_middleware() helper everywhere, which pulls this key for you.
|
||||||
|
|
||||||
|
// Username column for authentication
|
||||||
|
// The Backpack default is the same as the Laravel default (email)
|
||||||
|
// If you need to switch to username, you also need to create that column in your db
|
||||||
|
'authentication_column' => 'email',
|
||||||
|
'authentication_column_name' => 'Email',
|
||||||
|
|
||||||
|
// Backpack assumes that your "database email column" for operations like Login and Register is called "email".
|
||||||
|
// If your database email column have a different name, you can configure it here. Eg: `user_mail`
|
||||||
|
'email_column' => 'email',
|
||||||
|
|
||||||
|
// The guard that protects the Backpack admin panel.
|
||||||
|
// If null, the config.auth.defaults.guard value will be used.
|
||||||
|
'guard' => 'backpack',
|
||||||
|
|
||||||
|
// The password reset configuration for Backpack.
|
||||||
|
// If null, the config.auth.defaults.passwords value will be used.
|
||||||
|
'passwords' => 'backpack',
|
||||||
|
|
||||||
|
// What kind of avatar will you like to show to the user?
|
||||||
|
// Default: gravatar (automatically use the gravatar for their email)
|
||||||
|
// Other options:
|
||||||
|
// - null (generic image with their first letter)
|
||||||
|
// - example_method_name (specify the method on the User model that returns the URL)
|
||||||
|
'avatar_type' => 'gravatar',
|
||||||
|
|
||||||
|
// Gravatar fallback options are 'identicon', 'monsterid', 'wavatar', 'retro', 'robohash', 'blank'
|
||||||
|
// 'blank' will keep the generic image with the user first letter
|
||||||
|
'gravatar_fallback' => 'blank',
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| File System
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Backpack\Base sets up its own filesystem disk, just like you would by
|
||||||
|
// adding an entry to your config/filesystems.php. It points to the root
|
||||||
|
// of your project and it's used throughout all Backpack packages.
|
||||||
|
//
|
||||||
|
// You can rename this disk here. Default: root
|
||||||
|
'root_disk_name' => 'root',
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Application
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Should we use DB transactions when executing multiple queries? For example when creating an entry and it's relationships.
|
||||||
|
// By wrapping in a database transaction you ensure that either all queries went ok, or if some failed the whole process
|
||||||
|
// is rolled back and considered failed. This is a good setting for data integrity.
|
||||||
|
'useDatabaseTransactions' => true,
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Backpack Token Username
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| If you have access to closed-source Backpack add-ons, please provide
|
||||||
|
| your token username here, if you're getting yellow alerts on your
|
||||||
|
| admin panel's pages. Normally this is not needed, it is
|
||||||
|
| preferred to add this as an environment variable
|
||||||
|
| (most likely in your .env file).
|
||||||
|
|
|
||||||
|
| More info and payment form on:
|
||||||
|
| https://www.backpackforlaravel.com
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'token_username' => env('BACKPACK_TOKEN_USERNAME', false),
|
||||||
|
];
|
481
config/backpack/crud.php
Normal file
481
config/backpack/crud.php
Normal file
@ -0,0 +1,481 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Backpack\CRUD preferences.
|
||||||
|
*/
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
/*
|
||||||
|
|-------------------
|
||||||
|
| TRANSLATABLE CRUDS
|
||||||
|
|-------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
'show_translatable_field_icon' => false,
|
||||||
|
'translatable_field_icon_position' => 'right', // left or right
|
||||||
|
|
||||||
|
'locales' => [
|
||||||
|
// "af_NA" => "Afrikaans (Namibia)",
|
||||||
|
// "af_ZA" => "Afrikaans (South Africa)",
|
||||||
|
// "af" => "Afrikaans",
|
||||||
|
// "ak_GH" => "Akan (Ghana)",
|
||||||
|
// "ak" => "Akan",
|
||||||
|
// "sq_AL" => "Albanian (Albania)",
|
||||||
|
// "sq" => "Albanian",
|
||||||
|
// "am_ET" => "Amharic (Ethiopia)",
|
||||||
|
// "am" => "Amharic",
|
||||||
|
// "ar_DZ" => "Arabic (Algeria)",
|
||||||
|
// "ar_BH" => "Arabic (Bahrain)",
|
||||||
|
// "ar_EG" => "Arabic (Egypt)",
|
||||||
|
// "ar_IQ" => "Arabic (Iraq)",
|
||||||
|
// "ar_JO" => "Arabic (Jordan)",
|
||||||
|
// "ar_KW" => "Arabic (Kuwait)",
|
||||||
|
// "ar_LB" => "Arabic (Lebanon)",
|
||||||
|
// "ar_LY" => "Arabic (Libya)",
|
||||||
|
// "ar_MA" => "Arabic (Morocco)",
|
||||||
|
// "ar_OM" => "Arabic (Oman)",
|
||||||
|
// "ar_QA" => "Arabic (Qatar)",
|
||||||
|
// "ar_SA" => "Arabic (Saudi Arabia)",
|
||||||
|
// "ar_SD" => "Arabic (Sudan)",
|
||||||
|
// "ar_SY" => "Arabic (Syria)",
|
||||||
|
// "ar_TN" => "Arabic (Tunisia)",
|
||||||
|
// "ar_AE" => "Arabic (United Arab Emirates)",
|
||||||
|
// "ar_YE" => "Arabic (Yemen)",
|
||||||
|
// "ar" => "Arabic",
|
||||||
|
// "hy_AM" => "Armenian (Armenia)",
|
||||||
|
// "hy" => "Armenian",
|
||||||
|
// "as_IN" => "Assamese (India)",
|
||||||
|
// "as" => "Assamese",
|
||||||
|
// "asa_TZ" => "Asu (Tanzania)",
|
||||||
|
// "asa" => "Asu",
|
||||||
|
// "az_Cyrl" => "Azerbaijani (Cyrillic)",
|
||||||
|
// "az_Cyrl_AZ" => "Azerbaijani (Cyrillic, Azerbaijan)",
|
||||||
|
// "az_Latn" => "Azerbaijani (Latin)",
|
||||||
|
// "az_Latn_AZ" => "Azerbaijani (Latin, Azerbaijan)",
|
||||||
|
// "az" => "Azerbaijani",
|
||||||
|
// "bm_ML" => "Bambara (Mali)",
|
||||||
|
// "bm" => "Bambara",
|
||||||
|
// "eu_ES" => "Basque (Spain)",
|
||||||
|
// "eu" => "Basque",
|
||||||
|
// "be_BY" => "Belarusian (Belarus)",
|
||||||
|
// "be" => "Belarusian",
|
||||||
|
// "bem_ZM" => "Bemba (Zambia)",
|
||||||
|
// "bem" => "Bemba",
|
||||||
|
// "bez_TZ" => "Bena (Tanzania)",
|
||||||
|
// "bez" => "Bena",
|
||||||
|
// "bn_BD" => "Bengali (Bangladesh)",
|
||||||
|
// "bn_IN" => "Bengali (India)",
|
||||||
|
// "bn" => "Bengali",
|
||||||
|
// "bs_BA" => "Bosnian (Bosnia and Herzegovina)",
|
||||||
|
// "bs" => "Bosnian",
|
||||||
|
// "bg_BG" => "Bulgarian (Bulgaria)",
|
||||||
|
// "bg" => "Bulgarian",
|
||||||
|
// "my_MM" => "Burmese (Myanmar [Burma])",
|
||||||
|
// "my" => "Burmese",
|
||||||
|
// "ca_ES" => "Catalan (Spain)",
|
||||||
|
// "ca" => "Catalan",
|
||||||
|
// "tzm_Latn" => "Central Morocco Tamazight (Latin)",
|
||||||
|
// "tzm_Latn_MA" => "Central Morocco Tamazight (Latin, Morocco)",
|
||||||
|
// "tzm" => "Central Morocco Tamazight",
|
||||||
|
// "chr_US" => "Cherokee (United States)",
|
||||||
|
// "chr" => "Cherokee",
|
||||||
|
// "cgg_UG" => "Chiga (Uganda)",
|
||||||
|
// "cgg" => "Chiga",
|
||||||
|
// "zh_Hans" => "Chinese (Simplified Han)",
|
||||||
|
// "zh_Hans_CN" => "Chinese (Simplified Han, China)",
|
||||||
|
// "zh_Hans_HK" => "Chinese (Simplified Han, Hong Kong SAR China)",
|
||||||
|
// "zh_Hans_MO" => "Chinese (Simplified Han, Macau SAR China)",
|
||||||
|
// "zh_Hans_SG" => "Chinese (Simplified Han, Singapore)",
|
||||||
|
// "zh_Hant" => "Chinese (Traditional Han)",
|
||||||
|
// "zh_Hant_HK" => "Chinese (Traditional Han, Hong Kong SAR China)",
|
||||||
|
// "zh_Hant_MO" => "Chinese (Traditional Han, Macau SAR China)",
|
||||||
|
//"zh_Hant_TW" => "Chinese (Traditional Han, Taiwan)",
|
||||||
|
// "zh-TW" => "中文 (繁體)",
|
||||||
|
// "zh" => "Chinese",
|
||||||
|
// "kw_GB" => "Cornish (United Kingdom)",
|
||||||
|
// "kw" => "Cornish",
|
||||||
|
// "hr_HR" => "Croatian (Croatia)",
|
||||||
|
// "hr" => "Croatian",
|
||||||
|
// "cs_CZ" => "Czech (Czech Republic)",
|
||||||
|
// "cs" => "Czech",
|
||||||
|
// "da_DK" => "Danish (Denmark)",
|
||||||
|
// "da" => "Danish",
|
||||||
|
// "nl_BE" => "Dutch (Belgium)",
|
||||||
|
// "nl_NL" => "Dutch (Netherlands)",
|
||||||
|
// "nl" => "Dutch",
|
||||||
|
// "ebu_KE" => "Embu (Kenya)",
|
||||||
|
// "ebu" => "Embu",
|
||||||
|
// "en_AS" => "English (American Samoa)",
|
||||||
|
// "en_AU" => "English (Australia)",
|
||||||
|
// "en_BE" => "English (Belgium)",
|
||||||
|
// "en_BZ" => "English (Belize)",
|
||||||
|
// "en_BW" => "English (Botswana)",
|
||||||
|
// "en_CA" => "English (Canada)",
|
||||||
|
// "en_GU" => "English (Guam)",
|
||||||
|
// "en_HK" => "English (Hong Kong SAR China)",
|
||||||
|
// "en_IN" => "English (India)",
|
||||||
|
// "en_IE" => "English (Ireland)",
|
||||||
|
// "en_JM" => "English (Jamaica)",
|
||||||
|
// "en_MT" => "English (Malta)",
|
||||||
|
// "en_MH" => "English (Marshall Islands)",
|
||||||
|
// "en_MU" => "English (Mauritius)",
|
||||||
|
// "en_NA" => "English (Namibia)",
|
||||||
|
// "en_NZ" => "English (New Zealand)",
|
||||||
|
// "en_MP" => "English (Northern Mariana Islands)",
|
||||||
|
// "en_PK" => "English (Pakistan)",
|
||||||
|
// "en_PH" => "English (Philippines)",
|
||||||
|
// "en_SG" => "English (Singapore)",
|
||||||
|
// "en_ZA" => "English (South Africa)",
|
||||||
|
// "en_TT" => "English (Trinidad and Tobago)",
|
||||||
|
// "en_UM" => "English (U.S. Minor Outlying Islands)",
|
||||||
|
// "en_VI" => "English (U.S. Virgin Islands)",
|
||||||
|
// "en_GB" => "English (United Kingdom)",
|
||||||
|
// "en_US" => "English (United States)",
|
||||||
|
// "en_ZW" => "English (Zimbabwe)",
|
||||||
|
'en' => 'English',
|
||||||
|
// "eo" => "Esperanto",
|
||||||
|
// "et_EE" => "Estonian (Estonia)",
|
||||||
|
// "et" => "Estonian",
|
||||||
|
// "ee_GH" => "Ewe (Ghana)",
|
||||||
|
// "ee_TG" => "Ewe (Togo)",
|
||||||
|
// "ee" => "Ewe",
|
||||||
|
// "fo_FO" => "Faroese (Faroe Islands)",
|
||||||
|
// "fo" => "Faroese",
|
||||||
|
// "fil_PH" => "Filipino (Philippines)",
|
||||||
|
// "fil" => "Filipino",
|
||||||
|
// "fi_FI" => "Finnish (Finland)",
|
||||||
|
// "fi" => "Finnish",
|
||||||
|
// "fr_BE" => "French (Belgium)",
|
||||||
|
// "fr_BJ" => "French (Benin)",
|
||||||
|
// "fr_BF" => "French (Burkina Faso)",
|
||||||
|
// "fr_BI" => "French (Burundi)",
|
||||||
|
// "fr_CM" => "French (Cameroon)",
|
||||||
|
// "fr_CA" => "French (Canada)",
|
||||||
|
// "fr_CF" => "French (Central African Republic)",
|
||||||
|
// "fr_TD" => "French (Chad)",
|
||||||
|
// "fr_KM" => "French (Comoros)",
|
||||||
|
// "fr_CG" => "French (Congo - Brazzaville)",
|
||||||
|
// "fr_CD" => "French (Congo - Kinshasa)",
|
||||||
|
// "fr_CI" => "French (Côte d’Ivoire)",
|
||||||
|
// "fr_DJ" => "French (Djibouti)",
|
||||||
|
// "fr_GQ" => "French (Equatorial Guinea)",
|
||||||
|
// "fr_FR" => "French (France)",
|
||||||
|
// "fr_GA" => "French (Gabon)",
|
||||||
|
// "fr_GP" => "French (Guadeloupe)",
|
||||||
|
// "fr_GN" => "French (Guinea)",
|
||||||
|
// "fr_LU" => "French (Luxembourg)",
|
||||||
|
// "fr_MG" => "French (Madagascar)",
|
||||||
|
// "fr_ML" => "French (Mali)",
|
||||||
|
// "fr_MQ" => "French (Martinique)",
|
||||||
|
// "fr_MC" => "French (Monaco)",
|
||||||
|
// "fr_NE" => "French (Niger)",
|
||||||
|
// "fr_RW" => "French (Rwanda)",
|
||||||
|
// "fr_RE" => "French (Réunion)",
|
||||||
|
// "fr_BL" => "French (Saint Barthélemy)",
|
||||||
|
// "fr_MF" => "French (Saint Martin)",
|
||||||
|
// "fr_SN" => "French (Senegal)",
|
||||||
|
// "fr_CH" => "French (Switzerland)",
|
||||||
|
// "fr_TG" => "French (Togo)",
|
||||||
|
// 'fr' => 'French',
|
||||||
|
// "ff_SN" => "Fulah (Senegal)",
|
||||||
|
// "ff" => "Fulah",
|
||||||
|
// "gl_ES" => "Galician (Spain)",
|
||||||
|
// "gl" => "Galician",
|
||||||
|
// "lg_UG" => "Ganda (Uganda)",
|
||||||
|
// "lg" => "Ganda",
|
||||||
|
// "ka_GE" => "Georgian (Georgia)",
|
||||||
|
// "ka" => "Georgian",
|
||||||
|
// "de_AT" => "German (Austria)",
|
||||||
|
// "de_BE" => "German (Belgium)",
|
||||||
|
// "de_DE" => "German (Germany)",
|
||||||
|
// "de_LI" => "German (Liechtenstein)",
|
||||||
|
// "de_LU" => "German (Luxembourg)",
|
||||||
|
// "de_CH" => "German (Switzerland)",
|
||||||
|
// "de" => "German",
|
||||||
|
// "el_CY" => "Greek (Cyprus)",
|
||||||
|
// "el_GR" => "Greek (Greece)",
|
||||||
|
// "el" => "Greek",
|
||||||
|
// "gu_IN" => "Gujarati (India)",
|
||||||
|
// "gu" => "Gujarati",
|
||||||
|
// "guz_KE" => "Gusii (Kenya)",
|
||||||
|
// "guz" => "Gusii",
|
||||||
|
// "ha_Latn" => "Hausa (Latin)",
|
||||||
|
// "ha_Latn_GH" => "Hausa (Latin, Ghana)",
|
||||||
|
// "ha_Latn_NE" => "Hausa (Latin, Niger)",
|
||||||
|
// "ha_Latn_NG" => "Hausa (Latin, Nigeria)",
|
||||||
|
// "ha" => "Hausa",
|
||||||
|
// "haw_US" => "Hawaiian (United States)",
|
||||||
|
// "haw" => "Hawaiian",
|
||||||
|
// "he_IL" => "Hebrew (Israel)",
|
||||||
|
// "he" => "Hebrew",
|
||||||
|
// "hi_IN" => "Hindi (India)",
|
||||||
|
// "hi" => "Hindi",
|
||||||
|
// "hu_HU" => "Hungarian (Hungary)",
|
||||||
|
// "hu" => "Hungarian",
|
||||||
|
// "is_IS" => "Icelandic (Iceland)",
|
||||||
|
// "is" => "Icelandic",
|
||||||
|
// "ig_NG" => "Igbo (Nigeria)",
|
||||||
|
// "ig" => "Igbo",
|
||||||
|
// "id_ID" => "Indonesian (Indonesia)",
|
||||||
|
// "id" => "Indonesian",
|
||||||
|
// "ga_IE" => "Irish (Ireland)",
|
||||||
|
// "ga" => "Irish",
|
||||||
|
// "it_IT" => "Italian (Italy)",
|
||||||
|
// "it_CH" => "Italian (Switzerland)",
|
||||||
|
// 'it' => 'Italian',
|
||||||
|
// "ja_JP" => "Japanese (Japan)",
|
||||||
|
// "ja" => "Japanese",
|
||||||
|
// "kea_CV" => "Kabuverdianu (Cape Verde)",
|
||||||
|
// "kea" => "Kabuverdianu",
|
||||||
|
// "kab_DZ" => "Kabyle (Algeria)",
|
||||||
|
// "kab" => "Kabyle",
|
||||||
|
// "kl_GL" => "Kalaallisut (Greenland)",
|
||||||
|
// "kl" => "Kalaallisut",
|
||||||
|
// "kln_KE" => "Kalenjin (Kenya)",
|
||||||
|
// "kln" => "Kalenjin",
|
||||||
|
// "kam_KE" => "Kamba (Kenya)",
|
||||||
|
// "kam" => "Kamba",
|
||||||
|
// "kn_IN" => "Kannada (India)",
|
||||||
|
// "kn" => "Kannada",
|
||||||
|
// "kk_Cyrl" => "Kazakh (Cyrillic)",
|
||||||
|
// "kk_Cyrl_KZ" => "Kazakh (Cyrillic, Kazakhstan)",
|
||||||
|
// "kk" => "Kazakh",
|
||||||
|
// "km_KH" => "Khmer (Cambodia)",
|
||||||
|
// "km" => "Khmer",
|
||||||
|
// "ki_KE" => "Kikuyu (Kenya)",
|
||||||
|
// "ki" => "Kikuyu",
|
||||||
|
// "rw_RW" => "Kinyarwanda (Rwanda)",
|
||||||
|
// "rw" => "Kinyarwanda",
|
||||||
|
// "kok_IN" => "Konkani (India)",
|
||||||
|
// "kok" => "Konkani",
|
||||||
|
// "ko_KR" => "Korean (South Korea)",
|
||||||
|
// "ko" => "Korean",
|
||||||
|
// "khq_ML" => "Koyra Chiini (Mali)",
|
||||||
|
// "khq" => "Koyra Chiini",
|
||||||
|
// "ses_ML" => "Koyraboro Senni (Mali)",
|
||||||
|
// "ses" => "Koyraboro Senni",
|
||||||
|
// "lag_TZ" => "Langi (Tanzania)",
|
||||||
|
// "lag" => "Langi",
|
||||||
|
// "lv_LV" => "Latvian (Latvia)",
|
||||||
|
// "lv" => "Latvian",
|
||||||
|
// "lt_LT" => "Lithuanian (Lithuania)",
|
||||||
|
// "lt" => "Lithuanian",
|
||||||
|
// "luo_KE" => "Luo (Kenya)",
|
||||||
|
// "luo" => "Luo",
|
||||||
|
// "luy_KE" => "Luyia (Kenya)",
|
||||||
|
// "luy" => "Luyia",
|
||||||
|
// "mk_MK" => "Macedonian (Macedonia)",
|
||||||
|
// "mk" => "Macedonian",
|
||||||
|
// "jmc_TZ" => "Machame (Tanzania)",
|
||||||
|
// "jmc" => "Machame",
|
||||||
|
// "kde_TZ" => "Makonde (Tanzania)",
|
||||||
|
// "kde" => "Makonde",
|
||||||
|
// "mg_MG" => "Malagasy (Madagascar)",
|
||||||
|
// "mg" => "Malagasy",
|
||||||
|
// "ms_BN" => "Malay (Brunei)",
|
||||||
|
// "ms_MY" => "Malay (Malaysia)",
|
||||||
|
// "ms" => "Malay",
|
||||||
|
// "ml_IN" => "Malayalam (India)",
|
||||||
|
// "ml" => "Malayalam",
|
||||||
|
// "mt_MT" => "Maltese (Malta)",
|
||||||
|
// "mt" => "Maltese",
|
||||||
|
// "gv_GB" => "Manx (United Kingdom)",
|
||||||
|
// "gv" => "Manx",
|
||||||
|
// "mr_IN" => "Marathi (India)",
|
||||||
|
// "mr" => "Marathi",
|
||||||
|
// "mas_KE" => "Masai (Kenya)",
|
||||||
|
// "mas_TZ" => "Masai (Tanzania)",
|
||||||
|
// "mas" => "Masai",
|
||||||
|
// "mer_KE" => "Meru (Kenya)",
|
||||||
|
// "mer" => "Meru",
|
||||||
|
// "mfe_MU" => "Morisyen (Mauritius)",
|
||||||
|
// "mfe" => "Morisyen",
|
||||||
|
// "naq_NA" => "Nama (Namibia)",
|
||||||
|
// "naq" => "Nama",
|
||||||
|
// "ne_IN" => "Nepali (India)",
|
||||||
|
// "ne_NP" => "Nepali (Nepal)",
|
||||||
|
// "ne" => "Nepali",
|
||||||
|
// "nd_ZW" => "North Ndebele (Zimbabwe)",
|
||||||
|
// "nd" => "North Ndebele",
|
||||||
|
// "nb_NO" => "Norwegian Bokmål (Norway)",
|
||||||
|
// "nb" => "Norwegian Bokmål",
|
||||||
|
// "nn_NO" => "Norwegian Nynorsk (Norway)",
|
||||||
|
// "nn" => "Norwegian Nynorsk",
|
||||||
|
// "nyn_UG" => "Nyankole (Uganda)",
|
||||||
|
// "nyn" => "Nyankole",
|
||||||
|
// "or_IN" => "Oriya (India)",
|
||||||
|
// "or" => "Oriya",
|
||||||
|
// "om_ET" => "Oromo (Ethiopia)",
|
||||||
|
// "om_KE" => "Oromo (Kenya)",
|
||||||
|
// "om" => "Oromo",
|
||||||
|
// "ps_AF" => "Pashto (Afghanistan)",
|
||||||
|
// "ps" => "Pashto",
|
||||||
|
// "fa_AF" => "Persian (Afghanistan)",
|
||||||
|
// "fa_IR" => "Persian (Iran)",
|
||||||
|
// "fa" => "Persian",
|
||||||
|
// "pl_PL" => "Polish (Poland)",
|
||||||
|
// "pl" => "Polish",
|
||||||
|
// "pt_BR" => "Portuguese (Brazil)",
|
||||||
|
// "pt_GW" => "Portuguese (Guinea-Bissau)",
|
||||||
|
// "pt_MZ" => "Portuguese (Mozambique)",
|
||||||
|
// "pt_PT" => "Portuguese (Portugal)",
|
||||||
|
// "pt" => "Portuguese",
|
||||||
|
// "pa_Arab" => "Punjabi (Arabic)",
|
||||||
|
// "pa_Arab_PK" => "Punjabi (Arabic, Pakistan)",
|
||||||
|
// "pa_Guru" => "Punjabi (Gurmukhi)",
|
||||||
|
// "pa_Guru_IN" => "Punjabi (Gurmukhi, India)",
|
||||||
|
// "pa" => "Punjabi",
|
||||||
|
// "ro_MD" => "Romanian (Moldova)",
|
||||||
|
// "ro_RO" => "Romanian (Romania)",
|
||||||
|
// 'ro' => 'Romanian',
|
||||||
|
// "rm_CH" => "Romansh (Switzerland)",
|
||||||
|
// "rm" => "Romansh",
|
||||||
|
// "rof_TZ" => "Rombo (Tanzania)",
|
||||||
|
// "rof" => "Rombo",
|
||||||
|
// "ru_MD" => "Russian (Moldova)",
|
||||||
|
// "ru_RU" => "Russian (Russia)",
|
||||||
|
// "ru_UA" => "Russian (Ukraine)",
|
||||||
|
// "ru" => "Russian",
|
||||||
|
// "rwk_TZ" => "Rwa (Tanzania)",
|
||||||
|
// "rwk" => "Rwa",
|
||||||
|
// "saq_KE" => "Samburu (Kenya)",
|
||||||
|
// "saq" => "Samburu",
|
||||||
|
// "sg_CF" => "Sango (Central African Republic)",
|
||||||
|
// "sg" => "Sango",
|
||||||
|
// "seh_MZ" => "Sena (Mozambique)",
|
||||||
|
// "seh" => "Sena",
|
||||||
|
// "sr_Cyrl" => "Serbian (Cyrillic)",
|
||||||
|
// "sr_Cyrl_BA" => "Serbian (Cyrillic, Bosnia and Herzegovina)",
|
||||||
|
// "sr_Cyrl_ME" => "Serbian (Cyrillic, Montenegro)",
|
||||||
|
// "sr_Cyrl_RS" => "Serbian (Cyrillic, Serbia)",
|
||||||
|
// "sr_Latn" => "Serbian (Latin)",
|
||||||
|
// "sr_Latn_BA" => "Serbian (Latin, Bosnia and Herzegovina)",
|
||||||
|
// "sr_Latn_ME" => "Serbian (Latin, Montenegro)",
|
||||||
|
// "sr_Latn_RS" => "Serbian (Latin, Serbia)",
|
||||||
|
// "sr" => "Serbian",
|
||||||
|
// "sn_ZW" => "Shona (Zimbabwe)",
|
||||||
|
// "sn" => "Shona",
|
||||||
|
// "ii_CN" => "Sichuan Yi (China)",
|
||||||
|
// "ii" => "Sichuan Yi",
|
||||||
|
// "si_LK" => "Sinhala (Sri Lanka)",
|
||||||
|
// "si" => "Sinhala",
|
||||||
|
// "sk_SK" => "Slovak (Slovakia)",
|
||||||
|
// "sk" => "Slovak",
|
||||||
|
// "sl_SI" => "Slovenian (Slovenia)",
|
||||||
|
// "sl" => "Slovenian",
|
||||||
|
// "xog_UG" => "Soga (Uganda)",
|
||||||
|
// "xog" => "Soga",
|
||||||
|
// "so_DJ" => "Somali (Djibouti)",
|
||||||
|
// "so_ET" => "Somali (Ethiopia)",
|
||||||
|
// "so_KE" => "Somali (Kenya)",
|
||||||
|
// "so_SO" => "Somali (Somalia)",
|
||||||
|
// "so" => "Somali",
|
||||||
|
// "es_AR" => "Spanish (Argentina)",
|
||||||
|
// "es_BO" => "Spanish (Bolivia)",
|
||||||
|
// "es_CL" => "Spanish (Chile)",
|
||||||
|
// "es_CO" => "Spanish (Colombia)",
|
||||||
|
// "es_CR" => "Spanish (Costa Rica)",
|
||||||
|
// "es_DO" => "Spanish (Dominican Republic)",
|
||||||
|
// "es_EC" => "Spanish (Ecuador)",
|
||||||
|
// "es_SV" => "Spanish (El Salvador)",
|
||||||
|
// "es_GQ" => "Spanish (Equatorial Guinea)",
|
||||||
|
// "es_GT" => "Spanish (Guatemala)",
|
||||||
|
// "es_HN" => "Spanish (Honduras)",
|
||||||
|
// "es_419" => "Spanish (Latin America)",
|
||||||
|
// "es_MX" => "Spanish (Mexico)",
|
||||||
|
// "es_NI" => "Spanish (Nicaragua)",
|
||||||
|
// "es_PA" => "Spanish (Panama)",
|
||||||
|
// "es_PY" => "Spanish (Paraguay)",
|
||||||
|
// "es_PE" => "Spanish (Peru)",
|
||||||
|
// "es_PR" => "Spanish (Puerto Rico)",
|
||||||
|
// "es_ES" => "Spanish (Spain)",
|
||||||
|
// "es_US" => "Spanish (United States)",
|
||||||
|
// "es_UY" => "Spanish (Uruguay)",
|
||||||
|
// "es_VE" => "Spanish (Venezuela)",
|
||||||
|
// "es" => "Spanish",
|
||||||
|
// "sw_KE" => "Swahili (Kenya)",
|
||||||
|
// "sw_TZ" => "Swahili (Tanzania)",
|
||||||
|
// "sw" => "Swahili",
|
||||||
|
// "sv_FI" => "Swedish (Finland)",
|
||||||
|
// "sv_SE" => "Swedish (Sweden)",
|
||||||
|
// "sv" => "Swedish",
|
||||||
|
// "gsw_CH" => "Swiss German (Switzerland)",
|
||||||
|
// "gsw" => "Swiss German",
|
||||||
|
// "shi_Latn" => "Tachelhit (Latin)",
|
||||||
|
// "shi_Latn_MA" => "Tachelhit (Latin, Morocco)",
|
||||||
|
// "shi_Tfng" => "Tachelhit (Tifinagh)",
|
||||||
|
// "shi_Tfng_MA" => "Tachelhit (Tifinagh, Morocco)",
|
||||||
|
// "shi" => "Tachelhit",
|
||||||
|
// "dav_KE" => "Taita (Kenya)",
|
||||||
|
// "dav" => "Taita",
|
||||||
|
// "ta_IN" => "Tamil (India)",
|
||||||
|
// "ta_LK" => "Tamil (Sri Lanka)",
|
||||||
|
// "ta" => "Tamil",
|
||||||
|
// "te_IN" => "Telugu (India)",
|
||||||
|
// "te" => "Telugu",
|
||||||
|
// "teo_KE" => "Teso (Kenya)",
|
||||||
|
// "teo_UG" => "Teso (Uganda)",
|
||||||
|
// "teo" => "Teso",
|
||||||
|
// "th_TH" => "Thai (Thailand)",
|
||||||
|
// "th" => "Thai",
|
||||||
|
// "bo_CN" => "Tibetan (China)",
|
||||||
|
// "bo_IN" => "Tibetan (India)",
|
||||||
|
// "bo" => "Tibetan",
|
||||||
|
// "ti_ER" => "Tigrinya (Eritrea)",
|
||||||
|
// "ti_ET" => "Tigrinya (Ethiopia)",
|
||||||
|
// "ti" => "Tigrinya",
|
||||||
|
// "to_TO" => "Tonga (Tonga)",
|
||||||
|
// "to" => "Tonga",
|
||||||
|
// "tr_TR" => "Turkish (Turkey)",
|
||||||
|
// "tr" => "Turkish",
|
||||||
|
// "uk_UA" => "Ukrainian (Ukraine)",
|
||||||
|
// "uk" => "Ukrainian",
|
||||||
|
// "ur_IN" => "Urdu (India)",
|
||||||
|
// "ur_PK" => "Urdu (Pakistan)",
|
||||||
|
// "ur" => "Urdu",
|
||||||
|
// "uz_Arab" => "Uzbek (Arabic)",
|
||||||
|
// "uz_Arab_AF" => "Uzbek (Arabic, Afghanistan)",
|
||||||
|
// "uz_Cyrl" => "Uzbek (Cyrillic)",
|
||||||
|
// "uz_Cyrl_UZ" => "Uzbek (Cyrillic, Uzbekistan)",
|
||||||
|
// "uz_Latn" => "Uzbek (Latin)",
|
||||||
|
// "uz_Latn_UZ" => "Uzbek (Latin, Uzbekistan)",
|
||||||
|
// "uz" => "Uzbek",
|
||||||
|
// "vi_VN" => "Vietnamese (Vietnam)",
|
||||||
|
// "vi" => "Vietnamese",
|
||||||
|
// "vun_TZ" => "Vunjo (Tanzania)",
|
||||||
|
// "vun" => "Vunjo",
|
||||||
|
// "cy_GB" => "Welsh (United Kingdom)",
|
||||||
|
// "cy" => "Welsh",
|
||||||
|
// "yo_NG" => "Yoruba (Nigeria)",
|
||||||
|
// "yo" => "Yoruba",
|
||||||
|
// "zu_ZA" => "Zulu (South Africa)",
|
||||||
|
// "zu" => "Zulu"
|
||||||
|
],
|
||||||
|
|
||||||
|
'view_namespaces' => [
|
||||||
|
'buttons' => [
|
||||||
|
'crud::buttons', // falls back to 'resources/views/vendor/backpack/crud/buttons'
|
||||||
|
],
|
||||||
|
'columns' => [
|
||||||
|
'crud::columns', // falls back to 'resources/views/vendor/backpack/crud/columns'
|
||||||
|
],
|
||||||
|
'fields' => [
|
||||||
|
'crud::fields', // falls back to 'resources/views/vendor/backpack/crud/fields'
|
||||||
|
],
|
||||||
|
'filters' => [
|
||||||
|
'crud::filters', // falls back to 'resources/views/vendor/backpack/crud/filters'
|
||||||
|
],
|
||||||
|
],
|
||||||
|
// the uploaders for the `withFiles` macro
|
||||||
|
'uploaders' => [
|
||||||
|
'withFiles' => [
|
||||||
|
'image' => \Backpack\CRUD\app\Library\Uploaders\SingleBase64Image::class,
|
||||||
|
'upload' => \Backpack\CRUD\app\Library\Uploaders\SingleFile::class,
|
||||||
|
'upload_multiple' => \Backpack\CRUD\app\Library\Uploaders\MultipleFiles::class,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
'file_name_generator' => \Backpack\CRUD\app\Library\Uploaders\Support\FileNameGenerator::class,
|
||||||
|
|
||||||
|
];
|
11
config/backpack/language-switcher.php
Normal file
11
config/backpack/language-switcher.php
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
// when `false` developer should setup their own route for language switcher
|
||||||
|
// check the default route at /vendor/backpack/language-switcher/routes/language-switcher.php
|
||||||
|
'setup_routes' => true,
|
||||||
|
|
||||||
|
// when true, we will add the route prefix on the language-switcher route.
|
||||||
|
// eg: https://domain.com/admin/set-locale/{locale} instead of https://domain.com/set-locale/{locale}
|
||||||
|
'use_backpack_route_prefix' => false,
|
||||||
|
];
|
42
config/backpack/operations/create.php
Normal file
42
config/backpack/operations/create.php
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configurations for Backpack's CreateOperation.
|
||||||
|
*
|
||||||
|
* @see https://backpackforlaravel.com/docs/crud-operation-create
|
||||||
|
*/
|
||||||
|
|
||||||
|
return [
|
||||||
|
// Define the size/looks of the content div for all CRUDs
|
||||||
|
// To override per view use $this->crud->setCreateContentClass('class-string')
|
||||||
|
'contentClass' => 'col-md-12 bold-labels',
|
||||||
|
|
||||||
|
// When using tabbed forms (create & update), what kind of tabs would you like?
|
||||||
|
'tabsType' => 'horizontal', //options: horizontal, vertical
|
||||||
|
|
||||||
|
// How would you like the validation errors to be shown?
|
||||||
|
'groupedErrors' => true,
|
||||||
|
'inlineErrors' => true,
|
||||||
|
|
||||||
|
// when the page loads, put the cursor on the first input?
|
||||||
|
'autoFocusOnFirstField' => true,
|
||||||
|
|
||||||
|
// Where do you want to redirect the user by default, save?
|
||||||
|
// options: save_and_back, save_and_edit, save_and_new
|
||||||
|
'defaultSaveAction' => 'save_and_back',
|
||||||
|
|
||||||
|
// When the user chooses "save and back" or "save and new", show a bubble
|
||||||
|
// for the fact that the default save action has been changed?
|
||||||
|
'showSaveActionChange' => true, //options: true, false
|
||||||
|
|
||||||
|
// Should we show a cancel button to the user?
|
||||||
|
'showCancelButton' => true,
|
||||||
|
|
||||||
|
// Should we warn a user before leaving the page with unsaved changes?
|
||||||
|
'warnBeforeLeaving' => false,
|
||||||
|
|
||||||
|
// Before saving the entry, how would you like the request to be stripped?
|
||||||
|
// - false - use Backpack's default (ONLY save inputs that have fields)
|
||||||
|
// - invokable class - custom stripping (the return should be an array with input names)
|
||||||
|
// 'strippedRequest' => App\Http\Requests\StripBackpackRequest::class,
|
||||||
|
];
|
39
config/backpack/operations/form.php
Normal file
39
config/backpack/operations/form.php
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default configurations for custom form operations.
|
||||||
|
*/
|
||||||
|
|
||||||
|
return [
|
||||||
|
// Define the size/looks of the content div for all CRUDs
|
||||||
|
// To override per view use $this->crud->setCreateContentClass('class-string')
|
||||||
|
'contentClass' => 'col-md-12 bold-labels',
|
||||||
|
|
||||||
|
// When using tabbed forms (create & update), what kind of tabs would you like?
|
||||||
|
'tabsType' => 'horizontal', //options: horizontal, vertical
|
||||||
|
|
||||||
|
// How would you like the validation errors to be shown?
|
||||||
|
'groupedErrors' => true,
|
||||||
|
'inlineErrors' => true,
|
||||||
|
|
||||||
|
// when the page loads, put the cursor on the first input?
|
||||||
|
'autoFocusOnFirstField' => true,
|
||||||
|
|
||||||
|
// Where do you want to redirect the user by default, save?
|
||||||
|
'defaultSaveAction' => 'save_and_back',
|
||||||
|
|
||||||
|
// When the user chooses "save and back" or "save and new", show a bubble
|
||||||
|
// for the fact that the default save action has been changed?
|
||||||
|
'showSaveActionChange' => false, //options: true, false
|
||||||
|
|
||||||
|
// Should we show a cancel button to the user?
|
||||||
|
'showCancelButton' => true,
|
||||||
|
|
||||||
|
// Should we warn a user before leaving the page with unsaved changes?
|
||||||
|
'warnBeforeLeaving' => false,
|
||||||
|
|
||||||
|
// Before saving the entry, how would you like the request to be stripped?
|
||||||
|
// - false - use Backpack's default (ONLY save inputs that have fields)
|
||||||
|
// - invokable class - custom stripping (the return should be an array with input names)
|
||||||
|
// 'strippedRequest' => App\Http\Requests\StripBackpackRequest::class,
|
||||||
|
];
|
67
config/backpack/operations/list.php
Normal file
67
config/backpack/operations/list.php
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configurations for Backpack's ListOperation.
|
||||||
|
*
|
||||||
|
* @see https://backpackforlaravel.com/docs/crud-operation-list
|
||||||
|
*/
|
||||||
|
|
||||||
|
return [
|
||||||
|
// Define the size/looks of the content div for all CRUDs
|
||||||
|
// To override per view use $this->crud->setListContentClass('class-string')
|
||||||
|
'contentClass' => 'col-md-12',
|
||||||
|
|
||||||
|
// enable the datatables-responsive plugin, which hides columns if they don't fit?
|
||||||
|
// if not, a horizontal scrollbar will be shown instead
|
||||||
|
'responsiveTable' => true,
|
||||||
|
|
||||||
|
// stores pagination and filters in localStorage for two hours
|
||||||
|
// whenever the user tries to see that page, backpack loads the previous pagination and filtration
|
||||||
|
'persistentTable' => true,
|
||||||
|
|
||||||
|
// show search bar in the top-right corner?
|
||||||
|
'searchableTable' => true,
|
||||||
|
|
||||||
|
// the time the table will be persisted in minutes
|
||||||
|
// after this the table info is cleared from localStorage.
|
||||||
|
// use false to never force localStorage clear. (default)
|
||||||
|
// keep in mind: User can clear their localStorage whenever they want.
|
||||||
|
|
||||||
|
'persistentTableDuration' => false,
|
||||||
|
|
||||||
|
// How many items should be shown by default by the Datatable?
|
||||||
|
// This value can be overwritten on a specific CRUD by calling
|
||||||
|
// $this->crud->setDefaultPageLength(50);
|
||||||
|
'defaultPageLength' => 10,
|
||||||
|
|
||||||
|
// A 1D array of options which will be used for both the displayed option and the value, or
|
||||||
|
// A 2D array in which the first array is used to define the value options and the second array the displayed options
|
||||||
|
// If a 2D array is used, strings in the right hand array will be automatically run through trans()
|
||||||
|
'pageLengthMenu' => [[10, 25, 50, 100, -1], [10, 25, 50, 100, 'backpack::crud.all']],
|
||||||
|
|
||||||
|
// How important is it for the action buttons to be visible?
|
||||||
|
// - 0 - most important
|
||||||
|
// - 1 - as important as bulk buttons
|
||||||
|
// - 2-3 - more important than the rest of the columns
|
||||||
|
// - 4 - less important than most columns
|
||||||
|
'actionsColumnPriority' => 1,
|
||||||
|
|
||||||
|
// Nest action buttons within a dropdown in actions column
|
||||||
|
'lineButtonsAsDropdown' => false,
|
||||||
|
|
||||||
|
// Show a "Reset" button next to the List operation subheading
|
||||||
|
// (Showing 1 to 25 of 9999 entries. Reset)
|
||||||
|
// that allows the user to erase local storage for that datatable,
|
||||||
|
// thus clearing any searching, filtering or pagination that has been
|
||||||
|
// remembered and persisted using persistentTable
|
||||||
|
'resetButton' => true,
|
||||||
|
|
||||||
|
// The query operator that is used to search on the table.
|
||||||
|
// If you are using PostgreSQL you might want to change
|
||||||
|
// to `ilike` for case-insensitive search
|
||||||
|
'searchOperator' => 'like',
|
||||||
|
|
||||||
|
// Display the `Showing X of XX entries (filtered from X entries)`?
|
||||||
|
// Setting this to false will improve performance on big datasets.
|
||||||
|
'showEntryCount' => true,
|
||||||
|
];
|
16
config/backpack/operations/reorder.php
Normal file
16
config/backpack/operations/reorder.php
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configurations for Backpack ReorderOperation.
|
||||||
|
*
|
||||||
|
* @see https://backpackforlaravel.com/docs/crud-operation-reorder
|
||||||
|
*/
|
||||||
|
|
||||||
|
return [
|
||||||
|
// Define the size/looks of the content div for all CRUDs
|
||||||
|
// To override per Controller use $this->crud->setReorderContentClass('class-string')
|
||||||
|
'contentClass' => 'col-md-12 col-md-offset-2',
|
||||||
|
|
||||||
|
// should the content of the reorder label be escaped?
|
||||||
|
'escaped' => false,
|
||||||
|
];
|
29
config/backpack/operations/show.php
Normal file
29
config/backpack/operations/show.php
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configurations for Backpack's ShowOperation.
|
||||||
|
*
|
||||||
|
* @see https://backpackforlaravel.com/docs/crud-operation-show
|
||||||
|
*/
|
||||||
|
|
||||||
|
return [
|
||||||
|
// Define the size/looks of the content div for all CRUDs
|
||||||
|
// To override per Controller use $this->crud->setShowContentClass('class-string')
|
||||||
|
'contentClass' => 'col-md-12',
|
||||||
|
|
||||||
|
// Automatically add all columns from the db table?
|
||||||
|
'setFromDb' => true,
|
||||||
|
|
||||||
|
// Automatically add created_at and updated_at columns, if model has timestamps?
|
||||||
|
'timestamps' => true,
|
||||||
|
|
||||||
|
// If model has SoftDeletes, allow the admin to access the Show page for
|
||||||
|
// soft deleted items & add a deleted_at column to ShowOperation?
|
||||||
|
'softDeletes' => false,
|
||||||
|
|
||||||
|
// Enable to group columns in tabs
|
||||||
|
'tabsEnabled' => false,
|
||||||
|
|
||||||
|
// When using tabbed forms (create & update), what kind of tabs would you like?
|
||||||
|
'tabsType' => 'horizontal', //options: horizontal, vertical
|
||||||
|
];
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user