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:3uy5IaV+VbL7wNdXCJQoPYRUzzJWo9yuvV89mk+aJgk=
|
||||||
|
APP_DEBUG=true
|
||||||
|
APP_URL=http://backpackforlaravel.local
|
||||||
|
|
||||||
|
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 over 2000 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) {
|
||||||
|
//
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,47 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\Charts;
|
||||||
|
|
||||||
|
use Backpack\CRUD\app\Http\Controllers\ChartController;
|
||||||
|
use ConsoleTVs\Charts\Classes\Chartjs\Chart;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class WeeklyUsersChartController
|
||||||
|
* @package App\Http\Controllers\Admin\Charts
|
||||||
|
* @property-read \Backpack\CRUD\app\Library\CrudPanel\CrudPanel $crud
|
||||||
|
*/
|
||||||
|
class WeeklyUsersChartController extends ChartController
|
||||||
|
{
|
||||||
|
public function setup()
|
||||||
|
{
|
||||||
|
$this->chart = new Chart();
|
||||||
|
|
||||||
|
// MANDATORY. Set the labels for the dataset points
|
||||||
|
$this->chart->labels([
|
||||||
|
'Today',
|
||||||
|
]);
|
||||||
|
|
||||||
|
// RECOMMENDED. Set URL that the ChartJS library should call, to get its data using AJAX.
|
||||||
|
$this->chart->load(backpack_url('charts/weekly-users'));
|
||||||
|
|
||||||
|
// OPTIONAL
|
||||||
|
// $this->chart->minimalist(false);
|
||||||
|
// $this->chart->displayLegend(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Respond to AJAX calls with all the chart data points.
|
||||||
|
*
|
||||||
|
* @return json
|
||||||
|
*/
|
||||||
|
public function data()
|
||||||
|
{
|
||||||
|
$users_created_today = \App\Models\User::whereDate('created_at', today())->count();
|
||||||
|
|
||||||
|
$this->chart->dataset('Users Created', 'bar', [
|
||||||
|
$users_created_today,
|
||||||
|
])
|
||||||
|
->color('rgba(205, 32, 31, 1)')
|
||||||
|
->backgroundColor('rgba(205, 32, 31, 0.4)');
|
||||||
|
}
|
||||||
|
}
|
326
app/Http/Controllers/Admin/DemoCatalogsCrudController.php
Normal file
326
app/Http/Controllers/Admin/DemoCatalogsCrudController.php
Normal file
@ -0,0 +1,326 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin;
|
||||||
|
|
||||||
|
use App\Http\Requests\DemoCatalogsRequest;
|
||||||
|
use Backpack\CRUD\app\Http\Controllers\CrudController;
|
||||||
|
use Backpack\CRUD\app\Library\CrudPanel\CrudPanelFacade as CRUD;
|
||||||
|
|
||||||
|
use Backpack\CRUD\app\Library\Widget;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class DemoCatalogsCrudController
|
||||||
|
* @package App\Http\Controllers\Admin
|
||||||
|
* @property-read \Backpack\CRUD\app\Library\CrudPanel\CrudPanel $crud
|
||||||
|
*/
|
||||||
|
class DemoCatalogsCrudController 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\InlineCreateOperation;
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\CloneOperation;
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\BulkCloneOperation;
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\BulkDeleteOperation;
|
||||||
|
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\FetchOperation;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configure the CrudPanel object. Apply settings to all operations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function setup()
|
||||||
|
{
|
||||||
|
CRUD::setModel(\App\Models\DemoCatalogs::class);
|
||||||
|
CRUD::setRoute(config('backpack.base.route_prefix') . '/demo-catalogs');
|
||||||
|
CRUD::setEntityNameStrings('demo catalogs', 'demo catalogs');
|
||||||
|
|
||||||
|
CRUD::enableDetailsRow();
|
||||||
|
|
||||||
|
$this->crud->set('clone.redirect_after_clone', true);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function setupReorderOperation()
|
||||||
|
{
|
||||||
|
CRUD::set('reorder.label', 'name');
|
||||||
|
CRUD::set('reorder.max_level', 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function showDetailsRow($id)
|
||||||
|
{
|
||||||
|
|
||||||
|
$this->data['entry'] = $this->crud->getEntry($id);
|
||||||
|
$this->data['crud'] = $this->crud;
|
||||||
|
Widget::add()->to('crud-details-row')->type('progress')->value(135)->description('Progress')->progress(50);
|
||||||
|
$userCount = 300;
|
||||||
|
Widget::add()->to('crud-details-row')->type('div')->class('row')->content([
|
||||||
|
//widget made using fluent syntax
|
||||||
|
Widget::make()
|
||||||
|
->type('progress')
|
||||||
|
->class('card border-0 text-white bg-primary')
|
||||||
|
->progressClass('progress-bar')
|
||||||
|
->value($userCount)
|
||||||
|
->description('Registered users.')
|
||||||
|
->progress(100 * (int)$userCount / 1000)
|
||||||
|
->hint(1000 - $userCount . ' more until next milestone.'),
|
||||||
|
|
||||||
|
//widget made using the array definition
|
||||||
|
Widget::make(
|
||||||
|
[
|
||||||
|
'type' => 'card',
|
||||||
|
'class' => 'card bg-dark text-white',
|
||||||
|
'wrapper' => ['class' => 'col-sm-3 col-md-3'],
|
||||||
|
'content' => [
|
||||||
|
'header' => 'Example Widget',
|
||||||
|
'body' => 'Widget placed at "before_content" secion in same row',
|
||||||
|
]
|
||||||
|
]
|
||||||
|
),
|
||||||
|
]);
|
||||||
|
|
||||||
|
// load the view from /resources/views/vendor/backpack/crud/ if it exists, otherwise load the one in the package
|
||||||
|
return view('crud::details_row', $this->data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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('name')->label('名稱')->type('textarea_nl2br')->escaped(false)->searchLogic('text');
|
||||||
|
$this->crud->addColumns([
|
||||||
|
[
|
||||||
|
'value' => '111,222,333',
|
||||||
|
'label' => 'ttt',
|
||||||
|
'type' => 'text_split',
|
||||||
|
'wrapper' => [
|
||||||
|
'href' => function ($crud, $column, $entry, $related_key, $current_value) {
|
||||||
|
$query = "";
|
||||||
|
$query .= 'date_range='.$current_value;
|
||||||
|
return backpack_url('logs/view-by-cloud-id-days-r?'.$query);
|
||||||
|
},
|
||||||
|
],
|
||||||
|
],
|
||||||
|
// [
|
||||||
|
// 'name' => 'text9',
|
||||||
|
// 'type' => 'image',
|
||||||
|
// ],
|
||||||
|
// [
|
||||||
|
// 'name' => 'text9',
|
||||||
|
// 'type' => 'table',
|
||||||
|
// 'entity_singular' => '梯度價格', // used on the "Add X" button
|
||||||
|
// 'columns' => [
|
||||||
|
// 'name' => 'Name',
|
||||||
|
// 'desc' => 'Description',
|
||||||
|
// 'price' => 'Price'
|
||||||
|
// ],
|
||||||
|
// ],
|
||||||
|
[
|
||||||
|
'name' => 'text9', // The db column name
|
||||||
|
'label' => 'Video1', // Table column heading
|
||||||
|
'type' => 'video',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'text10', // The db column name
|
||||||
|
'label' => 'Video2', // Table column heading
|
||||||
|
'type' => 'video',
|
||||||
|
],
|
||||||
|
]);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//CRUD::setFromDb(); // set columns from db columns.
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Columns can be defined using the fluent syntax:
|
||||||
|
* - CRUD::column('price')->type('number');
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function fetchNewsCatalog()
|
||||||
|
{
|
||||||
|
return $this->fetch(\App\Models\NewsCatalog::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define what happens when the Create operation is loaded.
|
||||||
|
*
|
||||||
|
* @see https://backpackforlaravel.com/docs/crud-operation-create
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
protected function setupCreateOperation()
|
||||||
|
{
|
||||||
|
CRUD::setValidation(DemoCatalogsRequest::class);
|
||||||
|
//CRUD::setFromDb(); // set fields from db columns.
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fields can be defined using the fluent syntax:
|
||||||
|
* - CRUD::field('price')->type('number');
|
||||||
|
*/
|
||||||
|
//CRUD::field('name')->label('名稱(必填)')->type('textarea');
|
||||||
|
|
||||||
|
CRUD::addFields([
|
||||||
|
[
|
||||||
|
'name' => 'name',
|
||||||
|
'lable' => 'Name',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'photos',
|
||||||
|
'label' => '圖片',
|
||||||
|
'type' => 'upload_img_multiple',
|
||||||
|
'upload' => true,
|
||||||
|
'disk' => 'public',
|
||||||
|
'hint' => '',
|
||||||
|
'qty' => 3, // 0=no limit, >0=limit
|
||||||
|
'showSingleChoise' => '0', // 0=hidden, 1=show(default)
|
||||||
|
'showComment' => '0', // 0=hidden, 1=show(default)
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'text1',
|
||||||
|
'lable' => 'Text1',
|
||||||
|
'type' => 'select2_from_array',
|
||||||
|
'options' => ['one' => 'One', 'two' => 'Two'],
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'text2',
|
||||||
|
'lable' => 'Text2',
|
||||||
|
'type' => 'browse',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'text3',
|
||||||
|
'lable' => 'Text3',
|
||||||
|
'type' => 'browse_multiple',
|
||||||
|
'sortable' => true,
|
||||||
|
// app/models/modelxxx.php add "protected $casts = ['text3' => 'array'];"
|
||||||
|
],
|
||||||
|
[ // date_range
|
||||||
|
'name' => 'text4,text5', // db columns for start_date & end_date
|
||||||
|
'label' => 'Text4,5',
|
||||||
|
'type' => 'date_range',
|
||||||
|
// app/models/modelxxx.php add "protected $casts = ['text4' => 'datetime', 'text5' => 'datetime'];"
|
||||||
|
|
||||||
|
// OPTIONALS
|
||||||
|
// default values for start_date & end_date
|
||||||
|
//'default' => ['2019-03-28 01:01', '2019-04-05 02:00'],
|
||||||
|
// options sent to daterangepicker.js
|
||||||
|
'date_range_options' => [
|
||||||
|
'drops' => 'down', // can be one of [down/up/auto]
|
||||||
|
'timePicker' => true,
|
||||||
|
'locale' => ['format' => 'YYYY/MM/DD HH:mm']
|
||||||
|
],
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'text6',
|
||||||
|
'lable' => 'Text6',
|
||||||
|
'type' => 'date_picker',
|
||||||
|
// app/models/modelxxx.php add "protected $casts = ['text6' => 'datetime'];"
|
||||||
|
'date_picker_options' => [
|
||||||
|
'todayBtn' => 'linked',
|
||||||
|
'format' => 'yyyy-mm-dd',
|
||||||
|
'language' => str_replace('_', '-', app()->getLocale()),
|
||||||
|
],
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'text7',
|
||||||
|
'lable' => 'Text7',
|
||||||
|
'type' => 'datetime_picker',
|
||||||
|
// app/models/modelxxx.php add "protected $casts = ['text7' => 'datetime'];"
|
||||||
|
'datetime_picker_options' => [
|
||||||
|
'format' => 'YYYY/MM/DD HH:mm',
|
||||||
|
//'language' => 'en',
|
||||||
|
'tooltips' => [ //use this to translate the tooltips in the field
|
||||||
|
'today' => 'Hoje',
|
||||||
|
'selectDate' => 'Selecione a data',
|
||||||
|
// available tooltips: today, clear, close, selectMonth, prevMonth, nextMonth, selectYear, prevYear, nextYear, selectDecade, prevDecade, nextDecade, prevCentury, nextCentury, pickHour, incrementHour, decrementHour, pickMinute, incrementMinute, decrementMinute, pickSecond, incrementSecond, decrementSecond, togglePeriod, selectTime, selectDate
|
||||||
|
]
|
||||||
|
],
|
||||||
|
'allows_null' => true,
|
||||||
|
// 'default' => '2017-05-12 11:59:59',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'text8',
|
||||||
|
'lable' => 'Text8',
|
||||||
|
'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' => 'text9',
|
||||||
|
// 'lable' => 'Text9',
|
||||||
|
// 'type' => 'base64_image',
|
||||||
|
// 'filename' => null, // set to null if not needed
|
||||||
|
// 'aspect_ratio' => 1, // set to 0 to allow any aspect ratio
|
||||||
|
// 'crop' => true, // set to true to allow cropping, false to disable
|
||||||
|
// 'src' => NULL, // null to read straight from DB, otherwise set to model accessor function
|
||||||
|
// ],
|
||||||
|
// [
|
||||||
|
// 'name' => 'text9',
|
||||||
|
// 'label' => 'Text9',
|
||||||
|
// 'type' => 'table',
|
||||||
|
// 'entity_singular' => '梯度價格', // used on the "Add X" button
|
||||||
|
// 'columns' => [
|
||||||
|
// 'name' => 'Name',
|
||||||
|
// 'desc' => 'Description',
|
||||||
|
// 'price' => 'Price'
|
||||||
|
// ],
|
||||||
|
// 'max' => 5, // maximum rows allowed in the table
|
||||||
|
// 'min' => 0, // minimum rows allowed in the table
|
||||||
|
// ],
|
||||||
|
[ // URL
|
||||||
|
'name' => 'text9',
|
||||||
|
'label' => 'text9 Link to video file on YouTube or Vimeo',
|
||||||
|
'type' => 'video',
|
||||||
|
'youtube_api_key' => 'AIzaSyDXyjzIho2thtYafQ_ofKOPEkj63Dprj58',
|
||||||
|
],
|
||||||
|
[ // URL
|
||||||
|
'name' => 'text10',
|
||||||
|
'label' => 'text10 Link to video file on YouTube or Vimeo',
|
||||||
|
'type' => 'video',
|
||||||
|
'youtube_api_key' => 'AIzaSyDXyjzIho2thtYafQ_ofKOPEkj63Dprj58',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'type' => "relationship",
|
||||||
|
'name' => 'NewsCatalog', // the method on your model that defines the relationship
|
||||||
|
'ajax' => true,
|
||||||
|
'inline_create' => true, // assumes the URL will be "/admin/category/inline/create"
|
||||||
|
]
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define what happens when the Update operation is loaded.
|
||||||
|
*
|
||||||
|
* @see https://backpackforlaravel.com/docs/crud-operation-update
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
protected function setupUpdateOperation()
|
||||||
|
{
|
||||||
|
$this->setupCreateOperation();
|
||||||
|
}
|
||||||
|
}
|
79
app/Http/Controllers/Admin/NewsCatalogCrudController.php
Normal file
79
app/Http/Controllers/Admin/NewsCatalogCrudController.php
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
<?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\InlineCreateOperation;
|
||||||
|
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\NewsCatalog::class);
|
||||||
|
CRUD::setRoute(config('backpack.base.route_prefix') . '/news-catalog');
|
||||||
|
CRUD::setEntityNameStrings('news catalog', 'news catalogs');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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(NewsCatalogRequest::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/NewsCrudController.php
Normal file
77
app/Http/Controllers/Admin/NewsCrudController.php
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
<?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('news', 'news');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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(NewsRequest::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();
|
||||||
|
}
|
||||||
|
}
|
347
app/Http/Controllers/Admin/UserCrudController.php
Normal file
347
app/Http/Controllers/Admin/UserCrudController.php
Normal file
@ -0,0 +1,347 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin;
|
||||||
|
|
||||||
|
use Backpack\CRUD\app\Http\Controllers\CrudController;
|
||||||
|
use Backpack\PermissionManager\app\Http\Requests\UserStoreCrudRequest as StoreRequest;
|
||||||
|
use Backpack\PermissionManager\app\Http\Requests\UserUpdateCrudRequest as UpdateRequest;
|
||||||
|
use Illuminate\Support\Facades\Hash;
|
||||||
|
use Backpack\CRUD\app\Library\CrudPanel\CrudPanelFacade as CRUD;
|
||||||
|
use Backpack\CRUD\app\Library\Widget;
|
||||||
|
|
||||||
|
class UserCrudController extends CrudController
|
||||||
|
{
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\ListOperation;
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\CreateOperation { store as traitStore; }
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\UpdateOperation { update as traitUpdate; }
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\DeleteOperation { destroy as traitDestroy; }
|
||||||
|
//use \Backpack\CRUD\app\Http\Controllers\Operations\ShowOperation;
|
||||||
|
|
||||||
|
use \Backpack\CRUD\app\Http\Controllers\Operations\FetchOperation;
|
||||||
|
|
||||||
|
protected function fetchUser()
|
||||||
|
{
|
||||||
|
return $this->fetch(\App\Models\User::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function setup()
|
||||||
|
{
|
||||||
|
$this->crud->setModel(config('backpack.permissionmanager.models.user'));
|
||||||
|
$this->crud->setEntityNameStrings(trans('backpack::permissionmanager.user'), trans('backpack::permissionmanager.users'));
|
||||||
|
$this->crud->setRoute(backpack_url('user'));
|
||||||
|
$this->crud->addClause('where', 'id', '>', '1');
|
||||||
|
|
||||||
|
$this->crud->removeAllFilters();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setupListOperation()
|
||||||
|
{
|
||||||
|
Widget::add([
|
||||||
|
'type' => 'chart',
|
||||||
|
'controller' => \App\Http\Controllers\Admin\Charts\WeeklyUsersChartController::class,
|
||||||
|
|
||||||
|
// OPTIONALS
|
||||||
|
'class' => 'card mb-2',
|
||||||
|
'wrapper' => ['class'=> 'col-md-6'] ,
|
||||||
|
'content' => [
|
||||||
|
'header' => 'New Users',
|
||||||
|
'body' => 'This chart should make it obvious how many new users have signed up in the past 7 days.<br><br>',
|
||||||
|
],
|
||||||
|
])
|
||||||
|
->to('after_content');
|
||||||
|
|
||||||
|
$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' => 'select2',
|
||||||
|
'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' => 'permission',
|
||||||
|
// 'type' => 'select2_multiple',
|
||||||
|
// 'label' => trans('backpack::permissionmanager.extra_permissions'),
|
||||||
|
// ],
|
||||||
|
// config('permission.models.permission')::all()->pluck('name', 'id')->toArray(),
|
||||||
|
// function ($values) { // if the filter is active
|
||||||
|
// //CRUD::addClause('whereIn', 'status', json_decode($values));
|
||||||
|
// $this->crud->addClause('whereHas', 'permissions', function ($query) use ($value) {
|
||||||
|
// $query->where('permission_id', 'in', json_decode($values));
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// );
|
||||||
|
|
||||||
|
CRUD::filter('pw')
|
||||||
|
->label(trans('backpack::permissionmanager.extra_permissions'))
|
||||||
|
->type('select2_multiple')
|
||||||
|
->values(function () {
|
||||||
|
return config('permission.models.permission')::all()->pluck('name', 'id')->toArray();
|
||||||
|
})
|
||||||
|
->whenActive(function($values) {
|
||||||
|
//var_dump($values);
|
||||||
|
// CRUD::addClause('whereIn', 'status', json_decode($values));
|
||||||
|
$this->crud->addClause('whereHas', 'permissions', function ($query) use ($values) {
|
||||||
|
$query->whereIn('permission_id', json_decode($values));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
CRUD::filter('pp')
|
||||||
|
->type('select2_ajax')
|
||||||
|
// set options to customize, www.daterangepicker.com/#options
|
||||||
|
->method('POST')
|
||||||
|
->values(backpack_url('user/fetch/user'))
|
||||||
|
->whenActive(function($value) {
|
||||||
|
CRUD::addClause('where', 'id', '=', $value);
|
||||||
|
});
|
||||||
|
|
||||||
|
CRUD::filter('active')
|
||||||
|
->type('simple')
|
||||||
|
->whenActive(function() {
|
||||||
|
// CRUD::addClause('active'); // apply the "active" eloquent scope
|
||||||
|
});
|
||||||
|
|
||||||
|
CRUD::filter('created_at')
|
||||||
|
->type('date_range')
|
||||||
|
// set options to customize, www.daterangepicker.com/#options
|
||||||
|
->date_range_options([
|
||||||
|
'timePicker' => true // example: enable/disable time picker
|
||||||
|
])
|
||||||
|
->whenActive(function($value) {
|
||||||
|
// $dates = json_decode($value);
|
||||||
|
// CRUD::addClause('where', 'date', '>=', $dates->from);
|
||||||
|
// CRUD::addClause('where', 'date', '<=', $dates->to);
|
||||||
|
});
|
||||||
|
|
||||||
|
CRUD::filter('updated_at')
|
||||||
|
->type('date')
|
||||||
|
->whenActive(function($value) {
|
||||||
|
// CRUD::addClause('where', 'date', $value);
|
||||||
|
});
|
||||||
|
|
||||||
|
CRUD::filter('email')
|
||||||
|
->type('text')
|
||||||
|
->whenActive(function($value) {
|
||||||
|
CRUD::addClause('where', 'email', 'LIKE', "%$value%");
|
||||||
|
});
|
||||||
|
|
||||||
|
CRUD::filter('id')
|
||||||
|
->type('range')
|
||||||
|
->whenActive(function($value) {
|
||||||
|
$range = json_decode($value);
|
||||||
|
if ($range->from) {
|
||||||
|
CRUD::addClause('where', 'id', '>=', (float) $range->from);
|
||||||
|
}
|
||||||
|
if ($range->to) {
|
||||||
|
CRUD::addClause('where', 'id', '<=', (float) $range->to);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setupCreateOperation()
|
||||||
|
{
|
||||||
|
$this->addUserFields();
|
||||||
|
$this->crud->setValidation(StoreRequest::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setupUpdateOperation()
|
||||||
|
{
|
||||||
|
$this->addUserFields();
|
||||||
|
$this->crud->setValidation(UpdateRequest::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy($id)
|
||||||
|
{
|
||||||
|
CRUD::hasAccessOrFail('delete');
|
||||||
|
$userId = \Auth::guard(config('backpack.base.guard'))->user()->id;
|
||||||
|
if ($id == $userId)
|
||||||
|
{
|
||||||
|
return \Alert::error('不可刪除自己!');
|
||||||
|
}
|
||||||
|
return CRUD::delete($id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setupShowOperation()
|
||||||
|
{
|
||||||
|
// automatically add the columns
|
||||||
|
$this->crud->column('name');
|
||||||
|
$this->crud->column('email');
|
||||||
|
$this->crud->column([
|
||||||
|
// two interconnected entities
|
||||||
|
'label' => trans('backpack::permissionmanager.user_role_permission'),
|
||||||
|
'field_unique_name' => 'user_role_permission',
|
||||||
|
'type' => 'checklist_dependency',
|
||||||
|
'name' => 'roles_permissions',
|
||||||
|
|
||||||
|
'subfields' => [
|
||||||
|
'primary' => [
|
||||||
|
'label' => trans('backpack::permissionmanager.role'),
|
||||||
|
'name' => 'roles', // the method that defines the relationship in your Model
|
||||||
|
'entity' => 'roles', // the method that defines the relationship in your Model
|
||||||
|
'entity_secondary' => 'permissions', // 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
|
||||||
|
],
|
||||||
|
'secondary' => [
|
||||||
|
'label' => mb_ucfirst(trans('backpack::permissionmanager.permission_singular')),
|
||||||
|
'name' => 'permissions', // the method that defines the relationship in your Model
|
||||||
|
'entity' => 'permissions', // the method that defines the relationship in your Model
|
||||||
|
'entity_primary' => 'roles', // 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,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
]);
|
||||||
|
$this->crud->column('created_at');
|
||||||
|
$this->crud->column('updated_at');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Store a newly created resource in the database.
|
||||||
|
*
|
||||||
|
* @return \Illuminate\Http\RedirectResponse
|
||||||
|
*/
|
||||||
|
public function store()
|
||||||
|
{
|
||||||
|
$this->crud->setRequest($this->crud->validateRequest());
|
||||||
|
$this->crud->setRequest($this->handlePasswordInput($this->crud->getRequest()));
|
||||||
|
$this->crud->unsetValidation(); // validation has already been run
|
||||||
|
|
||||||
|
return $this->traitStore();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update the specified resource in the database.
|
||||||
|
*
|
||||||
|
* @return \Illuminate\Http\RedirectResponse
|
||||||
|
*/
|
||||||
|
public function update()
|
||||||
|
{
|
||||||
|
$this->crud->setRequest($this->crud->validateRequest());
|
||||||
|
$this->crud->setRequest($this->handlePasswordInput($this->crud->getRequest()));
|
||||||
|
$this->crud->unsetValidation(); // validation has already been run
|
||||||
|
|
||||||
|
return $this->traitUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle password input fields.
|
||||||
|
*/
|
||||||
|
protected function handlePasswordInput($request)
|
||||||
|
{
|
||||||
|
// Remove fields not present on the user.
|
||||||
|
$request->request->remove('password_confirmation');
|
||||||
|
$request->request->remove('roles_show');
|
||||||
|
$request->request->remove('permissions_show');
|
||||||
|
|
||||||
|
// Encrypt password if specified.
|
||||||
|
if ($request->input('password')) {
|
||||||
|
$request->request->set('password', Hash::make($request->input('password')));
|
||||||
|
} else {
|
||||||
|
$request->request->remove('password');
|
||||||
|
}
|
||||||
|
|
||||||
|
return $request;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function addUserFields()
|
||||||
|
{
|
||||||
|
$this->crud->addFields([
|
||||||
|
[
|
||||||
|
'name' => 'name',
|
||||||
|
'label' => trans('backpack::permissionmanager.name'),
|
||||||
|
'type' => 'text',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'email',
|
||||||
|
'label' => trans('backpack::permissionmanager.email'),
|
||||||
|
'type' => 'email',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'password',
|
||||||
|
'label' => trans('backpack::permissionmanager.password'),
|
||||||
|
'type' => 'password',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'password_confirmation',
|
||||||
|
'label' => trans('backpack::permissionmanager.password_confirmation'),
|
||||||
|
'type' => 'password',
|
||||||
|
],
|
||||||
|
|
||||||
|
[
|
||||||
|
// two interconnected entities
|
||||||
|
'label' => trans('backpack::permissionmanager.user_role_permission'),
|
||||||
|
'field_unique_name' => 'user_role_permission',
|
||||||
|
'type' => 'checklist_dependency',
|
||||||
|
'name' => 'roles,permissions',
|
||||||
|
'subfields' => [
|
||||||
|
'primary' => [
|
||||||
|
'label' => trans('backpack::permissionmanager.roles'),
|
||||||
|
'name' => 'roles', // the method that defines the relationship in your Model
|
||||||
|
'entity' => 'roles', // the method that defines the relationship in your Model
|
||||||
|
'entity_secondary' => 'permissions', // 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
|
||||||
|
'pivot' => true, // on create&update, do you need to add/delete pivot table entries?]
|
||||||
|
'number_columns' => 3, //can be 1,2,3,4,6
|
||||||
|
],
|
||||||
|
'secondary' => [
|
||||||
|
'label' => mb_ucfirst(trans('backpack::permissionmanager.permission_plural')),
|
||||||
|
'name' => 'permissions', // the method that defines the relationship in your Model
|
||||||
|
'entity' => 'permissions', // the method that defines the relationship in your Model
|
||||||
|
'entity_primary' => 'roles', // 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
|
||||||
|
'pivot' => true, // on create&update, do you need to add/delete pivot table entries?]
|
||||||
|
'number_columns' => 3, //can be 1,2,3,4,6
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
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;
|
||||||
|
}
|
68
app/Http/Kernel.php
Normal file
68
app/Http/Kernel.php
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
<?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,
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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/DemoCatalogsRequest.php
Normal file
55
app/Http/Requests/DemoCatalogsRequest.php
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
|
|
||||||
|
class DemoCatalogsRequest 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/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 [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
96
app/Models/DemoCatalogs.php
Normal file
96
app/Models/DemoCatalogs.php
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Ericli1018\AwesomeFieldsForBackpack\Models\Traits\HasUploadImgFields;
|
||||||
|
use Backpack\CRUD\app\Models\Traits\CrudTrait;
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
|
|
||||||
|
class DemoCatalogs extends Model
|
||||||
|
{
|
||||||
|
use CrudTrait;
|
||||||
|
use HasFactory;
|
||||||
|
use HasUploadImgFields;
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| GLOBAL VARIABLES
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
protected $table = 'demo_catalogs';
|
||||||
|
// protected $primaryKey = 'id';
|
||||||
|
// public $timestamps = false;
|
||||||
|
protected $guarded = ['id'];
|
||||||
|
// protected $fillable = [];
|
||||||
|
// protected $hidden = [];
|
||||||
|
protected $casts = [
|
||||||
|
'photos' => 'array',
|
||||||
|
'text3' => 'array',
|
||||||
|
'text4' => 'datetime',
|
||||||
|
'text5' => 'datetime',
|
||||||
|
'text6' => 'datetime',
|
||||||
|
'text7' => 'datetime'
|
||||||
|
];
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| 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() : BelongsTo
|
||||||
|
{
|
||||||
|
return $this->belongsTo('App\Models\NewsCatalog', 'int1', 'id');
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| SCOPES
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| ACCESSORS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| MUTATORS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
public function setPhotosAttribute($value)
|
||||||
|
{
|
||||||
|
$attribute_name = "photos";
|
||||||
|
$disk = "public";
|
||||||
|
$destination_path = "demo_catalogs";
|
||||||
|
|
||||||
|
$this->uploadImgMultipleFilesToDisk($value, $attribute_name, $disk, $destination_path);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* for datetime picker
|
||||||
|
*/
|
||||||
|
public function setDatetimeAttribute($value) {
|
||||||
|
$this->attributes['datetime'] = \Carbon\Carbon::parse($value);
|
||||||
|
}
|
||||||
|
}
|
56
app/Models/News.php
Normal file
56
app/Models/News.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 News extends Model
|
||||||
|
{
|
||||||
|
use CrudTrait;
|
||||||
|
use HasFactory;
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| GLOBAL VARIABLES
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
protected $table = 'news';
|
||||||
|
// protected $primaryKey = 'id';
|
||||||
|
// public $timestamps = false;
|
||||||
|
protected $guarded = ['id'];
|
||||||
|
// protected $fillable = [];
|
||||||
|
// protected $hidden = [];
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| FUNCTIONS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| RELATIONS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| SCOPES
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| ACCESSORS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| MUTATORS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
}
|
59
app/Models/NewsCatalog.php
Normal file
59
app/Models/NewsCatalog.php
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Backpack\CRUD\app\Models\Traits\CrudTrait;
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class NewsCatalog extends Model
|
||||||
|
{
|
||||||
|
use CrudTrait;
|
||||||
|
use HasFactory;
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| GLOBAL VARIABLES
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
protected $table = 'news_catalogs';
|
||||||
|
// protected $primaryKey = 'id';
|
||||||
|
// public $timestamps = false;
|
||||||
|
protected $guarded = ['id'];
|
||||||
|
// protected $fillable = [];
|
||||||
|
// protected $hidden = [];
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| FUNCTIONS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| RELATIONS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
public function demo_catalogys()
|
||||||
|
{
|
||||||
|
return $this->hasMany('App\Models\DemoCatalogs', 'int1', 'id');
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| SCOPES
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| ACCESSORS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| MUTATORS
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
}
|
49
app/Models/User.php
Normal file
49
app/Models/User.php
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Backpack\CRUD\app\Models\Traits\CrudTrait;
|
||||||
|
use Spatie\Permission\Traits\HasRoles;
|
||||||
|
// 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;
|
||||||
|
|
||||||
|
class User extends Authenticatable
|
||||||
|
{
|
||||||
|
use CrudTrait;
|
||||||
|
use HasRoles;
|
||||||
|
use HasApiTokens, HasFactory, Notifiable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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',
|
||||||
|
];
|
||||||
|
}
|
28
app/Providers/AppServiceProvider.php
Normal file
28
app/Providers/AppServiceProvider.php
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Providers;
|
||||||
|
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
|
||||||
|
class AppServiceProvider extends ServiceProvider
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Register any application services.
|
||||||
|
*/
|
||||||
|
public function register(): void
|
||||||
|
{
|
||||||
|
$this->app->bind(
|
||||||
|
\Backpack\PermissionManager\app\Http\Controllers\UserCrudController::class, //this is package controller
|
||||||
|
\App\Http\Controllers\Admin\UserCrudController::class //this should be your own controller
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Bootstrap any application services.
|
||||||
|
*/
|
||||||
|
public function boot(): void
|
||||||
|
{
|
||||||
|
Schema::defaultStringLength(191);
|
||||||
|
}
|
||||||
|
}
|
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
|
106
composer.json
Normal file
106
composer.json
Normal file
@ -0,0 +1,106 @@
|
|||||||
|
{
|
||||||
|
"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.3",
|
||||||
|
"backpack/filemanager": "^3.0",
|
||||||
|
"backpack/permissionmanager": "^7.1",
|
||||||
|
"backpack/theme-tabler": "^1.1",
|
||||||
|
"consoletvs/charts": "6.*",
|
||||||
|
"guzzlehttp/guzzle": "^7.2",
|
||||||
|
"laravel/framework": "^10.10",
|
||||||
|
"laravel/sanctum": "^3.3",
|
||||||
|
"laravel/tinker": "^2.8",
|
||||||
|
"select2/select2": "^4.0"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"backpack/generators": "^4.0",
|
||||||
|
"fakerphp/faker": "^1.9.1",
|
||||||
|
"jeroen-g/laravel-packager": "^2.9",
|
||||||
|
"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",
|
||||||
|
"ericli1018/awesome-fields-for-backpack": "dev-main"
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"exclude-from-classmap": [
|
||||||
|
"vendor/backpack/crud/src/helpers.php",
|
||||||
|
"vendor/backpack/crud/src/app/Http/Controllers/ChartController.php",
|
||||||
|
"vendor/backpack/crud/src/app/Http/Controllers/Operations/BulkCloneOperation.php",
|
||||||
|
"vendor/backpack/crud/src/app/Http/Controllers/Operations/BulkDeleteOperation.php",
|
||||||
|
"vendor/backpack/crud/src/app/Http/Controllers/Operations/CloneOperation.php",
|
||||||
|
"vendor/backpack/crud/src/app/Http/Controllers/Operations/FetchOperation.php",
|
||||||
|
"vendor/backpack/crud/src/app/Http/Controllers/Operations/InlineCreateOperation.php"
|
||||||
|
],
|
||||||
|
"files": [
|
||||||
|
"vendor/ericli1018/awesome-fields-for-backpack/src/helpers.php",
|
||||||
|
"vendor/ericli1018/awesome-fields-for-backpack/src/Http/Controllers/ChartController.php",
|
||||||
|
"vendor/ericli1018/awesome-fields-for-backpack/src/Http/Controllers/Operations/BulkCloneOperation.php",
|
||||||
|
"vendor/ericli1018/awesome-fields-for-backpack/src/Http/Controllers/Operations/BulkDeleteOperation.php",
|
||||||
|
"vendor/ericli1018/awesome-fields-for-backpack/src/Http/Controllers/Operations/CloneOperation.php",
|
||||||
|
"vendor/ericli1018/awesome-fields-for-backpack/src/Http/Controllers/Operations/FetchOperation.php",
|
||||||
|
"vendor/ericli1018/awesome-fields-for-backpack/src/Http/Controllers/Operations/InlineCreateOperation.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,
|
||||||
|
"repositories": {
|
||||||
|
"ericli1018/awesome-fields-for-backpack": {
|
||||||
|
"type": "path",
|
||||||
|
"url": "/var/www/html/backpackforlaravel.local/packages/ericli1018/awesome-fields-for-backpack",
|
||||||
|
"options": {
|
||||||
|
"symlink": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
10471
composer.lock
generated
Normal file
10471
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' => 'zh_TW',
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| 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' => 'zh_TW',
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| 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' => 'zh_TW',
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| 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,
|
||||||
|
|
||||||
|
];
|
183
config/backpack/base.php
Normal file
183
config/backpack/base.php
Normal file
@ -0,0 +1,183 @@
|
|||||||
|
<?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' => false,
|
||||||
|
|
||||||
|
// 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\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',
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| 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),
|
||||||
|
];
|
480
config/backpack/crud.php
Normal file
480
config/backpack/crud.php
Normal file
@ -0,0 +1,480 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Backpack\CRUD preferences.
|
||||||
|
*/
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
/*
|
||||||
|
|-------------------
|
||||||
|
| TRANSLATABLE CRUDS
|
||||||
|
|-------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
'show_translatable_field_icon' => true,
|
||||||
|
'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" => "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,
|
||||||
|
|
||||||
|
];
|
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,
|
||||||
|
];
|
13
config/backpack/operations/reorder.php
Normal file
13
config/backpack/operations/reorder.php
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configurations for Backpack's 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',
|
||||||
|
];
|
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
|
||||||
|
];
|
42
config/backpack/operations/update.php
Normal file
42
config/backpack/operations/update.php
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configurations for Backpack's UpdateOperation.
|
||||||
|
*
|
||||||
|
* @see https://backpackforlaravel.com/docs/crud-operation-update
|
||||||
|
*/
|
||||||
|
|
||||||
|
return [
|
||||||
|
// Define the size/looks of the content div for all CRUDs
|
||||||
|
// To override per view use $this->crud->setEditContentClass('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,
|
||||||
|
];
|
48
config/backpack/permissionmanager.php
Normal file
48
config/backpack/permissionmanager.php
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Models
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Models used in the User, Role and Permission CRUDs.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'models' => [
|
||||||
|
'user' => config('backpack.base.user_model_fqn', \App\Models\User::class),
|
||||||
|
'permission' => Backpack\PermissionManager\app\Models\Permission::class,
|
||||||
|
'role' => Backpack\PermissionManager\app\Models\Role::class,
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Disallow the user interface for creating/updating permissions or roles.
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Roles and permissions are used in code by their name
|
||||||
|
| - ex: $user->hasPermissionTo('edit articles');
|
||||||
|
|
|
||||||
|
| So after the developer has entered all permissions and roles, the administrator should either:
|
||||||
|
| - not have access to the panels
|
||||||
|
| or
|
||||||
|
| - creating and updating should be disabled
|
||||||
|
*/
|
||||||
|
|
||||||
|
'allow_permission_create' => true,
|
||||||
|
'allow_permission_update' => true,
|
||||||
|
'allow_permission_delete' => true,
|
||||||
|
'allow_role_create' => true,
|
||||||
|
'allow_role_update' => true,
|
||||||
|
'allow_role_delete' => true,
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Multiple-guards functionality
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
'multiple_guards' => false,
|
||||||
|
|
||||||
|
];
|
169
config/backpack/theme-tabler.php
Normal file
169
config/backpack/theme-tabler.php
Normal file
@ -0,0 +1,169 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Theme Configuration Values
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| The file provides extra configs on top of config/backpack/ui.php
|
||||||
|
|
|
||||||
|
| Any value set here will override the ones defined in
|
||||||
|
| config/backpack/ui.php when this theme is in use.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1st layer of customization
|
||||||
|
*
|
||||||
|
* Simple pick a layout and let Backpack decide the best look for it.
|
||||||
|
* No extra step is required.
|
||||||
|
*
|
||||||
|
* Possible values: horizontal, horizontal_dark, horizontal_overlap, vertical,
|
||||||
|
* vertical_dark, vertical_transparent (legacy theme), right_vertical, right_vertical_dark, right_vertical_transparent
|
||||||
|
*/
|
||||||
|
'layout' => 'vertical',
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Pick a login page layout.
|
||||||
|
* Possible values: default, illustration, cover
|
||||||
|
*/
|
||||||
|
'auth_layout' => 'default', // default, illustration, cover
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Here you can easily load your own extra css styles.
|
||||||
|
* Note: if you want to customize the style to create your own custom skin colors:
|
||||||
|
* - make a copy of the file "vendor/backpack/theme-tabler/resources/assets/css/colors.css" into your project
|
||||||
|
* - adjust colors variables as you wish
|
||||||
|
* - replace "base_path('vendor/backpack/theme-tabler/resources/assets/css/colors.css')," with the path to the file created above
|
||||||
|
* - boom!
|
||||||
|
*/
|
||||||
|
'styles' => [
|
||||||
|
base_path('vendor/backpack/theme-tabler/resources/assets/css/color-adjustments.css'),
|
||||||
|
base_path('vendor/backpack/theme-tabler/resources/assets/css/colors.css'),
|
||||||
|
],
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 2nd Layer of customization
|
||||||
|
*
|
||||||
|
* If you need to further customize the way your panel looks,
|
||||||
|
* these options will help you achieve that.
|
||||||
|
*/
|
||||||
|
'options' => [
|
||||||
|
/**
|
||||||
|
* The available color modes.
|
||||||
|
*/
|
||||||
|
'colorModes' => [
|
||||||
|
'system' => 'la-desktop',
|
||||||
|
'light' => 'la-sun',
|
||||||
|
'dark' => 'la-moon',
|
||||||
|
],
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The color mode used by default.
|
||||||
|
*/
|
||||||
|
'defaultColorMode' => 'system', // system, light, dark
|
||||||
|
|
||||||
|
/**
|
||||||
|
* When true, a switch is displayed to let admins choose their favorite theme mode.
|
||||||
|
* When false, the theme will only use the "defaultColorMode" set above.
|
||||||
|
* In case "defaultColorMode" is null, system is the default.
|
||||||
|
*/
|
||||||
|
'showColorModeSwitcher' => true,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fix the top-header component (present in "vertical_transparent") and the menu when the layout type is set as "horizontal".
|
||||||
|
* This value is skipped when the layout type is horizontal-overlap, using false as default.
|
||||||
|
*/
|
||||||
|
'useStickyHeader' => false,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* When true, the content area will take the whole screen width.
|
||||||
|
*/
|
||||||
|
'useFluidContainers' => false,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* When true, the sidebar content for vertical layouts will not scroll with the rest of the content.
|
||||||
|
*/
|
||||||
|
'sidebarFixed' => false,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* When true, horizontal layouts will display the classic top bar on top to free some space when multiple nav items are used.
|
||||||
|
*/
|
||||||
|
'doubleTopBarInHorizontalLayouts' => false,
|
||||||
|
],
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 3rd Layer of customization
|
||||||
|
*
|
||||||
|
* In case the first two steps were not enough, here you have full control over
|
||||||
|
* the classes that make up the look of your panel.
|
||||||
|
*/
|
||||||
|
'classes' => [
|
||||||
|
/**
|
||||||
|
* Use this to pass classes to the <body> HTML element, on all pages.
|
||||||
|
*/
|
||||||
|
'body' => null,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* For background colors use:
|
||||||
|
* bg-dark, bg-primary, bg-secondary, bg-danger, bg-warning, bg-success, bg-info, bg-blue, bg-light-blue,
|
||||||
|
* bg-indigo, bg-purple, bg-pink, bg-red, bg-orange, bg-yellow, bg-green, bg-teal, bg-cyan, bg-white.
|
||||||
|
*
|
||||||
|
* For links to be visible on different background colors use: "navbar-dark", "navbar-light".
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
'topHeader' => null,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Applies only for Vertical Menu Layout
|
||||||
|
* For standard sidebar look (transparent):
|
||||||
|
* - Remove "navbar-dark/light"
|
||||||
|
* - Remove "navbar-light/dark" from 'classes.topHeader' and instead use "bg-light"
|
||||||
|
* You can also add a background class like bg-dark, bg-primary, bg-secondary, bg-danger, bg-warning, bg-success,
|
||||||
|
* bg-info, bg-blue, bg-light-blue, bg-indigo, bg-purple, bg-pink, bg-red, bg-orange, bg-yellow, bg-green, bg-teal, bg-cyan
|
||||||
|
*/
|
||||||
|
'sidebar' => null,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Used in the top container menu when the layout is of horizontal type.
|
||||||
|
*/
|
||||||
|
'menuHorizontalContainer' => null,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Used in the top menu content when the layout is of horizontal type.
|
||||||
|
*/
|
||||||
|
'menuHorizontalContent' => null,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Make transparent with footer-transparent.
|
||||||
|
* Hide it with d-none.
|
||||||
|
*
|
||||||
|
* Change background color with bg-dark, bg-primary, bg-secondary, bg-danger, bg-warning, bg-success, bg-info,
|
||||||
|
* bg-blue, bg-light-blue, bg-indigo, bg-purple, bg-pink, bg-red, bg-orange, bg-yellow, bg-green, bg-teal, bg-cyan, bg-white.
|
||||||
|
*/
|
||||||
|
'footer' => null,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Use this to pass classes to the table displayed in List Operation
|
||||||
|
* It defaults to: "table table-striped table-hover nowrap rounded card-table table-vcenter card-table shadow-xs border-xs"
|
||||||
|
*/
|
||||||
|
'table' => null,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Use this to pass classes to the table wrapper component displayed in List Operation
|
||||||
|
*/
|
||||||
|
'tableWrapper' => null,
|
||||||
|
],
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 4th Layer of customization
|
||||||
|
*
|
||||||
|
* Alright, if nothing so far met your need, then you still have an easy way to build
|
||||||
|
* a custom layout using the already existing components of this theme.
|
||||||
|
*
|
||||||
|
* 1. Create a new blade file in resources/views/layouts/your-custom-layout.blade.php
|
||||||
|
* 2. Replace the value of layout on this file with "your-custom-layout"
|
||||||
|
* 3. Customize the blade and place components such as sidebar, header, top-bar, where you need them!
|
||||||
|
*/
|
||||||
|
];
|
147
config/backpack/ui.php
Normal file
147
config/backpack/ui.php
Normal file
@ -0,0 +1,147 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
// IMPORTANT NOTE: The configurations here get overriden by theme config files.
|
||||||
|
//
|
||||||
|
// Eg. If you're using theme-tabler and config/backpack/theme-tabler.php
|
||||||
|
// has "breadcrumbs" set as false, then THAT value will be used instead
|
||||||
|
// of the value in this file.
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Theme (User Interface)
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
// Change the view namespace in order to load a different theme than the one Backpack provides.
|
||||||
|
// You can create child themes yourself, by creating a view folder anywhere in your resources/views
|
||||||
|
// and choosing that view_namespace instead of the default one. Backpack will load a file from there
|
||||||
|
// if it exists, otherwise it will load it from the fallback namespace.
|
||||||
|
|
||||||
|
'view_namespace' => 'backpack.theme-tabler::',
|
||||||
|
'view_namespace_fallback' => 'backpack.theme-tabler::',
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Look & feel customizations
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| To make the UI feel yours.
|
||||||
|
|
|
||||||
|
| Note that values set here might be overriden by theme config files
|
||||||
|
| (eg. config/backpack/theme-tabler.php) when that theme is in use.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Date & Datetime Format Syntax: https://carbon.nesbot.com/docs/#api-localization
|
||||||
|
'default_date_format' => 'D MMM YYYY',
|
||||||
|
'default_datetime_format' => 'D MMM YYYY, HH:mm',
|
||||||
|
|
||||||
|
// Direction, according to language
|
||||||
|
// (left-to-right vs right-to-left)
|
||||||
|
'html_direction' => 'ltr',
|
||||||
|
|
||||||
|
// ----
|
||||||
|
// HEAD
|
||||||
|
// ----
|
||||||
|
|
||||||
|
// Project name - shown in the window title
|
||||||
|
'project_name' => '測試',
|
||||||
|
|
||||||
|
// Content of the HTML meta robots tag to prevent indexing and link following
|
||||||
|
'meta_robots_content' => 'noindex, nofollow',
|
||||||
|
|
||||||
|
// ------
|
||||||
|
// HEADER
|
||||||
|
// ------
|
||||||
|
|
||||||
|
// When clicking on the admin panel's top-left logo/name,
|
||||||
|
// where should the user be redirected?
|
||||||
|
// The string below will be passed through the url() helper.
|
||||||
|
// - default: '' (project root)
|
||||||
|
// - alternative: 'admin' (the admin's dashboard)
|
||||||
|
'home_link' => '',
|
||||||
|
|
||||||
|
// Menu logo. You can replace this with an <img> tag if you have a logo.
|
||||||
|
'project_logo' => '<b>測試</b>',
|
||||||
|
|
||||||
|
// Show / hide breadcrumbs on admin panel pages.
|
||||||
|
'breadcrumbs' => true,
|
||||||
|
|
||||||
|
// ------
|
||||||
|
// FOOTER
|
||||||
|
// ------
|
||||||
|
|
||||||
|
// Developer or company name. Shown in footer.
|
||||||
|
'developer_name' => '歐森資訊科技有限公司',
|
||||||
|
|
||||||
|
// Developer website. Link in footer. Type false if you want to hide it.
|
||||||
|
'developer_link' => 'https://www.awesome-tech.com.tw/',
|
||||||
|
|
||||||
|
// Show powered by Laravel Backpack in the footer? true/false
|
||||||
|
'show_powered_by' => false,
|
||||||
|
|
||||||
|
// ---------
|
||||||
|
// DASHBOARD
|
||||||
|
// ---------
|
||||||
|
|
||||||
|
// Show "Getting Started with Backpack" info block?
|
||||||
|
'show_getting_started' => env('APP_ENV') == 'local',
|
||||||
|
|
||||||
|
// -------------
|
||||||
|
// GLOBAL STYLES
|
||||||
|
// -------------
|
||||||
|
|
||||||
|
// CSS files that are loaded in all pages, using Laravel's asset() helper
|
||||||
|
'styles' => [
|
||||||
|
// 'styles/example.css',
|
||||||
|
// 'https://some-cdn.com/example.css',
|
||||||
|
],
|
||||||
|
|
||||||
|
// CSS files that are loaded in all pages, using Laravel's mix() helper
|
||||||
|
'mix_styles' => [ // file_path => manifest_directory_path
|
||||||
|
// 'css/app.css' => '',
|
||||||
|
],
|
||||||
|
|
||||||
|
// CSS files that are loaded in all pages, using Laravel's @vite() helper
|
||||||
|
// Please note that support for Vite was added in Laravel 9.19. Earlier versions are not able to use this feature.
|
||||||
|
'vite_styles' => [ // resource file_path
|
||||||
|
// 'resources/css/app.css',
|
||||||
|
],
|
||||||
|
|
||||||
|
// --------------
|
||||||
|
// GLOBAL SCRIPTS
|
||||||
|
// --------------
|
||||||
|
|
||||||
|
// JS files that are loaded in all pages, using Laravel's asset() helper
|
||||||
|
'scripts' => [
|
||||||
|
// 'js/example.js',
|
||||||
|
// 'https://unpkg.com/vue@2.4.4/dist/vue.min.js',
|
||||||
|
// 'https://unpkg.com/react@16/umd/react.production.min.js',
|
||||||
|
// 'https://unpkg.com/react-dom@16/umd/react-dom.production.min.js',
|
||||||
|
],
|
||||||
|
|
||||||
|
// JS files that are loaded in all pages, using Laravel's mix() helper
|
||||||
|
'mix_scripts' => [ // file_path => manifest_directory_path
|
||||||
|
// 'js/app.js' => '',
|
||||||
|
],
|
||||||
|
|
||||||
|
// JS files that are loaded in all pages, using Laravel's @vite() helper
|
||||||
|
'vite_scripts' => [ // resource file_path
|
||||||
|
// 'resources/js/app.js',
|
||||||
|
],
|
||||||
|
|
||||||
|
'classes' => [
|
||||||
|
/**
|
||||||
|
* Use this as fallback config for themes to pass classes to the table displayed in List Operation
|
||||||
|
* It defaults to: "table table-striped table-hover nowrap rounded card-table table-vcenter card-table shadow-xs border-xs".
|
||||||
|
*/
|
||||||
|
'table' => null,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Use this as fallback config for themes to pass classes to the table wrapper component displayed in List Operation.
|
||||||
|
*/
|
||||||
|
'tableWrapper' => null,
|
||||||
|
],
|
||||||
|
|
||||||
|
];
|
71
config/broadcasting.php
Normal file
71
config/broadcasting.php
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Default Broadcaster
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| This option controls the default broadcaster that will be used by the
|
||||||
|
| framework when an event needs to be broadcast. You may set this to
|
||||||
|
| any of the connections defined in the "connections" array below.
|
||||||
|
|
|
||||||
|
| Supported: "pusher", "ably", "redis", "log", "null"
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'default' => env('BROADCAST_DRIVER', 'null'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Broadcast Connections
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Here you may define all of the broadcast connections that will be used
|
||||||
|
| to broadcast events to other systems or over websockets. Samples of
|
||||||
|
| each available type of connection are provided inside this array.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'connections' => [
|
||||||
|
|
||||||
|
'pusher' => [
|
||||||
|
'driver' => 'pusher',
|
||||||
|
'key' => env('PUSHER_APP_KEY'),
|
||||||
|
'secret' => env('PUSHER_APP_SECRET'),
|
||||||
|
'app_id' => env('PUSHER_APP_ID'),
|
||||||
|
'options' => [
|
||||||
|
'cluster' => env('PUSHER_APP_CLUSTER'),
|
||||||
|
'host' => env('PUSHER_HOST') ?: 'api-'.env('PUSHER_APP_CLUSTER', 'mt1').'.pusher.com',
|
||||||
|
'port' => env('PUSHER_PORT', 443),
|
||||||
|
'scheme' => env('PUSHER_SCHEME', 'https'),
|
||||||
|
'encrypted' => true,
|
||||||
|
'useTLS' => env('PUSHER_SCHEME', 'https') === 'https',
|
||||||
|
],
|
||||||
|
'client_options' => [
|
||||||
|
// Guzzle client options: https://docs.guzzlephp.org/en/stable/request-options.html
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
'ably' => [
|
||||||
|
'driver' => 'ably',
|
||||||
|
'key' => env('ABLY_KEY'),
|
||||||
|
],
|
||||||
|
|
||||||
|
'redis' => [
|
||||||
|
'driver' => 'redis',
|
||||||
|
'connection' => 'default',
|
||||||
|
],
|
||||||
|
|
||||||
|
'log' => [
|
||||||
|
'driver' => 'log',
|
||||||
|
],
|
||||||
|
|
||||||
|
'null' => [
|
||||||
|
'driver' => 'null',
|
||||||
|
],
|
||||||
|
|
||||||
|
],
|
||||||
|
|
||||||
|
];
|
111
config/cache.php
Normal file
111
config/cache.php
Normal file
@ -0,0 +1,111 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Default Cache Store
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| This option controls the default cache connection that gets used while
|
||||||
|
| using this caching library. This connection is used when another is
|
||||||
|
| not explicitly specified when executing a given caching function.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'default' => env('CACHE_DRIVER', 'file'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Cache Stores
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Here you may define all of the cache "stores" for your application as
|
||||||
|
| well as their drivers. You may even define multiple stores for the
|
||||||
|
| same cache driver to group types of items stored in your caches.
|
||||||
|
|
|
||||||
|
| Supported drivers: "apc", "array", "database", "file",
|
||||||
|
| "memcached", "redis", "dynamodb", "octane", "null"
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'stores' => [
|
||||||
|
|
||||||
|
'apc' => [
|
||||||
|
'driver' => 'apc',
|
||||||
|
],
|
||||||
|
|
||||||
|
'array' => [
|
||||||
|
'driver' => 'array',
|
||||||
|
'serialize' => false,
|
||||||
|
],
|
||||||
|
|
||||||
|
'database' => [
|
||||||
|
'driver' => 'database',
|
||||||
|
'table' => 'cache',
|
||||||
|
'connection' => null,
|
||||||
|
'lock_connection' => null,
|
||||||
|
],
|
||||||
|
|
||||||
|
'file' => [
|
||||||
|
'driver' => 'file',
|
||||||
|
'path' => storage_path('framework/cache/data'),
|
||||||
|
'lock_path' => storage_path('framework/cache/data'),
|
||||||
|
],
|
||||||
|
|
||||||
|
'memcached' => [
|
||||||
|
'driver' => 'memcached',
|
||||||
|
'persistent_id' => env('MEMCACHED_PERSISTENT_ID'),
|
||||||
|
'sasl' => [
|
||||||
|
env('MEMCACHED_USERNAME'),
|
||||||
|
env('MEMCACHED_PASSWORD'),
|
||||||
|
],
|
||||||
|
'options' => [
|
||||||
|
// Memcached::OPT_CONNECT_TIMEOUT => 2000,
|
||||||
|
],
|
||||||
|
'servers' => [
|
||||||
|
[
|
||||||
|
'host' => env('MEMCACHED_HOST', '127.0.0.1'),
|
||||||
|
'port' => env('MEMCACHED_PORT', 11211),
|
||||||
|
'weight' => 100,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
'redis' => [
|
||||||
|
'driver' => 'redis',
|
||||||
|
'connection' => 'cache',
|
||||||
|
'lock_connection' => 'default',
|
||||||
|
],
|
||||||
|
|
||||||
|
'dynamodb' => [
|
||||||
|
'driver' => 'dynamodb',
|
||||||
|
'key' => env('AWS_ACCESS_KEY_ID'),
|
||||||
|
'secret' => env('AWS_SECRET_ACCESS_KEY'),
|
||||||
|
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
|
||||||
|
'table' => env('DYNAMODB_CACHE_TABLE', 'cache'),
|
||||||
|
'endpoint' => env('DYNAMODB_ENDPOINT'),
|
||||||
|
],
|
||||||
|
|
||||||
|
'octane' => [
|
||||||
|
'driver' => 'octane',
|
||||||
|
],
|
||||||
|
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Cache Key Prefix
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| When utilizing the APC, database, memcached, Redis, or DynamoDB cache
|
||||||
|
| stores there might be other applications using the same cache. For
|
||||||
|
| that reason, you may prefix every cache key to avoid collisions.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache_'),
|
||||||
|
|
||||||
|
];
|
34
config/cors.php
Normal file
34
config/cors.php
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Cross-Origin Resource Sharing (CORS) Configuration
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Here you may configure your settings for cross-origin resource sharing
|
||||||
|
| or "CORS". This determines what cross-origin operations may execute
|
||||||
|
| in web browsers. You are free to adjust these settings as needed.
|
||||||
|
|
|
||||||
|
| To learn more: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'paths' => ['api/*', 'sanctum/csrf-cookie'],
|
||||||
|
|
||||||
|
'allowed_methods' => ['*'],
|
||||||
|
|
||||||
|
'allowed_origins' => ['*'],
|
||||||
|
|
||||||
|
'allowed_origins_patterns' => [],
|
||||||
|
|
||||||
|
'allowed_headers' => ['*'],
|
||||||
|
|
||||||
|
'exposed_headers' => [],
|
||||||
|
|
||||||
|
'max_age' => 0,
|
||||||
|
|
||||||
|
'supports_credentials' => false,
|
||||||
|
|
||||||
|
];
|
151
config/database.php
Normal file
151
config/database.php
Normal file
@ -0,0 +1,151 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Default Database Connection Name
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Here you may specify which of the database connections below you wish
|
||||||
|
| to use as your default connection for all database work. Of course
|
||||||
|
| you may use many connections at once using the Database library.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'default' => env('DB_CONNECTION', 'mysql'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Database Connections
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Here are each of the database connections setup for your application.
|
||||||
|
| Of course, examples of configuring each database platform that is
|
||||||
|
| supported by Laravel is shown below to make development simple.
|
||||||
|
|
|
||||||
|
|
|
||||||
|
| All database work in Laravel is done through the PHP PDO facilities
|
||||||
|
| so make sure you have the driver for your particular database of
|
||||||
|
| choice installed on your machine before you begin development.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'connections' => [
|
||||||
|
|
||||||
|
'sqlite' => [
|
||||||
|
'driver' => 'sqlite',
|
||||||
|
'url' => env('DATABASE_URL'),
|
||||||
|
'database' => env('DB_DATABASE', database_path('database.sqlite')),
|
||||||
|
'prefix' => '',
|
||||||
|
'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
|
||||||
|
],
|
||||||
|
|
||||||
|
'mysql' => [
|
||||||
|
'driver' => 'mysql',
|
||||||
|
'url' => env('DATABASE_URL'),
|
||||||
|
'host' => env('DB_HOST', '127.0.0.1'),
|
||||||
|
'port' => env('DB_PORT', '3306'),
|
||||||
|
'database' => env('DB_DATABASE', 'forge'),
|
||||||
|
'username' => env('DB_USERNAME', 'forge'),
|
||||||
|
'password' => env('DB_PASSWORD', ''),
|
||||||
|
'unix_socket' => env('DB_SOCKET', ''),
|
||||||
|
'charset' => 'utf8mb4',
|
||||||
|
'collation' => 'utf8mb4_unicode_ci',
|
||||||
|
'prefix' => '',
|
||||||
|
'prefix_indexes' => true,
|
||||||
|
'strict' => true,
|
||||||
|
'engine' => null,
|
||||||
|
'options' => extension_loaded('pdo_mysql') ? array_filter([
|
||||||
|
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
|
||||||
|
]) : [],
|
||||||
|
],
|
||||||
|
|
||||||
|
'pgsql' => [
|
||||||
|
'driver' => 'pgsql',
|
||||||
|
'url' => env('DATABASE_URL'),
|
||||||
|
'host' => env('DB_HOST', '127.0.0.1'),
|
||||||
|
'port' => env('DB_PORT', '5432'),
|
||||||
|
'database' => env('DB_DATABASE', 'forge'),
|
||||||
|
'username' => env('DB_USERNAME', 'forge'),
|
||||||
|
'password' => env('DB_PASSWORD', ''),
|
||||||
|
'charset' => 'utf8',
|
||||||
|
'prefix' => '',
|
||||||
|
'prefix_indexes' => true,
|
||||||
|
'search_path' => 'public',
|
||||||
|
'sslmode' => 'prefer',
|
||||||
|
],
|
||||||
|
|
||||||
|
'sqlsrv' => [
|
||||||
|
'driver' => 'sqlsrv',
|
||||||
|
'url' => env('DATABASE_URL'),
|
||||||
|
'host' => env('DB_HOST', 'localhost'),
|
||||||
|
'port' => env('DB_PORT', '1433'),
|
||||||
|
'database' => env('DB_DATABASE', 'forge'),
|
||||||
|
'username' => env('DB_USERNAME', 'forge'),
|
||||||
|
'password' => env('DB_PASSWORD', ''),
|
||||||
|
'charset' => 'utf8',
|
||||||
|
'prefix' => '',
|
||||||
|
'prefix_indexes' => true,
|
||||||
|
// 'encrypt' => env('DB_ENCRYPT', 'yes'),
|
||||||
|
// 'trust_server_certificate' => env('DB_TRUST_SERVER_CERTIFICATE', 'false'),
|
||||||
|
],
|
||||||
|
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Migration Repository Table
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| This table keeps track of all the migrations that have already run for
|
||||||
|
| your application. Using this information, we can determine which of
|
||||||
|
| the migrations on disk haven't actually been run in the database.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'migrations' => 'migrations',
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Redis Databases
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Redis is an open source, fast, and advanced key-value store that also
|
||||||
|
| provides a richer body of commands than a typical key-value system
|
||||||
|
| such as APC or Memcached. Laravel makes it easy to dig right in.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'redis' => [
|
||||||
|
|
||||||
|
'client' => env('REDIS_CLIENT', 'phpredis'),
|
||||||
|
|
||||||
|
'options' => [
|
||||||
|
'cluster' => env('REDIS_CLUSTER', 'redis'),
|
||||||
|
'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),
|
||||||
|
],
|
||||||
|
|
||||||
|
'default' => [
|
||||||
|
'url' => env('REDIS_URL'),
|
||||||
|
'host' => env('REDIS_HOST', '127.0.0.1'),
|
||||||
|
'username' => env('REDIS_USERNAME'),
|
||||||
|
'password' => env('REDIS_PASSWORD'),
|
||||||
|
'port' => env('REDIS_PORT', '6379'),
|
||||||
|
'database' => env('REDIS_DB', '0'),
|
||||||
|
],
|
||||||
|
|
||||||
|
'cache' => [
|
||||||
|
'url' => env('REDIS_URL'),
|
||||||
|
'host' => env('REDIS_HOST', '127.0.0.1'),
|
||||||
|
'username' => env('REDIS_USERNAME'),
|
||||||
|
'password' => env('REDIS_PASSWORD'),
|
||||||
|
'port' => env('REDIS_PORT', '6379'),
|
||||||
|
'database' => env('REDIS_CACHE_DB', '1'),
|
||||||
|
],
|
||||||
|
|
||||||
|
],
|
||||||
|
|
||||||
|
];
|
93
config/elfinder.php
Normal file
93
config/elfinder.php
Normal file
@ -0,0 +1,93 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Upload dir
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| The dir where to store the images (relative from public).
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
'dir' => ['uploads'],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Filesystem disks (Flysytem)
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Define an array of Filesystem disks, which use Flysystem.
|
||||||
|
| You can set extra options, example:
|
||||||
|
|
|
||||||
|
| 'my-disk' => [
|
||||||
|
| 'URL' => url('to/disk'),
|
||||||
|
| 'alias' => 'Local storage',
|
||||||
|
| ]
|
||||||
|
*/
|
||||||
|
'disks' => [
|
||||||
|
// 'uploads',
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Routes group config
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| The default group settings for the elFinder routes.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'route' => [
|
||||||
|
'prefix' => config('backpack.base.route_prefix', 'admin').'/elfinder',
|
||||||
|
'middleware' => ['web', config('backpack.base.middleware_key', 'admin')], //Set to null to disable middleware filter
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Access filter
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Filter callback to check the files
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'access' => 'Barryvdh\Elfinder\Elfinder::checkAccess',
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Roots
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| By default, the roots file is LocalFileSystem, with the above public dir.
|
||||||
|
| If you want custom options, you can set your own roots below.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'roots' => null,
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Options
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| These options are merged, together with 'roots' and passed to the Connector.
|
||||||
|
| See https://github.com/Studio-42/elFinder/wiki/Connector-configuration-options-2.1
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'options' => [],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Root Options
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| These options are merged, together with every root by default.
|
||||||
|
| See https://github.com/Studio-42/elFinder/wiki/Connector-configuration-options-2.1#root-options
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
'root_options' => [
|
||||||
|
|
||||||
|
],
|
||||||
|
];
|
76
config/filesystems.php
Normal file
76
config/filesystems.php
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Default Filesystem Disk
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Here you may specify the default filesystem disk that should be used
|
||||||
|
| by the framework. The "local" disk, as well as a variety of cloud
|
||||||
|
| based disks are available to your application. Just store away!
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'default' => env('FILESYSTEM_DISK', 'local'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Filesystem Disks
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Here you may configure as many filesystem "disks" as you wish, and you
|
||||||
|
| may even configure multiple disks of the same driver. Defaults have
|
||||||
|
| been set up for each driver as an example of the required values.
|
||||||
|
|
|
||||||
|
| Supported Drivers: "local", "ftp", "sftp", "s3"
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'disks' => [
|
||||||
|
|
||||||
|
'local' => [
|
||||||
|
'driver' => 'local',
|
||||||
|
'root' => storage_path('app'),
|
||||||
|
'throw' => false,
|
||||||
|
],
|
||||||
|
|
||||||
|
'public' => [
|
||||||
|
'driver' => 'local',
|
||||||
|
'root' => storage_path('app/public'),
|
||||||
|
'url' => env('APP_URL').'/storage',
|
||||||
|
'visibility' => 'public',
|
||||||
|
'throw' => false,
|
||||||
|
],
|
||||||
|
|
||||||
|
's3' => [
|
||||||
|
'driver' => 's3',
|
||||||
|
'key' => env('AWS_ACCESS_KEY_ID'),
|
||||||
|
'secret' => env('AWS_SECRET_ACCESS_KEY'),
|
||||||
|
'region' => env('AWS_DEFAULT_REGION'),
|
||||||
|
'bucket' => env('AWS_BUCKET'),
|
||||||
|
'url' => env('AWS_URL'),
|
||||||
|
'endpoint' => env('AWS_ENDPOINT'),
|
||||||
|
'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
|
||||||
|
'throw' => false,
|
||||||
|
],
|
||||||
|
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Symbolic Links
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Here you may configure the symbolic links that will be created when the
|
||||||
|
| `storage:link` Artisan command is executed. The array keys should be
|
||||||
|
| the locations of the links and the values should be their targets.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'links' => [
|
||||||
|
public_path('storage') => storage_path('app/public'),
|
||||||
|
],
|
||||||
|
|
||||||
|
];
|
34
config/gravatar.php
Normal file
34
config/gravatar.php
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
'default' => [
|
||||||
|
|
||||||
|
// By default, images are presented at 80px by 80px if no size parameter is supplied.
|
||||||
|
// You may request a specific image size, which will be dynamically delivered from Gravatar
|
||||||
|
// by passing a single pixel dimension (since the images are square):
|
||||||
|
'size' => 80,
|
||||||
|
|
||||||
|
// the fallback image, can be a string or a url
|
||||||
|
// for more info, visit: http://en.gravatar.com/site/implement/images/#default-image
|
||||||
|
'fallback' => 'mp',
|
||||||
|
|
||||||
|
// would you like to return a https://... image
|
||||||
|
'secure' => false,
|
||||||
|
|
||||||
|
// Gravatar allows users to self-rate their images so that they can indicate if an image
|
||||||
|
// is appropriate for a certain audience. By default, only 'G' rated images are displayed
|
||||||
|
// unless you indicate that you would like to see higher ratings.
|
||||||
|
// Available options:
|
||||||
|
// g: suitable for display on all websites with any audience type.
|
||||||
|
// pg: may contain rude gestures, provocatively dressed individuals, the lesser swear words, or mild violence.
|
||||||
|
// r: may contain such things as harsh profanity, intense violence, nudity, or hard drug use.
|
||||||
|
// x: may contain hardcore sexual imagery or extremely disturbing violence.
|
||||||
|
'maximumRating' => 'g',
|
||||||
|
|
||||||
|
// If for some reason you wanted to force the default image to always load, you can do that setting this to true
|
||||||
|
'forceDefault' => false,
|
||||||
|
|
||||||
|
// If you require a file-type extension (some places do) then you may also add an (optional) .jpg extension to that URL
|
||||||
|
'forceExtension' => 'jpg',
|
||||||
|
]
|
||||||
|
];
|
54
config/hashing.php
Normal file
54
config/hashing.php
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Default Hash Driver
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| This option controls the default hash driver that will be used to hash
|
||||||
|
| passwords for your application. By default, the bcrypt algorithm is
|
||||||
|
| used; however, you remain free to modify this option if you wish.
|
||||||
|
|
|
||||||
|
| Supported: "bcrypt", "argon", "argon2id"
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'driver' => 'bcrypt',
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Bcrypt Options
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Here you may specify the configuration options that should be used when
|
||||||
|
| passwords are hashed using the Bcrypt algorithm. This will allow you
|
||||||
|
| to control the amount of time it takes to hash the given password.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'bcrypt' => [
|
||||||
|
'rounds' => env('BCRYPT_ROUNDS', 12),
|
||||||
|
'verify' => true,
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Argon Options
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Here you may specify the configuration options that should be used when
|
||||||
|
| passwords are hashed using the Argon algorithm. These will allow you
|
||||||
|
| to control the amount of time it takes to hash the given password.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'argon' => [
|
||||||
|
'memory' => 65536,
|
||||||
|
'threads' => 1,
|
||||||
|
'time' => 4,
|
||||||
|
'verify' => true,
|
||||||
|
],
|
||||||
|
|
||||||
|
];
|
131
config/logging.php
Normal file
131
config/logging.php
Normal file
@ -0,0 +1,131 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Monolog\Handler\NullHandler;
|
||||||
|
use Monolog\Handler\StreamHandler;
|
||||||
|
use Monolog\Handler\SyslogUdpHandler;
|
||||||
|
use Monolog\Processor\PsrLogMessageProcessor;
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Default Log Channel
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| This option defines the default log channel that gets used when writing
|
||||||
|
| messages to the logs. The name specified in this option should match
|
||||||
|
| one of the channels defined in the "channels" configuration array.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'default' => env('LOG_CHANNEL', 'stack'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Deprecations Log Channel
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| This option controls the log channel that should be used to log warnings
|
||||||
|
| regarding deprecated PHP and library features. This allows you to get
|
||||||
|
| your application ready for upcoming major versions of dependencies.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'deprecations' => [
|
||||||
|
'channel' => env('LOG_DEPRECATIONS_CHANNEL', 'null'),
|
||||||
|
'trace' => false,
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Log Channels
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Here you may configure the log channels for your application. Out of
|
||||||
|
| the box, Laravel uses the Monolog PHP logging library. This gives
|
||||||
|
| you a variety of powerful log handlers / formatters to utilize.
|
||||||
|
|
|
||||||
|
| Available Drivers: "single", "daily", "slack", "syslog",
|
||||||
|
| "errorlog", "monolog",
|
||||||
|
| "custom", "stack"
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'channels' => [
|
||||||
|
'stack' => [
|
||||||
|
'driver' => 'stack',
|
||||||
|
'channels' => ['single'],
|
||||||
|
'ignore_exceptions' => false,
|
||||||
|
],
|
||||||
|
|
||||||
|
'single' => [
|
||||||
|
'driver' => 'single',
|
||||||
|
'path' => storage_path('logs/laravel.log'),
|
||||||
|
'level' => env('LOG_LEVEL', 'debug'),
|
||||||
|
'replace_placeholders' => true,
|
||||||
|
],
|
||||||
|
|
||||||
|
'daily' => [
|
||||||
|
'driver' => 'daily',
|
||||||
|
'path' => storage_path('logs/laravel.log'),
|
||||||
|
'level' => env('LOG_LEVEL', 'debug'),
|
||||||
|
'days' => 14,
|
||||||
|
'replace_placeholders' => true,
|
||||||
|
],
|
||||||
|
|
||||||
|
'slack' => [
|
||||||
|
'driver' => 'slack',
|
||||||
|
'url' => env('LOG_SLACK_WEBHOOK_URL'),
|
||||||
|
'username' => 'Laravel Log',
|
||||||
|
'emoji' => ':boom:',
|
||||||
|
'level' => env('LOG_LEVEL', 'critical'),
|
||||||
|
'replace_placeholders' => true,
|
||||||
|
],
|
||||||
|
|
||||||
|
'papertrail' => [
|
||||||
|
'driver' => 'monolog',
|
||||||
|
'level' => env('LOG_LEVEL', 'debug'),
|
||||||
|
'handler' => env('LOG_PAPERTRAIL_HANDLER', SyslogUdpHandler::class),
|
||||||
|
'handler_with' => [
|
||||||
|
'host' => env('PAPERTRAIL_URL'),
|
||||||
|
'port' => env('PAPERTRAIL_PORT'),
|
||||||
|
'connectionString' => 'tls://'.env('PAPERTRAIL_URL').':'.env('PAPERTRAIL_PORT'),
|
||||||
|
],
|
||||||
|
'processors' => [PsrLogMessageProcessor::class],
|
||||||
|
],
|
||||||
|
|
||||||
|
'stderr' => [
|
||||||
|
'driver' => 'monolog',
|
||||||
|
'level' => env('LOG_LEVEL', 'debug'),
|
||||||
|
'handler' => StreamHandler::class,
|
||||||
|
'formatter' => env('LOG_STDERR_FORMATTER'),
|
||||||
|
'with' => [
|
||||||
|
'stream' => 'php://stderr',
|
||||||
|
],
|
||||||
|
'processors' => [PsrLogMessageProcessor::class],
|
||||||
|
],
|
||||||
|
|
||||||
|
'syslog' => [
|
||||||
|
'driver' => 'syslog',
|
||||||
|
'level' => env('LOG_LEVEL', 'debug'),
|
||||||
|
'facility' => LOG_USER,
|
||||||
|
'replace_placeholders' => true,
|
||||||
|
],
|
||||||
|
|
||||||
|
'errorlog' => [
|
||||||
|
'driver' => 'errorlog',
|
||||||
|
'level' => env('LOG_LEVEL', 'debug'),
|
||||||
|
'replace_placeholders' => true,
|
||||||
|
],
|
||||||
|
|
||||||
|
'null' => [
|
||||||
|
'driver' => 'monolog',
|
||||||
|
'handler' => NullHandler::class,
|
||||||
|
],
|
||||||
|
|
||||||
|
'emergency' => [
|
||||||
|
'path' => storage_path('logs/laravel.log'),
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
];
|
126
config/mail.php
Normal file
126
config/mail.php
Normal file
@ -0,0 +1,126 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Default Mailer
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| This option controls the default mailer that is used to send any email
|
||||||
|
| messages sent by your application. Alternative mailers may be setup
|
||||||
|
| and used as needed; however, this mailer will be used by default.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'default' => env('MAIL_MAILER', 'smtp'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Mailer Configurations
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Here you may configure all of the mailers used by your application plus
|
||||||
|
| their respective settings. Several examples have been configured for
|
||||||
|
| you and you are free to add your own as your application requires.
|
||||||
|
|
|
||||||
|
| Laravel supports a variety of mail "transport" drivers to be used while
|
||||||
|
| sending an e-mail. You will specify which one you are using for your
|
||||||
|
| mailers below. You are free to add additional mailers as required.
|
||||||
|
|
|
||||||
|
| Supported: "smtp", "sendmail", "mailgun", "ses", "ses-v2",
|
||||||
|
| "postmark", "log", "array", "failover"
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'mailers' => [
|
||||||
|
'smtp' => [
|
||||||
|
'transport' => 'smtp',
|
||||||
|
'url' => env('MAIL_URL'),
|
||||||
|
'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
|
||||||
|
'port' => env('MAIL_PORT', 587),
|
||||||
|
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
|
||||||
|
'username' => env('MAIL_USERNAME'),
|
||||||
|
'password' => env('MAIL_PASSWORD'),
|
||||||
|
'timeout' => null,
|
||||||
|
'local_domain' => env('MAIL_EHLO_DOMAIN'),
|
||||||
|
],
|
||||||
|
|
||||||
|
'ses' => [
|
||||||
|
'transport' => 'ses',
|
||||||
|
],
|
||||||
|
|
||||||
|
'mailgun' => [
|
||||||
|
'transport' => 'mailgun',
|
||||||
|
// 'client' => [
|
||||||
|
// 'timeout' => 5,
|
||||||
|
// ],
|
||||||
|
],
|
||||||
|
|
||||||
|
'postmark' => [
|
||||||
|
'transport' => 'postmark',
|
||||||
|
// 'message_stream_id' => null,
|
||||||
|
// 'client' => [
|
||||||
|
// 'timeout' => 5,
|
||||||
|
// ],
|
||||||
|
],
|
||||||
|
|
||||||
|
'sendmail' => [
|
||||||
|
'transport' => 'sendmail',
|
||||||
|
'path' => env('MAIL_SENDMAIL_PATH', '/usr/sbin/sendmail -bs -i'),
|
||||||
|
],
|
||||||
|
|
||||||
|
'log' => [
|
||||||
|
'transport' => 'log',
|
||||||
|
'channel' => env('MAIL_LOG_CHANNEL'),
|
||||||
|
],
|
||||||
|
|
||||||
|
'array' => [
|
||||||
|
'transport' => 'array',
|
||||||
|
],
|
||||||
|
|
||||||
|
'failover' => [
|
||||||
|
'transport' => 'failover',
|
||||||
|
'mailers' => [
|
||||||
|
'smtp',
|
||||||
|
'log',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Global "From" Address
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| You may wish for all e-mails sent by your application to be sent from
|
||||||
|
| the same address. Here, you may specify a name and address that is
|
||||||
|
| used globally for all e-mails that are sent by your application.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'from' => [
|
||||||
|
'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
|
||||||
|
'name' => env('MAIL_FROM_NAME', 'Example'),
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Markdown Mail Settings
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| If you are using Markdown based email rendering, you may configure your
|
||||||
|
| theme and component paths here, allowing you to customize the design
|
||||||
|
| of the emails. Or, you may simply stick with the Laravel defaults!
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'markdown' => [
|
||||||
|
'theme' => 'default',
|
||||||
|
|
||||||
|
'paths' => [
|
||||||
|
resource_path('views/vendor/mail'),
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
];
|
161
config/permission.php
Normal file
161
config/permission.php
Normal file
@ -0,0 +1,161 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
'models' => [
|
||||||
|
|
||||||
|
/*
|
||||||
|
* When using the "HasPermissions" trait from this package, we need to know which
|
||||||
|
* Eloquent model should be used to retrieve your permissions. Of course, it
|
||||||
|
* is often just the "Permission" model but you may use whatever you like.
|
||||||
|
*
|
||||||
|
* The model you want to use as a Permission model needs to implement the
|
||||||
|
* `Spatie\Permission\Contracts\Permission` contract.
|
||||||
|
*/
|
||||||
|
|
||||||
|
'permission' => Spatie\Permission\Models\Permission::class,
|
||||||
|
|
||||||
|
/*
|
||||||
|
* When using the "HasRoles" trait from this package, we need to know which
|
||||||
|
* Eloquent model should be used to retrieve your roles. Of course, it
|
||||||
|
* is often just the "Role" model but you may use whatever you like.
|
||||||
|
*
|
||||||
|
* The model you want to use as a Role model needs to implement the
|
||||||
|
* `Spatie\Permission\Contracts\Role` contract.
|
||||||
|
*/
|
||||||
|
|
||||||
|
'role' => Spatie\Permission\Models\Role::class,
|
||||||
|
|
||||||
|
],
|
||||||
|
|
||||||
|
'table_names' => [
|
||||||
|
|
||||||
|
/*
|
||||||
|
* When using the "HasRoles" trait from this package, we need to know which
|
||||||
|
* table should be used to retrieve your roles. We have chosen a basic
|
||||||
|
* default value but you may easily change it to any table you like.
|
||||||
|
*/
|
||||||
|
|
||||||
|
'roles' => 'roles',
|
||||||
|
|
||||||
|
/*
|
||||||
|
* When using the "HasPermissions" trait from this package, we need to know which
|
||||||
|
* table should be used to retrieve your permissions. We have chosen a basic
|
||||||
|
* default value but you may easily change it to any table you like.
|
||||||
|
*/
|
||||||
|
|
||||||
|
'permissions' => 'permissions',
|
||||||
|
|
||||||
|
/*
|
||||||
|
* When using the "HasPermissions" trait from this package, we need to know which
|
||||||
|
* table should be used to retrieve your models permissions. We have chosen a
|
||||||
|
* basic default value but you may easily change it to any table you like.
|
||||||
|
*/
|
||||||
|
|
||||||
|
'model_has_permissions' => 'model_has_permissions',
|
||||||
|
|
||||||
|
/*
|
||||||
|
* When using the "HasRoles" trait from this package, we need to know which
|
||||||
|
* table should be used to retrieve your models roles. We have chosen a
|
||||||
|
* basic default value but you may easily change it to any table you like.
|
||||||
|
*/
|
||||||
|
|
||||||
|
'model_has_roles' => 'model_has_roles',
|
||||||
|
|
||||||
|
/*
|
||||||
|
* When using the "HasRoles" trait from this package, we need to know which
|
||||||
|
* table should be used to retrieve your roles permissions. We have chosen a
|
||||||
|
* basic default value but you may easily change it to any table you like.
|
||||||
|
*/
|
||||||
|
|
||||||
|
'role_has_permissions' => 'role_has_permissions',
|
||||||
|
],
|
||||||
|
|
||||||
|
'column_names' => [
|
||||||
|
/*
|
||||||
|
* Change this if you want to name the related pivots other than defaults
|
||||||
|
*/
|
||||||
|
'role_pivot_key' => null, //default 'role_id',
|
||||||
|
'permission_pivot_key' => null, //default 'permission_id',
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Change this if you want to name the related model primary key other than
|
||||||
|
* `model_id`.
|
||||||
|
*
|
||||||
|
* For example, this would be nice if your primary keys are all UUIDs. In
|
||||||
|
* that case, name this `model_uuid`.
|
||||||
|
*/
|
||||||
|
|
||||||
|
'model_morph_key' => 'model_id',
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Change this if you want to use the teams feature and your related model's
|
||||||
|
* foreign key is other than `team_id`.
|
||||||
|
*/
|
||||||
|
|
||||||
|
'team_foreign_key' => 'team_id',
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
* When set to true, the method for checking permissions will be registered on the gate.
|
||||||
|
* Set this to false, if you want to implement custom logic for checking permissions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
'register_permission_check_method' => true,
|
||||||
|
|
||||||
|
/*
|
||||||
|
* When set to true the package implements teams using the 'team_foreign_key'. If you want
|
||||||
|
* the migrations to register the 'team_foreign_key', you must set this to true
|
||||||
|
* before doing the migration. If you already did the migration then you must make a new
|
||||||
|
* migration to also add 'team_foreign_key' to 'roles', 'model_has_roles', and
|
||||||
|
* 'model_has_permissions'(view the latest version of package's migration file)
|
||||||
|
*/
|
||||||
|
|
||||||
|
'teams' => false,
|
||||||
|
|
||||||
|
/*
|
||||||
|
* When set to true, the required permission names are added to the exception
|
||||||
|
* message. This could be considered an information leak in some contexts, so
|
||||||
|
* the default setting is false here for optimum safety.
|
||||||
|
*/
|
||||||
|
|
||||||
|
'display_permission_in_exception' => false,
|
||||||
|
|
||||||
|
/*
|
||||||
|
* When set to true, the required role names are added to the exception
|
||||||
|
* message. This could be considered an information leak in some contexts, so
|
||||||
|
* the default setting is false here for optimum safety.
|
||||||
|
*/
|
||||||
|
|
||||||
|
'display_role_in_exception' => false,
|
||||||
|
|
||||||
|
/*
|
||||||
|
* By default wildcard permission lookups are disabled.
|
||||||
|
*/
|
||||||
|
|
||||||
|
'enable_wildcard_permission' => false,
|
||||||
|
|
||||||
|
'cache' => [
|
||||||
|
|
||||||
|
/*
|
||||||
|
* By default all permissions are cached for 24 hours to speed up performance.
|
||||||
|
* When permissions or roles are updated the cache is flushed automatically.
|
||||||
|
*/
|
||||||
|
|
||||||
|
'expiration_time' => \DateInterval::createFromDateString('24 hours'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The cache key used to store all permissions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
'key' => 'spatie.permission.cache',
|
||||||
|
|
||||||
|
/*
|
||||||
|
* You may optionally indicate a specific cache driver to use for permission and
|
||||||
|
* role caching using any of the `store` drivers listed in the cache.php config
|
||||||
|
* file. Using 'default' here means to use the `default` set in cache.php.
|
||||||
|
*/
|
||||||
|
|
||||||
|
'store' => 'default',
|
||||||
|
],
|
||||||
|
];
|
109
config/queue.php
Normal file
109
config/queue.php
Normal file
@ -0,0 +1,109 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Default Queue Connection Name
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Laravel's queue API supports an assortment of back-ends via a single
|
||||||
|
| API, giving you convenient access to each back-end using the same
|
||||||
|
| syntax for every one. Here you may define a default connection.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'default' => env('QUEUE_CONNECTION', 'sync'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Queue Connections
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Here you may configure the connection information for each server that
|
||||||
|
| is used by your application. A default configuration has been added
|
||||||
|
| for each back-end shipped with Laravel. You are free to add more.
|
||||||
|
|
|
||||||
|
| Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null"
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'connections' => [
|
||||||
|
|
||||||
|
'sync' => [
|
||||||
|
'driver' => 'sync',
|
||||||
|
],
|
||||||
|
|
||||||
|
'database' => [
|
||||||
|
'driver' => 'database',
|
||||||
|
'table' => 'jobs',
|
||||||
|
'queue' => 'default',
|
||||||
|
'retry_after' => 90,
|
||||||
|
'after_commit' => false,
|
||||||
|
],
|
||||||
|
|
||||||
|
'beanstalkd' => [
|
||||||
|
'driver' => 'beanstalkd',
|
||||||
|
'host' => 'localhost',
|
||||||
|
'queue' => 'default',
|
||||||
|
'retry_after' => 90,
|
||||||
|
'block_for' => 0,
|
||||||
|
'after_commit' => false,
|
||||||
|
],
|
||||||
|
|
||||||
|
'sqs' => [
|
||||||
|
'driver' => 'sqs',
|
||||||
|
'key' => env('AWS_ACCESS_KEY_ID'),
|
||||||
|
'secret' => env('AWS_SECRET_ACCESS_KEY'),
|
||||||
|
'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
|
||||||
|
'queue' => env('SQS_QUEUE', 'default'),
|
||||||
|
'suffix' => env('SQS_SUFFIX'),
|
||||||
|
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
|
||||||
|
'after_commit' => false,
|
||||||
|
],
|
||||||
|
|
||||||
|
'redis' => [
|
||||||
|
'driver' => 'redis',
|
||||||
|
'connection' => 'default',
|
||||||
|
'queue' => env('REDIS_QUEUE', 'default'),
|
||||||
|
'retry_after' => 90,
|
||||||
|
'block_for' => null,
|
||||||
|
'after_commit' => false,
|
||||||
|
],
|
||||||
|
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Job Batching
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| The following options configure the database and table that store job
|
||||||
|
| batching information. These options can be updated to any database
|
||||||
|
| connection and table which has been defined by your application.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'batching' => [
|
||||||
|
'database' => env('DB_CONNECTION', 'mysql'),
|
||||||
|
'table' => 'job_batches',
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Failed Queue Jobs
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| These options configure the behavior of failed queue job logging so you
|
||||||
|
| can control which database and table are used to store the jobs that
|
||||||
|
| have failed. You may change them to any database / table you wish.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'failed' => [
|
||||||
|
'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'),
|
||||||
|
'database' => env('DB_CONNECTION', 'mysql'),
|
||||||
|
'table' => 'failed_jobs',
|
||||||
|
],
|
||||||
|
|
||||||
|
];
|
83
config/sanctum.php
Normal file
83
config/sanctum.php
Normal file
@ -0,0 +1,83 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Laravel\Sanctum\Sanctum;
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Stateful Domains
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Requests from the following domains / hosts will receive stateful API
|
||||||
|
| authentication cookies. Typically, these should include your local
|
||||||
|
| and production domains which access your API via a frontend SPA.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'stateful' => explode(',', env('SANCTUM_STATEFUL_DOMAINS', sprintf(
|
||||||
|
'%s%s',
|
||||||
|
'localhost,localhost:3000,127.0.0.1,127.0.0.1:8000,::1',
|
||||||
|
Sanctum::currentApplicationUrlWithPort()
|
||||||
|
))),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Sanctum Guards
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| This array contains the authentication guards that will be checked when
|
||||||
|
| Sanctum is trying to authenticate a request. If none of these guards
|
||||||
|
| are able to authenticate the request, Sanctum will use the bearer
|
||||||
|
| token that's present on an incoming request for authentication.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'guard' => ['web'],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Expiration Minutes
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| This value controls the number of minutes until an issued token will be
|
||||||
|
| considered expired. This will override any values set in the token's
|
||||||
|
| "expires_at" attribute, but first-party sessions are not affected.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'expiration' => null,
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Token Prefix
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Sanctum can prefix new tokens in order to take advantage of numerous
|
||||||
|
| security scanning initiatives maintained by open source platforms
|
||||||
|
| that notify developers if they commit tokens into repositories.
|
||||||
|
|
|
||||||
|
| See: https://docs.github.com/en/code-security/secret-scanning/about-secret-scanning
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'token_prefix' => env('SANCTUM_TOKEN_PREFIX', ''),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Sanctum Middleware
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| When authenticating your first-party SPA with Sanctum you may need to
|
||||||
|
| customize some of the middleware Sanctum uses while processing the
|
||||||
|
| request. You may change the middleware listed below as required.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'middleware' => [
|
||||||
|
'authenticate_session' => Laravel\Sanctum\Http\Middleware\AuthenticateSession::class,
|
||||||
|
'encrypt_cookies' => App\Http\Middleware\EncryptCookies::class,
|
||||||
|
'verify_csrf_token' => App\Http\Middleware\VerifyCsrfToken::class,
|
||||||
|
],
|
||||||
|
|
||||||
|
];
|
34
config/services.php
Normal file
34
config/services.php
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Third Party Services
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| This file is for storing the credentials for third party services such
|
||||||
|
| as Mailgun, Postmark, AWS and more. This file provides the de facto
|
||||||
|
| location for this type of information, allowing packages to have
|
||||||
|
| a conventional file to locate the various service credentials.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'mailgun' => [
|
||||||
|
'domain' => env('MAILGUN_DOMAIN'),
|
||||||
|
'secret' => env('MAILGUN_SECRET'),
|
||||||
|
'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'),
|
||||||
|
'scheme' => 'https',
|
||||||
|
],
|
||||||
|
|
||||||
|
'postmark' => [
|
||||||
|
'token' => env('POSTMARK_TOKEN'),
|
||||||
|
],
|
||||||
|
|
||||||
|
'ses' => [
|
||||||
|
'key' => env('AWS_ACCESS_KEY_ID'),
|
||||||
|
'secret' => env('AWS_SECRET_ACCESS_KEY'),
|
||||||
|
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
|
||||||
|
],
|
||||||
|
|
||||||
|
];
|
201
config/session.php
Normal file
201
config/session.php
Normal file
@ -0,0 +1,201 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Default Session Driver
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| This option controls the default session "driver" that will be used on
|
||||||
|
| requests. By default, we will use the lightweight native driver but
|
||||||
|
| you may specify any of the other wonderful drivers provided here.
|
||||||
|
|
|
||||||
|
| Supported: "file", "cookie", "database", "apc",
|
||||||
|
| "memcached", "redis", "dynamodb", "array"
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'driver' => env('SESSION_DRIVER', 'file'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Session Lifetime
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Here you may specify the number of minutes that you wish the session
|
||||||
|
| to be allowed to remain idle before it expires. If you want them
|
||||||
|
| to immediately expire on the browser closing, set that option.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'lifetime' => env('SESSION_LIFETIME', 120),
|
||||||
|
|
||||||
|
'expire_on_close' => false,
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Session Encryption
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| This option allows you to easily specify that all of your session data
|
||||||
|
| should be encrypted before it is stored. All encryption will be run
|
||||||
|
| automatically by Laravel and you can use the Session like normal.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'encrypt' => false,
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Session File Location
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| When using the native session driver, we need a location where session
|
||||||
|
| files may be stored. A default has been set for you but a different
|
||||||
|
| location may be specified. This is only needed for file sessions.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'files' => storage_path('framework/sessions'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Session Database Connection
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| When using the "database" or "redis" session drivers, you may specify a
|
||||||
|
| connection that should be used to manage these sessions. This should
|
||||||
|
| correspond to a connection in your database configuration options.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'connection' => env('SESSION_CONNECTION'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Session Database Table
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| When using the "database" session driver, you may specify the table we
|
||||||
|
| should use to manage the sessions. Of course, a sensible default is
|
||||||
|
| provided for you; however, you are free to change this as needed.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'table' => 'sessions',
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Session Cache Store
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| While using one of the framework's cache driven session backends you may
|
||||||
|
| list a cache store that should be used for these sessions. This value
|
||||||
|
| must match with one of the application's configured cache "stores".
|
||||||
|
|
|
||||||
|
| Affects: "apc", "dynamodb", "memcached", "redis"
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'store' => env('SESSION_STORE'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Session Sweeping Lottery
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Some session drivers must manually sweep their storage location to get
|
||||||
|
| rid of old sessions from storage. Here are the chances that it will
|
||||||
|
| happen on a given request. By default, the odds are 2 out of 100.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'lottery' => [2, 100],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Session Cookie Name
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Here you may change the name of the cookie used to identify a session
|
||||||
|
| instance by ID. The name specified here will get used every time a
|
||||||
|
| new session cookie is created by the framework for every driver.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'cookie' => env(
|
||||||
|
'SESSION_COOKIE',
|
||||||
|
Str::slug(env('APP_NAME', 'laravel'), '_').'_session'
|
||||||
|
),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Session Cookie Path
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| The session cookie path determines the path for which the cookie will
|
||||||
|
| be regarded as available. Typically, this will be the root path of
|
||||||
|
| your application but you are free to change this when necessary.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'path' => '/',
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Session Cookie Domain
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Here you may change the domain of the cookie used to identify a session
|
||||||
|
| in your application. This will determine which domains the cookie is
|
||||||
|
| available to in your application. A sensible default has been set.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'domain' => env('SESSION_DOMAIN'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| HTTPS Only Cookies
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| By setting this option to true, session cookies will only be sent back
|
||||||
|
| to the server if the browser has a HTTPS connection. This will keep
|
||||||
|
| the cookie from being sent to you when it can't be done securely.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'secure' => env('SESSION_SECURE_COOKIE'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| HTTP Access Only
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Setting this value to true will prevent JavaScript from accessing the
|
||||||
|
| value of the cookie and the cookie will only be accessible through
|
||||||
|
| the HTTP protocol. You are free to modify this option if needed.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'http_only' => true,
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Same-Site Cookies
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| This option determines how your cookies behave when cross-site requests
|
||||||
|
| take place, and can be used to mitigate CSRF attacks. By default, we
|
||||||
|
| will set this value to "lax" since this is a secure default value.
|
||||||
|
|
|
||||||
|
| Supported: "lax", "strict", "none", null
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'same_site' => 'lax',
|
||||||
|
|
||||||
|
];
|
36
config/view.php
Normal file
36
config/view.php
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| View Storage Paths
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Most templating systems load templates from disk. Here you may specify
|
||||||
|
| an array of paths that should be checked for your views. Of course
|
||||||
|
| the usual Laravel view path has already been registered for you.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'paths' => [
|
||||||
|
resource_path('views'),
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Compiled View Path
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| This option determines where all the compiled Blade templates will be
|
||||||
|
| stored for your application. Typically, this is within the storage
|
||||||
|
| directory. However, as usual, you are free to change this value.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'compiled' => env(
|
||||||
|
'VIEW_COMPILED_PATH',
|
||||||
|
realpath(storage_path('framework/views'))
|
||||||
|
),
|
||||||
|
|
||||||
|
];
|
1
database/.gitignore
vendored
Normal file
1
database/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
*.sqlite*
|
41
database/factories/UserFactory.php
Normal file
41
database/factories/UserFactory.php
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Database\Factories;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||||
|
use Illuminate\Support\Facades\Hash;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\User>
|
||||||
|
*/
|
||||||
|
class UserFactory extends Factory
|
||||||
|
{
|
||||||
|
protected static ?string $password;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define the model's default state.
|
||||||
|
*
|
||||||
|
* @return array<string, mixed>
|
||||||
|
*/
|
||||||
|
public function definition(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'name' => fake()->name(),
|
||||||
|
'email' => fake()->unique()->safeEmail(),
|
||||||
|
'email_verified_at' => now(),
|
||||||
|
'password' => static::$password ??= Hash::make('password'),
|
||||||
|
'remember_token' => Str::random(10),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicate that the model's email address should be unverified.
|
||||||
|
*/
|
||||||
|
public function unverified(): static
|
||||||
|
{
|
||||||
|
return $this->state(fn (array $attributes) => [
|
||||||
|
'email_verified_at' => null,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
32
database/migrations/2014_10_12_000000_create_users_table.php
Normal file
32
database/migrations/2014_10_12_000000_create_users_table.php
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::create('users', function (Blueprint $table) {
|
||||||
|
$table->id();
|
||||||
|
$table->string('name');
|
||||||
|
$table->string('email')->unique();
|
||||||
|
$table->timestamp('email_verified_at')->nullable();
|
||||||
|
$table->string('password');
|
||||||
|
$table->rememberToken();
|
||||||
|
$table->timestamps();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('users');
|
||||||
|
}
|
||||||
|
};
|
@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::create('password_reset_tokens', function (Blueprint $table) {
|
||||||
|
$table->string('email')->primary();
|
||||||
|
$table->string('token');
|
||||||
|
$table->timestamp('created_at')->nullable();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('password_reset_tokens');
|
||||||
|
}
|
||||||
|
};
|
@ -0,0 +1,32 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::create('failed_jobs', function (Blueprint $table) {
|
||||||
|
$table->id();
|
||||||
|
$table->string('uuid')->unique();
|
||||||
|
$table->text('connection');
|
||||||
|
$table->text('queue');
|
||||||
|
$table->longText('payload');
|
||||||
|
$table->longText('exception');
|
||||||
|
$table->timestamp('failed_at')->useCurrent();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('failed_jobs');
|
||||||
|
}
|
||||||
|
};
|
@ -0,0 +1,33 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::create('personal_access_tokens', function (Blueprint $table) {
|
||||||
|
$table->id();
|
||||||
|
$table->morphs('tokenable');
|
||||||
|
$table->string('name');
|
||||||
|
$table->string('token', 64)->unique();
|
||||||
|
$table->text('abilities')->nullable();
|
||||||
|
$table->timestamp('last_used_at')->nullable();
|
||||||
|
$table->timestamp('expires_at')->nullable();
|
||||||
|
$table->timestamps();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('personal_access_tokens');
|
||||||
|
}
|
||||||
|
};
|
@ -0,0 +1,54 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use Illuminate\Support\Facades\Log;
|
||||||
|
|
||||||
|
class RemoveBackpackuserModel extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
// establish the table names
|
||||||
|
$model_has_roles = config('permission.table_names.model_has_roles');
|
||||||
|
$model_has_permissions = config('permission.table_names.model_has_permissions');
|
||||||
|
|
||||||
|
// replace the BackpackUser model with User
|
||||||
|
if (\Illuminate\Support\Facades\Schema::hasTable($model_has_roles)) {
|
||||||
|
$this->replaceModels($model_has_roles);
|
||||||
|
}
|
||||||
|
if (\Illuminate\Support\Facades\Schema::hasTable($model_has_permissions)) {
|
||||||
|
$this->replaceModels($model_has_permissions);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function replaceModels($table_name)
|
||||||
|
{
|
||||||
|
Log::info('Replacing BackpackUser model in '.$table_name);
|
||||||
|
|
||||||
|
// if you've ended up with duplicate entries (both for App\User and App\Models\BackpackUser)
|
||||||
|
// we can just delete them
|
||||||
|
$userEntries = DB::table($table_name)
|
||||||
|
->where('model_type', "App\User")
|
||||||
|
->get();
|
||||||
|
|
||||||
|
foreach ($userEntries as $entry) {
|
||||||
|
DB::table($table_name)
|
||||||
|
->where('role_id', $entry->role_id)
|
||||||
|
->where('model_type', 'App\Models\BackpackUser')
|
||||||
|
->where('model_id', $entry->model_id)
|
||||||
|
->delete();
|
||||||
|
}
|
||||||
|
|
||||||
|
// for the rest of them, we can just replace the BackpackUser model with User
|
||||||
|
DB::table($table_name)
|
||||||
|
->where('model_type', "App\Models\BackpackUser")
|
||||||
|
->update([
|
||||||
|
'model_type' => "App\User",
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,141 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Spatie\Permission\PermissionRegistrar;
|
||||||
|
|
||||||
|
class CreatePermissionTables extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
$tableNames = config('permission.table_names');
|
||||||
|
$columnNames = config('permission.column_names');
|
||||||
|
$teams = config('permission.teams');
|
||||||
|
|
||||||
|
if (empty($tableNames)) {
|
||||||
|
throw new \Exception('Error: config/permission.php not loaded. Run [php artisan config:clear] and try again.');
|
||||||
|
}
|
||||||
|
if ($teams && empty($columnNames['team_foreign_key'] ?? null)) {
|
||||||
|
throw new \Exception('Error: team_foreign_key on config/permission.php not loaded. Run [php artisan config:clear] and try again.');
|
||||||
|
}
|
||||||
|
|
||||||
|
Schema::create($tableNames['permissions'], function (Blueprint $table) {
|
||||||
|
$table->bigIncrements('id'); // permission id
|
||||||
|
$table->string('name',125); // For MySQL 8.0 use string('name', 125);
|
||||||
|
$table->string('guard_name',125); // For MySQL 8.0 use string('guard_name', 125);
|
||||||
|
$table->timestamps();
|
||||||
|
|
||||||
|
$table->unique(['name', 'guard_name']);
|
||||||
|
});
|
||||||
|
|
||||||
|
Schema::create($tableNames['roles'], function (Blueprint $table) use ($teams, $columnNames) {
|
||||||
|
$table->bigIncrements('id'); // role id
|
||||||
|
if ($teams || config('permission.testing')) { // permission.testing is a fix for sqlite testing
|
||||||
|
$table->unsignedBigInteger($columnNames['team_foreign_key'])->nullable();
|
||||||
|
$table->index($columnNames['team_foreign_key'], 'roles_team_foreign_key_index');
|
||||||
|
}
|
||||||
|
$table->string('name',125); // For MySQL 8.0 use string('name', 125);
|
||||||
|
$table->string('guard_name',125); // For MySQL 8.0 use string('guard_name', 125);
|
||||||
|
$table->timestamps();
|
||||||
|
if ($teams || config('permission.testing')) {
|
||||||
|
$table->unique([$columnNames['team_foreign_key'], 'name', 'guard_name']);
|
||||||
|
} else {
|
||||||
|
$table->unique(['name', 'guard_name']);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
Schema::create($tableNames['model_has_permissions'], function (Blueprint $table) use ($tableNames, $columnNames, $teams) {
|
||||||
|
$table->unsignedBigInteger(PermissionRegistrar::$pivotPermission);
|
||||||
|
|
||||||
|
$table->string('model_type');
|
||||||
|
$table->unsignedBigInteger($columnNames['model_morph_key']);
|
||||||
|
$table->index([$columnNames['model_morph_key'], 'model_type'], 'model_has_permissions_model_id_model_type_index');
|
||||||
|
|
||||||
|
$table->foreign(PermissionRegistrar::$pivotPermission)
|
||||||
|
->references('id') // permission id
|
||||||
|
->on($tableNames['permissions'])
|
||||||
|
->onDelete('cascade');
|
||||||
|
if ($teams) {
|
||||||
|
$table->unsignedBigInteger($columnNames['team_foreign_key']);
|
||||||
|
$table->index($columnNames['team_foreign_key'], 'model_has_permissions_team_foreign_key_index');
|
||||||
|
|
||||||
|
$table->primary([$columnNames['team_foreign_key'], PermissionRegistrar::$pivotPermission, $columnNames['model_morph_key'], 'model_type'],
|
||||||
|
'model_has_permissions_permission_model_type_primary');
|
||||||
|
} else {
|
||||||
|
$table->primary([PermissionRegistrar::$pivotPermission, $columnNames['model_morph_key'], 'model_type'],
|
||||||
|
'model_has_permissions_permission_model_type_primary');
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
Schema::create($tableNames['model_has_roles'], function (Blueprint $table) use ($tableNames, $columnNames, $teams) {
|
||||||
|
$table->unsignedBigInteger(PermissionRegistrar::$pivotRole);
|
||||||
|
|
||||||
|
$table->string('model_type');
|
||||||
|
$table->unsignedBigInteger($columnNames['model_morph_key']);
|
||||||
|
$table->index([$columnNames['model_morph_key'], 'model_type'], 'model_has_roles_model_id_model_type_index');
|
||||||
|
|
||||||
|
$table->foreign(PermissionRegistrar::$pivotRole)
|
||||||
|
->references('id') // role id
|
||||||
|
->on($tableNames['roles'])
|
||||||
|
->onDelete('cascade');
|
||||||
|
if ($teams) {
|
||||||
|
$table->unsignedBigInteger($columnNames['team_foreign_key']);
|
||||||
|
$table->index($columnNames['team_foreign_key'], 'model_has_roles_team_foreign_key_index');
|
||||||
|
|
||||||
|
$table->primary([$columnNames['team_foreign_key'], PermissionRegistrar::$pivotRole, $columnNames['model_morph_key'], 'model_type'],
|
||||||
|
'model_has_roles_role_model_type_primary');
|
||||||
|
} else {
|
||||||
|
$table->primary([PermissionRegistrar::$pivotRole, $columnNames['model_morph_key'], 'model_type'],
|
||||||
|
'model_has_roles_role_model_type_primary');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
Schema::create($tableNames['role_has_permissions'], function (Blueprint $table) use ($tableNames) {
|
||||||
|
$table->unsignedBigInteger(PermissionRegistrar::$pivotPermission);
|
||||||
|
$table->unsignedBigInteger(PermissionRegistrar::$pivotRole);
|
||||||
|
|
||||||
|
$table->foreign(PermissionRegistrar::$pivotPermission)
|
||||||
|
->references('id') // permission id
|
||||||
|
->on($tableNames['permissions'])
|
||||||
|
->onDelete('cascade');
|
||||||
|
|
||||||
|
$table->foreign(PermissionRegistrar::$pivotRole)
|
||||||
|
->references('id') // role id
|
||||||
|
->on($tableNames['roles'])
|
||||||
|
->onDelete('cascade');
|
||||||
|
|
||||||
|
$table->primary([PermissionRegistrar::$pivotPermission, PermissionRegistrar::$pivotRole], 'role_has_permissions_permission_id_role_id_primary');
|
||||||
|
});
|
||||||
|
|
||||||
|
app('cache')
|
||||||
|
->store(config('permission.cache.store') != 'default' ? config('permission.cache.store') : null)
|
||||||
|
->forget(config('permission.cache.key'));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
$tableNames = config('permission.table_names');
|
||||||
|
|
||||||
|
if (empty($tableNames)) {
|
||||||
|
throw new \Exception('Error: config/permission.php not found and defaults could not be merged. Please publish the package configuration before proceeding, or drop the tables manually.');
|
||||||
|
}
|
||||||
|
|
||||||
|
Schema::drop($tableNames['role_has_permissions']);
|
||||||
|
Schema::drop($tableNames['model_has_roles']);
|
||||||
|
Schema::drop($tableNames['model_has_permissions']);
|
||||||
|
Schema::drop($tableNames['roles']);
|
||||||
|
Schema::drop($tableNames['permissions']);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,51 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
|
||||||
|
class CreateDemoCatalogsTable extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::create('demo_catalogs', function (Blueprint $table) {
|
||||||
|
$table->bigIncrements('id');
|
||||||
|
$table->biginteger('parent_id')->nullable();
|
||||||
|
$table->integer('lft')->default(0);
|
||||||
|
$table->integer('rgt')->default(0);
|
||||||
|
$table->integer('depth')->default(0);
|
||||||
|
$table->string('name');
|
||||||
|
$table->text('photos')->nullable();
|
||||||
|
$table->text('text1')->nullable();
|
||||||
|
$table->text('text2')->nullable();
|
||||||
|
$table->text('text3')->nullable();
|
||||||
|
$table->text('text4')->nullable();
|
||||||
|
$table->text('text5')->nullable();
|
||||||
|
$table->text('text6')->nullable();
|
||||||
|
$table->text('text7')->nullable();
|
||||||
|
$table->text('text8')->nullable();
|
||||||
|
$table->text('text9')->nullable();
|
||||||
|
$table->text('text10')->nullable();
|
||||||
|
$table->integer('int1')->nullable();
|
||||||
|
$table->integer('int2')->nullable();
|
||||||
|
$table->integer('int3')->nullable();
|
||||||
|
$table->integer('int4')->nullable();
|
||||||
|
$table->integer('int5')->nullable();
|
||||||
|
$table->timestamps();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('demo_catalogs');
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,36 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
|
||||||
|
class CreateNewsCatalogsTable extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::create('news_catalogs', function (Blueprint $table) {
|
||||||
|
$table->bigIncrements('id');
|
||||||
|
$table->biginteger('parent_id')->nullable();
|
||||||
|
$table->integer('lft')->default(0);
|
||||||
|
$table->integer('rgt')->default(0);
|
||||||
|
$table->integer('depth')->default(1);
|
||||||
|
$table->boolean('is_front_show')->default(true);
|
||||||
|
$table->text('name');
|
||||||
|
$table->timestamps();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('news_catalogs');
|
||||||
|
}
|
||||||
|
}
|
41
database/migrations/2024_12_20_115219_create_news_table.php
Normal file
41
database/migrations/2024_12_20_115219_create_news_table.php
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
|
||||||
|
class CreateNewsTable extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::create('news', function (Blueprint $table) {
|
||||||
|
$table->bigIncrements('id');
|
||||||
|
$table->biginteger('news_catalog_id')->default(0);
|
||||||
|
$table->boolean('is_front_show')->default(true);
|
||||||
|
$table->dateTime('post_at')->useCurrent();
|
||||||
|
$table->text('seo_title')->nullable();
|
||||||
|
$table->text('seo_keyword')->nullable();
|
||||||
|
$table->text('seo_description')->nullable();
|
||||||
|
$table->text('title');
|
||||||
|
$table->text('description');
|
||||||
|
$table->text('body');
|
||||||
|
$table->text('source_links')->nullable();
|
||||||
|
$table->text('photos')->nullalbe();
|
||||||
|
$table->timestamps();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('news');
|
||||||
|
}
|
||||||
|
}
|
27
database/seeders/DatabaseSeeder.php
Normal file
27
database/seeders/DatabaseSeeder.php
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Database\Seeders;
|
||||||
|
|
||||||
|
use Carbon\Carbon;
|
||||||
|
// use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||||
|
use Illuminate\Database\Seeder;
|
||||||
|
|
||||||
|
class DatabaseSeeder extends Seeder
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Seed the application's database.
|
||||||
|
*/
|
||||||
|
public function run(): void
|
||||||
|
{
|
||||||
|
// \App\Models\User::factory(10)->create();
|
||||||
|
|
||||||
|
\App\Models\User::factory()->create([
|
||||||
|
'id' => 1,
|
||||||
|
'name' => 'Master',
|
||||||
|
'email' => 'master@example.com',
|
||||||
|
'email_verified_at' => Carbon::now(),
|
||||||
|
'password' => '12345678',
|
||||||
|
'remember_token' => null,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
9
lang/vendor/backpack.theme-tabler/en/theme-tabler.php
vendored
Normal file
9
lang/vendor/backpack.theme-tabler/en/theme-tabler.php
vendored
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
// color mode
|
||||||
|
'color-mode-description' => 'use :mode color mode',
|
||||||
|
'color-mode-system' => 'system',
|
||||||
|
'color-mode-light' => 'light',
|
||||||
|
'color-mode-dark' => 'dark',
|
||||||
|
];
|
9
lang/vendor/backpack.theme-tabler/zh_TW copy/theme-tabler.php
vendored
Normal file
9
lang/vendor/backpack.theme-tabler/zh_TW copy/theme-tabler.php
vendored
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
// color mode
|
||||||
|
'color-mode-description' => '使用 :mode 色彩模式',
|
||||||
|
'color-mode-system' => '系統',
|
||||||
|
'color-mode-light' => '淺色',
|
||||||
|
'color-mode-dark' => '深色',
|
||||||
|
];
|
9
lang/vendor/backpack.theme-tabler/zh_TW/theme-tabler.php
vendored
Normal file
9
lang/vendor/backpack.theme-tabler/zh_TW/theme-tabler.php
vendored
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
// color mode
|
||||||
|
'color-mode-description' => '使用 :mode 色彩模式',
|
||||||
|
'color-mode-system' => '系統',
|
||||||
|
'color-mode-light' => '淺色',
|
||||||
|
'color-mode-dark' => '深色',
|
||||||
|
];
|
16
lang/vendor/backpack/en/backup.php
vendored
Normal file
16
lang/vendor/backpack/en/backup.php
vendored
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// --------------------------------------------------------
|
||||||
|
// This is only a pointer file, not an actual language file
|
||||||
|
// --------------------------------------------------------
|
||||||
|
//
|
||||||
|
// If you've copied this file to your /resources/lang/vendor/backpack/
|
||||||
|
// folder, please delete it, it's no use there. You need to copy/publish the
|
||||||
|
// actual language file, from the package.
|
||||||
|
|
||||||
|
// If a langfile with the same name exists in the package, load that one
|
||||||
|
if (file_exists(__DIR__.'/../../../../../backupmanager/src/resources/lang/'.basename(__DIR__).'/'.basename(__FILE__))) {
|
||||||
|
return include __DIR__.'/../../../../../backupmanager/src/resources/lang/'.basename(__DIR__).'/'.basename(__FILE__);
|
||||||
|
}
|
||||||
|
|
||||||
|
return [];
|
96
lang/vendor/backpack/en/base.php
vendored
Normal file
96
lang/vendor/backpack/en/base.php
vendored
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Backpack\Base Language Lines
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
'registration_closed' => 'Registration is closed.',
|
||||||
|
'no_email_column' => 'Users do not have an associated email address.',
|
||||||
|
'first_page_you_see' => 'The first page you see after login',
|
||||||
|
'login_status' => 'Login status',
|
||||||
|
'logged_in' => 'You are logged in!',
|
||||||
|
'toggle_navigation' => 'Toggle navigation',
|
||||||
|
'administration' => 'ADMINISTRATION',
|
||||||
|
'user' => 'USER',
|
||||||
|
'logout' => 'Logout',
|
||||||
|
'login' => 'Login',
|
||||||
|
'register' => 'Register',
|
||||||
|
'name' => 'Name',
|
||||||
|
'email_address' => 'E-mail address',
|
||||||
|
'email' => 'Email',
|
||||||
|
'username' => 'Username',
|
||||||
|
'password' => 'Password',
|
||||||
|
'old_password' => 'Old password',
|
||||||
|
'new_password' => 'New password',
|
||||||
|
'confirm_password' => 'Confirm password',
|
||||||
|
'remember_me' => 'Remember me',
|
||||||
|
'forgot_your_password' => 'Forgot Your Password?',
|
||||||
|
'reset_password' => 'Reset Password',
|
||||||
|
'send_reset_link' => 'Send Password Reset Link',
|
||||||
|
'click_here_to_reset' => 'Click here to reset your password',
|
||||||
|
'change_password' => 'Change Password',
|
||||||
|
'unauthorized' => 'Unauthorized.',
|
||||||
|
'dashboard' => 'Dashboard',
|
||||||
|
'handcrafted_by' => 'Handcrafted by',
|
||||||
|
'powered_by' => 'Powered by',
|
||||||
|
'my_account' => 'My Account',
|
||||||
|
'update_account_info' => 'Update Account Info',
|
||||||
|
'save' => 'Save',
|
||||||
|
'cancel' => 'Cancel',
|
||||||
|
'error' => 'Error',
|
||||||
|
'success' => 'Success',
|
||||||
|
'warning' => 'Warning',
|
||||||
|
'notice' => 'Notice',
|
||||||
|
'old_password_incorrect' => 'Old password is incorrect.',
|
||||||
|
'password_dont_match' => 'Passwords do not match.',
|
||||||
|
'password_empty' => 'Make sure both password fields are filled out.',
|
||||||
|
'password_updated' => 'Password updated.',
|
||||||
|
'account_updated' => 'Account updated successfully.',
|
||||||
|
'unknown_error' => 'An unknown error has occurred. Please try again.',
|
||||||
|
'error_saving' => 'Error while saving. Please try again.',
|
||||||
|
'welcome' => 'Welcome!',
|
||||||
|
'use_sidebar' => 'Use the sidebar to the left to create, edit or delete content.',
|
||||||
|
|
||||||
|
'error_page' => [
|
||||||
|
'title' => 'Error :error',
|
||||||
|
'button' => 'Take me home',
|
||||||
|
'message_4xx' => 'Please <a :href_back>go back</a> or return to <a :href_homepage>our homepage</a>.',
|
||||||
|
'message_500' => 'An internal server error has occurred. If the error persists please contact the development team.',
|
||||||
|
'message_503' => 'The server is overloaded or down for maintenance. Please try again later.',
|
||||||
|
'400' => 'Bad request.',
|
||||||
|
'401' => 'Unauthorized action.',
|
||||||
|
'403' => 'Forbidden.',
|
||||||
|
'404' => 'Page not found.',
|
||||||
|
'405' => 'Method not allowed.',
|
||||||
|
'408' => 'Request timeout.',
|
||||||
|
'429' => 'Too many requests.',
|
||||||
|
'500' => 'It\'s not you, it\'s me.',
|
||||||
|
],
|
||||||
|
|
||||||
|
'password_reset' => [
|
||||||
|
'greeting' => 'Hello!',
|
||||||
|
'subject' => 'Reset Password Notification',
|
||||||
|
'line_1' => 'You are receiving this email because we received a password reset request for your account.',
|
||||||
|
'line_2' => 'Click the button below to reset your password:',
|
||||||
|
'button' => 'Reset Password',
|
||||||
|
'notice' => 'If you did not request a password reset, no further action is required.',
|
||||||
|
],
|
||||||
|
|
||||||
|
'step' => 'Step',
|
||||||
|
'confirm_email' => 'Confirm Email',
|
||||||
|
'choose_new_password' => 'Choose New Password',
|
||||||
|
'confirm_new_password' => 'Confirm new password',
|
||||||
|
'throttled' => 'You have already requested a password reset recently. Please check your email. If you do not receive our email, please retry later.',
|
||||||
|
'throttled_request' => 'You have exceeded the limit of tries. Please wait a few minutes and try again.',
|
||||||
|
|
||||||
|
'verify_email' => [
|
||||||
|
'email_verification' => 'Email Verification',
|
||||||
|
'verification_link_sent' => 'A verification link has been sent to your email address.',
|
||||||
|
'email_verification_required' => 'Please verify your email address, by clicking on the link we\'ve sent you.',
|
||||||
|
'resend_verification_link' => 'Resend link',
|
||||||
|
],
|
||||||
|
];
|
188
lang/vendor/backpack/en/crud.php
vendored
Normal file
188
lang/vendor/backpack/en/crud.php
vendored
Normal file
@ -0,0 +1,188 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Backpack Crud Language Lines
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| The following language lines are used by the CRUD interface.
|
||||||
|
| You are free to change them to anything
|
||||||
|
| you want to customize your views to better match your application.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Forms
|
||||||
|
'save_action_save_and_new' => 'Save and new item',
|
||||||
|
'save_action_save_and_edit' => 'Save and edit this item',
|
||||||
|
'save_action_save_and_back' => 'Save and back',
|
||||||
|
'save_action_save_and_preview' => 'Save and preview',
|
||||||
|
'save_action_changed_notification' => 'Default behaviour after saving has been changed.',
|
||||||
|
|
||||||
|
// Create form
|
||||||
|
'add' => 'Add',
|
||||||
|
'back_to_all' => 'Back to all ',
|
||||||
|
'cancel' => 'Cancel',
|
||||||
|
'add_a_new' => 'Add a new ',
|
||||||
|
|
||||||
|
// Edit form
|
||||||
|
'edit' => 'Edit',
|
||||||
|
'save' => 'Save',
|
||||||
|
|
||||||
|
// Translatable models
|
||||||
|
'edit_translations' => 'Translation',
|
||||||
|
'language' => 'Language',
|
||||||
|
|
||||||
|
// CRUD table view
|
||||||
|
'all' => 'All ',
|
||||||
|
'in_the_database' => 'in the database',
|
||||||
|
'list' => 'List',
|
||||||
|
'reset' => 'Reset',
|
||||||
|
'actions' => 'Actions',
|
||||||
|
'preview' => 'Preview',
|
||||||
|
'delete' => 'Delete',
|
||||||
|
'admin' => 'Admin',
|
||||||
|
'details_row' => 'This is the details row. Modify as you please.',
|
||||||
|
'details_row_loading_error' => 'There was an error loading the details. Please retry.',
|
||||||
|
'clone' => 'Clone',
|
||||||
|
'clone_success' => '<strong>Entry cloned</strong><br>A new entry has been added, with the same information as this one.',
|
||||||
|
'clone_failure' => '<strong>Cloning failed</strong><br>The new entry could not be created. Please try again.',
|
||||||
|
|
||||||
|
// Confirmation messages and bubbles
|
||||||
|
'delete_confirm' => 'Are you sure you want to delete this item?',
|
||||||
|
'delete_confirmation_title' => 'Item Deleted',
|
||||||
|
'delete_confirmation_message' => 'The item has been deleted successfully.',
|
||||||
|
'delete_confirmation_not_title' => 'NOT deleted',
|
||||||
|
'delete_confirmation_not_message' => "There's been an error. Your item might not have been deleted.",
|
||||||
|
'delete_confirmation_not_deleted_title' => 'Not deleted',
|
||||||
|
'delete_confirmation_not_deleted_message' => 'Nothing happened. Your item is safe.',
|
||||||
|
|
||||||
|
// Bulk actions
|
||||||
|
'bulk_no_entries_selected_title' => 'No entries selected',
|
||||||
|
'bulk_no_entries_selected_message' => 'Please select one or more items to perform a bulk action on them.',
|
||||||
|
|
||||||
|
// Bulk delete
|
||||||
|
'bulk_delete_are_you_sure' => 'Are you sure you want to delete these :number entries?',
|
||||||
|
'bulk_delete_sucess_title' => 'Entries deleted',
|
||||||
|
'bulk_delete_sucess_message' => ' items have been deleted',
|
||||||
|
'bulk_delete_error_title' => 'Delete failed',
|
||||||
|
'bulk_delete_error_message' => 'One or more items could not be deleted',
|
||||||
|
|
||||||
|
// Bulk clone
|
||||||
|
'bulk_clone_are_you_sure' => 'Are you sure you want to clone these :number entries?',
|
||||||
|
'bulk_clone_sucess_title' => 'Entries cloned',
|
||||||
|
'bulk_clone_sucess_message' => ' items have been cloned.',
|
||||||
|
'bulk_clone_error_title' => 'Cloning failed',
|
||||||
|
'bulk_clone_error_message' => 'One or more entries could not be created. Please try again.',
|
||||||
|
|
||||||
|
// Ajax errors
|
||||||
|
'ajax_error_title' => 'Error',
|
||||||
|
'ajax_error_text' => 'Error loading page. Please refresh the page.',
|
||||||
|
|
||||||
|
// DataTables translation
|
||||||
|
'emptyTable' => 'No data available in table',
|
||||||
|
'info' => 'Showing _START_ to _END_ of _TOTAL_ entries',
|
||||||
|
'infoEmpty' => 'No entries',
|
||||||
|
'infoFiltered' => '(filtered from _MAX_ total entries)',
|
||||||
|
'infoPostFix' => '.',
|
||||||
|
'thousands' => ',',
|
||||||
|
'lengthMenu' => '_MENU_ entries per page',
|
||||||
|
'loadingRecords' => 'Loading...',
|
||||||
|
'processing' => 'Processing...',
|
||||||
|
'search' => 'Search',
|
||||||
|
'zeroRecords' => 'No matching entries found',
|
||||||
|
'paginate' => [
|
||||||
|
'first' => 'First',
|
||||||
|
'last' => 'Last',
|
||||||
|
'next' => 'Next',
|
||||||
|
'previous' => 'Previous',
|
||||||
|
],
|
||||||
|
'aria' => [
|
||||||
|
'sortAscending' => ': activate to sort column ascending',
|
||||||
|
'sortDescending' => ': activate to sort column descending',
|
||||||
|
],
|
||||||
|
'export' => [
|
||||||
|
'export' => 'Export',
|
||||||
|
'copy' => 'Copy',
|
||||||
|
'excel' => 'Excel',
|
||||||
|
'csv' => 'CSV',
|
||||||
|
'pdf' => 'PDF',
|
||||||
|
'print' => 'Print',
|
||||||
|
'column_visibility' => 'Column visibility',
|
||||||
|
],
|
||||||
|
|
||||||
|
// global crud - errors
|
||||||
|
'unauthorized_access' => 'Unauthorized access - you do not have the necessary permissions to see this page.',
|
||||||
|
'please_fix' => 'Please fix the following errors:',
|
||||||
|
|
||||||
|
// global crud - success / error notification bubbles
|
||||||
|
'insert_success' => 'The item has been added successfully.',
|
||||||
|
'update_success' => 'The item has been modified successfully.',
|
||||||
|
|
||||||
|
// CRUD reorder view
|
||||||
|
'reorder' => 'Reorder',
|
||||||
|
'reorder_text' => 'Use drag&drop to reorder.',
|
||||||
|
'reorder_success_title' => 'Done',
|
||||||
|
'reorder_success_message' => 'Your order has been saved.',
|
||||||
|
'reorder_error_title' => 'Error',
|
||||||
|
'reorder_error_message' => 'Your order has not been saved.',
|
||||||
|
|
||||||
|
// CRUD yes/no
|
||||||
|
'yes' => 'Yes',
|
||||||
|
'no' => 'No',
|
||||||
|
|
||||||
|
// CRUD filters navbar view
|
||||||
|
'filters' => 'Filters',
|
||||||
|
'toggle_filters' => 'Toggle filters',
|
||||||
|
'remove_filters' => 'Remove filters',
|
||||||
|
'apply' => 'Apply',
|
||||||
|
|
||||||
|
//filters language strings
|
||||||
|
'today' => 'Today',
|
||||||
|
'yesterday' => 'Yesterday',
|
||||||
|
'last_7_days' => 'Last 7 Days',
|
||||||
|
'last_30_days' => 'Last 30 Days',
|
||||||
|
'this_month' => 'This Month',
|
||||||
|
'last_month' => 'Last Month',
|
||||||
|
'custom_range' => 'Custom Range',
|
||||||
|
'weekLabel' => 'W',
|
||||||
|
|
||||||
|
// Fields
|
||||||
|
'browse_uploads' => 'Browse uploads',
|
||||||
|
'select_all' => 'Select All',
|
||||||
|
'select_files' => 'Select files',
|
||||||
|
'select_file' => 'Select file',
|
||||||
|
'clear' => 'Clear',
|
||||||
|
'page_link' => 'Page link',
|
||||||
|
'page_link_placeholder' => 'http://example.com/your-desired-page',
|
||||||
|
'internal_link' => 'Internal link',
|
||||||
|
'internal_link_placeholder' => 'Internal slug. Ex: \'admin/page\' (no quotes) for \':url\'',
|
||||||
|
'external_link' => 'External link',
|
||||||
|
'choose_file' => 'Choose file',
|
||||||
|
'new_item' => 'New Item',
|
||||||
|
'select_entry' => 'Select an entry',
|
||||||
|
'select_entries' => 'Select entries',
|
||||||
|
'upload_multiple_files_selected' => 'Files selected. After save, they will show up above.',
|
||||||
|
|
||||||
|
//Table field
|
||||||
|
'table_cant_add' => 'Cannot add new :entity',
|
||||||
|
'table_max_reached' => 'Maximum number of :max reached',
|
||||||
|
|
||||||
|
// google_map
|
||||||
|
'google_map_locate' => 'Get my location',
|
||||||
|
|
||||||
|
// File manager
|
||||||
|
'file_manager' => 'File Manager',
|
||||||
|
|
||||||
|
// InlineCreateOperation
|
||||||
|
'related_entry_created_success' => 'Related entry has been created and selected.',
|
||||||
|
'related_entry_created_error' => 'Could not create related entry.',
|
||||||
|
'inline_saving' => 'Saving...',
|
||||||
|
|
||||||
|
// returned when no translations found in select inputs
|
||||||
|
'empty_translations' => '(empty)',
|
||||||
|
|
||||||
|
// The pivot selector required validation message
|
||||||
|
'pivot_selector_required_validation_message' => 'The pivot field is required.',
|
||||||
|
];
|
16
lang/vendor/backpack/en/langfilemanager.php
vendored
Normal file
16
lang/vendor/backpack/en/langfilemanager.php
vendored
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// --------------------------------------------------------
|
||||||
|
// This is only a pointer file, not an actual language file
|
||||||
|
// --------------------------------------------------------
|
||||||
|
//
|
||||||
|
// If you've copied this file to your /resources/lang/vendor/backpack/
|
||||||
|
// folder, please delete it, it's no use there. You need to copy/publish the
|
||||||
|
// actual language file, from the package.
|
||||||
|
|
||||||
|
// If a langfile with the same name exists in the package, load that one
|
||||||
|
if (file_exists(__DIR__.'/../../../../../langfilemanager/src/resources/lang/'.basename(__DIR__).'/'.basename(__FILE__))) {
|
||||||
|
return include __DIR__.'/../../../../../langfilemanager/src/resources/lang/'.basename(__DIR__).'/'.basename(__FILE__);
|
||||||
|
}
|
||||||
|
|
||||||
|
return [];
|
16
lang/vendor/backpack/en/logmanager.php
vendored
Normal file
16
lang/vendor/backpack/en/logmanager.php
vendored
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// --------------------------------------------------------
|
||||||
|
// This is only a pointer file, not an actual language file
|
||||||
|
// --------------------------------------------------------
|
||||||
|
//
|
||||||
|
// If you've copied this file to your /resources/lang/vendor/backpack/
|
||||||
|
// folder, please delete it, it's no use there. You need to copy/publish the
|
||||||
|
// actual language file, from the package.
|
||||||
|
|
||||||
|
// If a langfile with the same name exists in the package, load that one
|
||||||
|
if (file_exists(__DIR__.'/../../../../../logmanager/src/resources/lang/'.basename(__DIR__).'/'.basename(__FILE__))) {
|
||||||
|
return include __DIR__.'/../../../../../logmanager/src/resources/lang/'.basename(__DIR__).'/'.basename(__FILE__);
|
||||||
|
}
|
||||||
|
|
||||||
|
return [];
|
16
lang/vendor/backpack/en/pagemanager.php
vendored
Normal file
16
lang/vendor/backpack/en/pagemanager.php
vendored
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// --------------------------------------------------------
|
||||||
|
// This is only a pointer file, not an actual language file
|
||||||
|
// --------------------------------------------------------
|
||||||
|
//
|
||||||
|
// If you've copied this file to your /resources/lang/vendor/backpack/
|
||||||
|
// folder, please delete it, it's no use there. You need to copy/publish the
|
||||||
|
// actual language file, from the package.
|
||||||
|
|
||||||
|
// If a langfile with the same name exists in the package, load that one
|
||||||
|
if (file_exists(__DIR__.'/../../../../../pagemanager/src/resources/lang/'.basename(__DIR__).'/'.basename(__FILE__))) {
|
||||||
|
return include __DIR__.'/../../../../../pagemanager/src/resources/lang/'.basename(__DIR__).'/'.basename(__FILE__);
|
||||||
|
}
|
||||||
|
|
||||||
|
return [];
|
16
lang/vendor/backpack/en/permissionmanager.php
vendored
Normal file
16
lang/vendor/backpack/en/permissionmanager.php
vendored
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// --------------------------------------------------------
|
||||||
|
// This is only a pointer file, not an actual language file
|
||||||
|
// --------------------------------------------------------
|
||||||
|
//
|
||||||
|
// If you've copied this file to your /resources/lang/vendor/backpack/
|
||||||
|
// folder, please delete it, it's no use there. You need to copy/publish the
|
||||||
|
// actual language file, from the package.
|
||||||
|
|
||||||
|
// If a langfile with the same name exists in the package, load that one
|
||||||
|
if (file_exists(__DIR__.'/../../../../../permissionmanager/src/resources/lang/'.basename(__DIR__).'/'.basename(__FILE__))) {
|
||||||
|
return include __DIR__.'/../../../../../permissionmanager/src/resources/lang/'.basename(__DIR__).'/'.basename(__FILE__);
|
||||||
|
}
|
||||||
|
|
||||||
|
return [];
|
16
lang/vendor/backpack/en/settings.php
vendored
Normal file
16
lang/vendor/backpack/en/settings.php
vendored
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// --------------------------------------------------------
|
||||||
|
// This is only a pointer file, not an actual language file
|
||||||
|
// --------------------------------------------------------
|
||||||
|
//
|
||||||
|
// If you've copied this file to your /resources/lang/vendor/backpack/
|
||||||
|
// folder, please delete it, it's no use there. You need to copy/publish the
|
||||||
|
// actual language file, from the package.
|
||||||
|
|
||||||
|
// If a langfile with the same name exists in the package, load that one
|
||||||
|
if (file_exists(__DIR__.'/../../../../../settings/src/resources/lang/'.basename(__DIR__).'/'.basename(__FILE__))) {
|
||||||
|
return include __DIR__.'/../../../../../settings/src/resources/lang/'.basename(__DIR__).'/'.basename(__FILE__);
|
||||||
|
}
|
||||||
|
|
||||||
|
return [];
|
16
lang/vendor/backpack/zh_TW/backup.php
vendored
Normal file
16
lang/vendor/backpack/zh_TW/backup.php
vendored
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// --------------------------------------------------------
|
||||||
|
// This is only a pointer file, not an actual language file
|
||||||
|
// --------------------------------------------------------
|
||||||
|
//
|
||||||
|
// If you've copied this file to your /resources/lang/vendor/backpack/
|
||||||
|
// folder, please delete it, it's no use there. You need to copy/publish the
|
||||||
|
// actual language file, from the package.
|
||||||
|
|
||||||
|
// If a langfile with the same name exists in the package, load that one
|
||||||
|
if (file_exists(__DIR__.'/../../../../../backupmanager/src/resources/lang/'.basename(__DIR__).'/'.basename(__FILE__))) {
|
||||||
|
return include __DIR__.'/../../../../../backupmanager/src/resources/lang/'.basename(__DIR__).'/'.basename(__FILE__);
|
||||||
|
}
|
||||||
|
|
||||||
|
return [];
|
115
lang/vendor/backpack/zh_TW/base.php
vendored
Normal file
115
lang/vendor/backpack/zh_TW/base.php
vendored
Normal file
@ -0,0 +1,115 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Backpack\Base Language Lines
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
'registration_closed' => '註冊功能已關閉',
|
||||||
|
'no_email_column' => '使用者沒有對應的 Email 地址。',
|
||||||
|
'first_page_you_see' => '這是你登入後第一個看到的頁面',
|
||||||
|
'login_status' => '登入狀態',
|
||||||
|
'logged_in' => '您已成功登入!',
|
||||||
|
'toggle_navigation' => '側邊欄開關',
|
||||||
|
'administration' => '管理',
|
||||||
|
'user' => '使用者',
|
||||||
|
'logout' => '登出',
|
||||||
|
'login' => '登入',
|
||||||
|
'register' => '註冊',
|
||||||
|
'name' => '名稱',
|
||||||
|
'email_address' => 'E-mail 地址',
|
||||||
|
'password' => '密碼',
|
||||||
|
'old_password' => '舊密碼',
|
||||||
|
'new_password' => '新密碼',
|
||||||
|
'confirm_password' => '再次輸入新密碼',
|
||||||
|
'remember_me' => '記住我',
|
||||||
|
'forgot_your_password' => '忘記密碼?',
|
||||||
|
'reset_password' => '重置密碼',
|
||||||
|
'send_reset_link' => '寄出密碼重置信',
|
||||||
|
'click_here_to_reset' => '按此重置密碼',
|
||||||
|
'change_password' => '修改密碼',
|
||||||
|
'unauthorized' => '未經授權的操作。',
|
||||||
|
'dashboard' => '儀表板',
|
||||||
|
'handcrafted_by' => '',
|
||||||
|
'powered_by' => 'Powered by',
|
||||||
|
'my_account' => '我的帳戶',
|
||||||
|
'update_account_info' => '更新帳戶資訊',
|
||||||
|
'save' => '儲存',
|
||||||
|
'cancel' => '取消',
|
||||||
|
'error' => '錯誤',
|
||||||
|
'success' => '成功',
|
||||||
|
'warning' => '警告',
|
||||||
|
'notice' => '注意',
|
||||||
|
'old_password_incorrect' => '舊密碼輸入不正確。',
|
||||||
|
'password_dont_match' => '密碼輸入不一致。',
|
||||||
|
'password_empty' => '請確認兩個密碼欄位皆有填寫。',
|
||||||
|
'password_updated' => '已更新密碼。',
|
||||||
|
'account_updated' => '已成功更新帳戶。',
|
||||||
|
'unknown_error' => '發生未知錯誤,請再試一次。',
|
||||||
|
'error_saving' => '儲存時發生錯誤,請再試一次。',
|
||||||
|
'welcome' => '歡迎使用!',
|
||||||
|
'use_sidebar' => '使用左方的側邊欄以新增、編輯或刪除內容。',
|
||||||
|
|
||||||
|
'error_page' => [
|
||||||
|
'title' => '錯誤 :error',
|
||||||
|
'button' => '返回首頁',
|
||||||
|
'message_4xx' => '請 <a :href_back>回上一頁</a> 或返回到 <a :href_homepage>首頁</a>.',
|
||||||
|
'message_500' => '發生內部伺服器錯誤。如果錯誤仍然存在,請聯絡開發團隊。',
|
||||||
|
'message_503' => '伺服器超載或停機維護。請稍後再試。',
|
||||||
|
'400' => '錯誤的請求。',
|
||||||
|
'401' => '未經授權的行為。',
|
||||||
|
'403' => '禁止。',
|
||||||
|
'404' => '找不到網頁。',
|
||||||
|
'405' => '方法不允許。',
|
||||||
|
'408' => '請求超時。',
|
||||||
|
'429' => '請求太多。',
|
||||||
|
'500' => '不是你而是我。',
|
||||||
|
],
|
||||||
|
|
||||||
|
'password_reset' => [
|
||||||
|
'greeting' => '您好!',
|
||||||
|
'subject' => '重置密碼通知',
|
||||||
|
'line_1' => '您會收到這封郵件,是因為我們收到了重置您帳戶密碼的請求。',
|
||||||
|
'line_2' => '請點擊下面的按鈕以重置您的密碼:',
|
||||||
|
'button' => '重置密碼',
|
||||||
|
'notice' => '若您沒有請求重置密碼,請忽略此右鍵。',
|
||||||
|
],
|
||||||
|
|
||||||
|
'step' => '步驟',
|
||||||
|
'confirm_email' => '確認 Email 地址',
|
||||||
|
'choose_new_password' => '新密碼',
|
||||||
|
'confirm_new_password' => '再次輸入新密碼',
|
||||||
|
'email' => '電子信箱',
|
||||||
|
|
||||||
|
'accounts' => [
|
||||||
|
'title' => '帳戶管理',
|
||||||
|
'users' => '使用者',
|
||||||
|
'roles' => '角色',
|
||||||
|
'permissions' => '權限',
|
||||||
|
],
|
||||||
|
|
||||||
|
'projects' => [
|
||||||
|
'title' => '案件管理',
|
||||||
|
'host' => '熱銷新案',
|
||||||
|
'classic' => '經典實績',
|
||||||
|
],
|
||||||
|
|
||||||
|
'news' => [
|
||||||
|
'title' => '新聞管理',
|
||||||
|
'catalogs' => '類別',
|
||||||
|
'list' => '文章',
|
||||||
|
],
|
||||||
|
|
||||||
|
'contact' => [
|
||||||
|
'title' => '客服專區',
|
||||||
|
],
|
||||||
|
|
||||||
|
'urban_renewal' => [
|
||||||
|
'contact' => '都更投件專區',
|
||||||
|
'cases' => '都更建案狀態說明',
|
||||||
|
'links' => '相關連結',
|
||||||
|
],
|
||||||
|
];
|
178
lang/vendor/backpack/zh_TW/crud.php
vendored
Normal file
178
lang/vendor/backpack/zh_TW/crud.php
vendored
Normal file
@ -0,0 +1,178 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Backpack Crud Language Lines
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| The following language lines are used by the CRUD interface.
|
||||||
|
| You are free to change them to anything
|
||||||
|
| you want to customize your views to better match your application.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Forms
|
||||||
|
'save_action_save_and_new' => '儲存並新增',
|
||||||
|
'save_action_save_and_edit' => '儲存並繼續編輯',
|
||||||
|
'save_action_save_and_back' => '儲存並返回',
|
||||||
|
'save_action_save_and_preview' => '儲存並預覽',
|
||||||
|
'save_action_changed_notification' => '儲存後的預設行為已更改。',
|
||||||
|
|
||||||
|
// Create form
|
||||||
|
'add' => '新增',
|
||||||
|
'back_to_all' => '回到所有的 ',
|
||||||
|
'cancel' => '取消',
|
||||||
|
'add_a_new' => '新增一個 ',
|
||||||
|
|
||||||
|
// Edit form
|
||||||
|
'edit' => '編輯',
|
||||||
|
'save' => '儲存',
|
||||||
|
|
||||||
|
// Translatable models
|
||||||
|
'edit_translations' => '翻譯',
|
||||||
|
'language' => '語言',
|
||||||
|
|
||||||
|
// CRUD table view
|
||||||
|
'all' => '全部 ',
|
||||||
|
'in_the_database' => '在資料庫中',
|
||||||
|
'list' => '清單',
|
||||||
|
'reset' => '重置',
|
||||||
|
'actions' => '動作',
|
||||||
|
'preview' => '預覽',
|
||||||
|
'delete' => '刪除',
|
||||||
|
'admin' => '管理員',
|
||||||
|
'details_row' => '這是詳細內容列。你可以在這裡作出編輯。',
|
||||||
|
'details_row_loading_error' => '當載入詳細內容時遇到錯誤。請重試。',
|
||||||
|
'clone' => '複製',
|
||||||
|
'clone_success' => '<strong>紀錄已複製</strong><br>與此紀錄內容一致的新紀錄已被新增。',
|
||||||
|
'clone_failure' => '<strong>紀錄複製失敗</strong><br>無法新增複製的紀錄,請稍後再試。',
|
||||||
|
|
||||||
|
// Confirmation messages and bubbles
|
||||||
|
'delete_confirm' => '您確定要刪除此紀錄嗎?',
|
||||||
|
'delete_confirmation_title' => '紀錄已刪除',
|
||||||
|
'delete_confirmation_message' => '此紀錄已成功地刪除。',
|
||||||
|
'delete_confirmation_not_title' => '紀錄未刪除',
|
||||||
|
'delete_confirmation_not_message' => '發生錯誤,您的紀錄有可能並未成功刪除。',
|
||||||
|
'delete_confirmation_not_deleted_title' => '紀錄未刪除',
|
||||||
|
'delete_confirmation_not_deleted_message' => '沒有任何事情發生過,您的紀錄依然存在。',
|
||||||
|
|
||||||
|
// Bulk actions
|
||||||
|
'bulk_no_entries_selected_title' => '沒有選擇任何紀錄',
|
||||||
|
'bulk_no_entries_selected_message' => '進行大量操作前,請選擇至少一項紀錄。',
|
||||||
|
|
||||||
|
// Bulk delete
|
||||||
|
'bulk_delete_are_you_sure' => '您確定要刪除 :number 項紀錄嗎?',
|
||||||
|
'bulk_delete_sucess_title' => '紀錄已刪除',
|
||||||
|
'bulk_delete_sucess_message' => ' 項紀錄已被刪除',
|
||||||
|
'bulk_delete_error_title' => '刪除失敗',
|
||||||
|
'bulk_delete_error_message' => '無法刪除一項或多項紀錄',
|
||||||
|
|
||||||
|
// Bulk clone
|
||||||
|
'bulk_clone_are_you_sure' => '您確定要複製 :number 項紀錄嗎?',
|
||||||
|
'bulk_clone_sucess_title' => '紀錄已複製',
|
||||||
|
'bulk_clone_sucess_message' => ' 項紀錄已被複製。',
|
||||||
|
'bulk_clone_error_title' => '複製失敗',
|
||||||
|
'bulk_clone_error_message' => '無法複製一項或多項紀錄,請稍後再試。',
|
||||||
|
|
||||||
|
// Ajax errors
|
||||||
|
'ajax_error_title' => '錯誤',
|
||||||
|
'ajax_error_text' => '載入頁面時發生錯誤,請重新整理頁面。',
|
||||||
|
|
||||||
|
// DataTables translation
|
||||||
|
'emptyTable' => '資料表中無任何紀錄',
|
||||||
|
'info' => '正在顯示 _TOTAL_ 項紀錄當中的第 _START_ 到 _END_ 項',
|
||||||
|
'infoEmpty' => '沒有紀錄',
|
||||||
|
'infoFiltered' => '(自 _TOTAL_ 項紀錄中篩選出來的紀錄)',
|
||||||
|
'infoPostFix' => '.',
|
||||||
|
'thousands' => ',',
|
||||||
|
'lengthMenu' => '每頁 _MENU_ 項紀錄',
|
||||||
|
'loadingRecords' => '正在載入...',
|
||||||
|
'processing' => '正在處理...',
|
||||||
|
'search' => '搜尋',
|
||||||
|
'zeroRecords' => '找不到符合的紀錄',
|
||||||
|
'paginate' => [
|
||||||
|
'first' => '第一頁',
|
||||||
|
'last' => '最後一頁',
|
||||||
|
'next' => '下一頁',
|
||||||
|
'previous' => '上一頁',
|
||||||
|
],
|
||||||
|
'aria' => [
|
||||||
|
'sortAscending' => ': 以由小到大的方式排列',
|
||||||
|
'sortDescending' => ': 以由大到小的方式排列',
|
||||||
|
],
|
||||||
|
'export' => [
|
||||||
|
'export' => '匯出',
|
||||||
|
'copy' => '複製',
|
||||||
|
'excel' => 'Excel',
|
||||||
|
'csv' => 'CSV',
|
||||||
|
'pdf' => 'PDF',
|
||||||
|
'print' => '列印',
|
||||||
|
'column_visibility' => '顯示欄位',
|
||||||
|
],
|
||||||
|
|
||||||
|
// global crud - errors
|
||||||
|
'unauthorized_access' => '未經授權的存取 - 您沒有權限瀏覽此頁面。',
|
||||||
|
'please_fix' => '請修正以下的錯誤:',
|
||||||
|
|
||||||
|
// global crud - success / error notification bubbles
|
||||||
|
'insert_success' => '已成功新增此紀錄。',
|
||||||
|
'update_success' => '已成功更新此紀錄。',
|
||||||
|
|
||||||
|
// CRUD reorder view
|
||||||
|
'reorder' => '重新排序',
|
||||||
|
'reorder_text' => '請以拖曳的方式重新排序。',
|
||||||
|
'reorder_success_title' => '完成',
|
||||||
|
'reorder_success_message' => '您的排序已被儲存。',
|
||||||
|
'reorder_error_title' => '錯誤',
|
||||||
|
'reorder_error_message' => '您的排序並未被儲存。',
|
||||||
|
|
||||||
|
// CRUD yes/no
|
||||||
|
'yes' => '確定',
|
||||||
|
'no' => '取消',
|
||||||
|
|
||||||
|
// CRUD filters navbar view
|
||||||
|
'filters' => '篩選',
|
||||||
|
'toggle_filters' => '切換篩選',
|
||||||
|
'remove_filters' => '移除篩選',
|
||||||
|
'apply' => '套用',
|
||||||
|
|
||||||
|
//filters language strings
|
||||||
|
'today' => '今天',
|
||||||
|
'yesterday' => '昨天',
|
||||||
|
'last_7_days' => '最近7天',
|
||||||
|
'last_30_days' => '最近30天',
|
||||||
|
'this_month' => '這個月',
|
||||||
|
'last_month' => '上個月',
|
||||||
|
'custom_range' => '自訂範圍',
|
||||||
|
'weekLabel' => '週',
|
||||||
|
|
||||||
|
// Fields
|
||||||
|
'browse_uploads' => '瀏覽已上傳的檔案',
|
||||||
|
'select_all' => '選擇全部',
|
||||||
|
'select_files' => '選擇檔案',
|
||||||
|
'select_file' => '選擇檔案',
|
||||||
|
'clear' => '清除',
|
||||||
|
'page_link' => '頁面連結',
|
||||||
|
'page_link_placeholder' => 'http://example.com/your-desired-page',
|
||||||
|
'internal_link' => '內部連結',
|
||||||
|
'internal_link_placeholder' => '內部連結短碼,例如: \':url\' 後面加上 \'admin/page\' (去掉引號)',
|
||||||
|
'external_link' => '外部連結',
|
||||||
|
'choose_file' => '選擇檔案',
|
||||||
|
'new_item' => '新項目',
|
||||||
|
'select_entry' => '選擇一個項目',
|
||||||
|
'select_entries' => '選擇多個項目',
|
||||||
|
'upload_multiple_files_selected' => '檔案已選取。等存檔之後,會在上方顯示上傳的檔案。',
|
||||||
|
|
||||||
|
//Table field
|
||||||
|
'table_cant_add' => '不能再增加 :entity',
|
||||||
|
'table_max_reached' => '已達到 :max 項紀錄的上限',
|
||||||
|
|
||||||
|
// File manager
|
||||||
|
'file_manager' => '檔案管理',
|
||||||
|
|
||||||
|
// InlineCreateOperation
|
||||||
|
'related_entry_created_success' => '相關的紀錄已被新增並選擇。',
|
||||||
|
'related_entry_created_error' => '無法新增相關的紀錄。',
|
||||||
|
];
|
16
lang/vendor/backpack/zh_TW/langfilemanager.php
vendored
Normal file
16
lang/vendor/backpack/zh_TW/langfilemanager.php
vendored
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// --------------------------------------------------------
|
||||||
|
// This is only a pointer file, not an actual language file
|
||||||
|
// --------------------------------------------------------
|
||||||
|
//
|
||||||
|
// If you've copied this file to your /resources/lang/vendor/backpack/
|
||||||
|
// folder, please delete it, it's no use there. You need to copy/publish the
|
||||||
|
// actual language file, from the package.
|
||||||
|
|
||||||
|
// If a langfile with the same name exists in the package, load that one
|
||||||
|
if (file_exists(__DIR__.'/../../../../../langfilemanager/src/resources/lang/'.basename(__DIR__).'/'.basename(__FILE__))) {
|
||||||
|
return include __DIR__.'/../../../../../langfilemanager/src/resources/lang/'.basename(__DIR__).'/'.basename(__FILE__);
|
||||||
|
}
|
||||||
|
|
||||||
|
return [];
|
16
lang/vendor/backpack/zh_TW/logmanager.php
vendored
Normal file
16
lang/vendor/backpack/zh_TW/logmanager.php
vendored
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// --------------------------------------------------------
|
||||||
|
// This is only a pointer file, not an actual language file
|
||||||
|
// --------------------------------------------------------
|
||||||
|
//
|
||||||
|
// If you've copied this file to your /resources/lang/vendor/backpack/
|
||||||
|
// folder, please delete it, it's no use there. You need to copy/publish the
|
||||||
|
// actual language file, from the package.
|
||||||
|
|
||||||
|
// If a langfile with the same name exists in the package, load that one
|
||||||
|
if (file_exists(__DIR__.'/../../../../../logmanager/src/resources/lang/'.basename(__DIR__).'/'.basename(__FILE__))) {
|
||||||
|
return include __DIR__.'/../../../../../logmanager/src/resources/lang/'.basename(__DIR__).'/'.basename(__FILE__);
|
||||||
|
}
|
||||||
|
|
||||||
|
return [];
|
16
lang/vendor/backpack/zh_TW/pagemanager.php
vendored
Normal file
16
lang/vendor/backpack/zh_TW/pagemanager.php
vendored
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// --------------------------------------------------------
|
||||||
|
// This is only a pointer file, not an actual language file
|
||||||
|
// --------------------------------------------------------
|
||||||
|
//
|
||||||
|
// If you've copied this file to your /resources/lang/vendor/backpack/
|
||||||
|
// folder, please delete it, it's no use there. You need to copy/publish the
|
||||||
|
// actual language file, from the package.
|
||||||
|
|
||||||
|
// If a langfile with the same name exists in the package, load that one
|
||||||
|
if (file_exists(__DIR__.'/../../../../../pagemanager/src/resources/lang/'.basename(__DIR__).'/'.basename(__FILE__))) {
|
||||||
|
return include __DIR__.'/../../../../../pagemanager/src/resources/lang/'.basename(__DIR__).'/'.basename(__FILE__);
|
||||||
|
}
|
||||||
|
|
||||||
|
return [];
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user