建置 20250523
This commit is contained in:
parent
41bc43e891
commit
dcb27b8c9c
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
|
67
.env.example
Normal file
67
.env.example
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
APP_NAME=Laravel
|
||||||
|
APP_ENV=local
|
||||||
|
APP_KEY=
|
||||||
|
APP_DEBUG=true
|
||||||
|
APP_TIMEZONE=Asia/Taipei
|
||||||
|
APP_URL=https://shop_12_wireui.test
|
||||||
|
L5_SWAGGER_CONST_HOST=https://shop_12_wireui.test/
|
||||||
|
|
||||||
|
APP_LOCALE=zh-tw
|
||||||
|
APP_FALLBACK_LOCALE=zh-tw
|
||||||
|
APP_FAKER_LOCALE=zh_TW
|
||||||
|
|
||||||
|
APP_MAINTENANCE_DRIVER=file
|
||||||
|
# APP_MAINTENANCE_STORE=database
|
||||||
|
|
||||||
|
PHP_CLI_SERVER_WORKERS=4
|
||||||
|
|
||||||
|
BCRYPT_ROUNDS=12
|
||||||
|
|
||||||
|
LOG_CHANNEL=stack
|
||||||
|
LOG_STACK=single
|
||||||
|
LOG_DEPRECATIONS_CHANNEL=null
|
||||||
|
LOG_LEVEL=debug
|
||||||
|
|
||||||
|
DB_CONNECTION=sqlite
|
||||||
|
# DB_HOST=127.0.0.1
|
||||||
|
# DB_PORT=3306
|
||||||
|
# DB_DATABASE=laravel
|
||||||
|
# DB_USERNAME=root
|
||||||
|
# DB_PASSWORD=
|
||||||
|
|
||||||
|
SESSION_DRIVER=database
|
||||||
|
SESSION_LIFETIME=120
|
||||||
|
SESSION_ENCRYPT=false
|
||||||
|
SESSION_PATH=/
|
||||||
|
SESSION_DOMAIN=null
|
||||||
|
|
||||||
|
BROADCAST_CONNECTION=log
|
||||||
|
FILESYSTEM_DISK=local
|
||||||
|
QUEUE_CONNECTION=database
|
||||||
|
|
||||||
|
CACHE_STORE=database
|
||||||
|
# CACHE_PREFIX=
|
||||||
|
|
||||||
|
MEMCACHED_HOST=127.0.0.1
|
||||||
|
|
||||||
|
REDIS_CLIENT=phpredis
|
||||||
|
REDIS_HOST=127.0.0.1
|
||||||
|
REDIS_PASSWORD=null
|
||||||
|
REDIS_PORT=6379
|
||||||
|
|
||||||
|
MAIL_MAILER=log
|
||||||
|
MAIL_SCHEME=null
|
||||||
|
MAIL_HOST=127.0.0.1
|
||||||
|
MAIL_PORT=2525
|
||||||
|
MAIL_USERNAME=null
|
||||||
|
MAIL_PASSWORD=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
|
||||||
|
|
||||||
|
VITE_APP_NAME="${APP_NAME}"
|
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
|
25
.gitignore
vendored
Normal file
25
.gitignore
vendored
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
/.phpunit.cache
|
||||||
|
/node_modules
|
||||||
|
/public/build
|
||||||
|
/public/hot
|
||||||
|
/public/storage
|
||||||
|
/storage/*.key
|
||||||
|
/storage/pail
|
||||||
|
/storage/api-docs/
|
||||||
|
/vendor
|
||||||
|
.env
|
||||||
|
.env.backup
|
||||||
|
.env.production
|
||||||
|
.phpactor.json
|
||||||
|
.phpunit.result.cache
|
||||||
|
Homestead.json
|
||||||
|
Homestead.yaml
|
||||||
|
npm-debug.log
|
||||||
|
yarn-error.log
|
||||||
|
/auth.json
|
||||||
|
/.fleet
|
||||||
|
/.idea
|
||||||
|
/.nova
|
||||||
|
/.vscode
|
||||||
|
/.zed
|
||||||
|
.DS_Store
|
20
app/Enums/Traits/HasLabels.php
Normal file
20
app/Enums/Traits/HasLabels.php
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Enums\Traits;
|
||||||
|
|
||||||
|
use Illuminate\Support\Collection;
|
||||||
|
|
||||||
|
trait HasLabels
|
||||||
|
{
|
||||||
|
public static function options(): Collection
|
||||||
|
{
|
||||||
|
return collect(self::cases())->mapWithKeys(function (self $case) {
|
||||||
|
return [$case->value => $case->labels()];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public function labelPowergridFilter(): string
|
||||||
|
{
|
||||||
|
return $this->labels();
|
||||||
|
}
|
||||||
|
}
|
26
app/Enums/UserGender.php
Normal file
26
app/Enums/UserGender.php
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Enums;
|
||||||
|
|
||||||
|
use App\Enums\Traits\HasLabels;
|
||||||
|
|
||||||
|
enum UserGender: string
|
||||||
|
{
|
||||||
|
use HasLabels;
|
||||||
|
|
||||||
|
case Male = 'male';
|
||||||
|
case Female = 'female';
|
||||||
|
case Other = 'other';
|
||||||
|
case Unset = 'unset';
|
||||||
|
|
||||||
|
// 返回對應的顯示文字
|
||||||
|
public function labels(): string
|
||||||
|
{
|
||||||
|
return match($this) {
|
||||||
|
self::Male => __('enums.user.gender.Male'),
|
||||||
|
self::Female => __('enums.user.gender.Female'),
|
||||||
|
self::Other => __('enums.user.gender.Other'),
|
||||||
|
self::Unset => __('enums.user.gender.Unset'),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
24
app/Enums/UserStatus.php
Normal file
24
app/Enums/UserStatus.php
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Enums;
|
||||||
|
|
||||||
|
use App\Enums\Traits\HasLabels;
|
||||||
|
|
||||||
|
enum UserStatus: int
|
||||||
|
{
|
||||||
|
use HasLabels;
|
||||||
|
|
||||||
|
case Active = 0; // 正常
|
||||||
|
case Suspended = 1; // 停權
|
||||||
|
case Deleting = 2; // 刪除中
|
||||||
|
|
||||||
|
// 返回對應的顯示文字
|
||||||
|
public function labels(): string
|
||||||
|
{
|
||||||
|
return match($this) {
|
||||||
|
self::Active => __('enums.user.status.Active'),
|
||||||
|
self::Suspended => __('enums.user.status.Suspended'),
|
||||||
|
self::Deleting => __('enums.user.status.Deleting'),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
27
app/Http/Controllers/Auth/VerifyEmailController.php
Normal file
27
app/Http/Controllers/Auth/VerifyEmailController.php
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Auth;
|
||||||
|
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use Illuminate\Auth\Events\Verified;
|
||||||
|
use Illuminate\Foundation\Auth\EmailVerificationRequest;
|
||||||
|
use Illuminate\Http\RedirectResponse;
|
||||||
|
|
||||||
|
class VerifyEmailController extends Controller
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Mark the authenticated user's email address as verified.
|
||||||
|
*/
|
||||||
|
public function __invoke(EmailVerificationRequest $request): RedirectResponse
|
||||||
|
{
|
||||||
|
if ($request->user()->hasVerifiedEmail()) {
|
||||||
|
return redirect()->intended(route('dashboard', absolute: false).'?verified=1');
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($request->user()->markEmailAsVerified()) {
|
||||||
|
event(new Verified($request->user()));
|
||||||
|
}
|
||||||
|
|
||||||
|
return redirect()->intended(route('dashboard', absolute: false).'?verified=1');
|
||||||
|
}
|
||||||
|
}
|
63
app/Http/Controllers/AuthController.php
Normal file
63
app/Http/Controllers/AuthController.php
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
use Illuminate\Support\Facades\Hash;
|
||||||
|
use App\Models\User;
|
||||||
|
use OpenApi\Annotations as OA;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @OA\Tag(
|
||||||
|
* name="Auth",
|
||||||
|
* description="用戶個人資料"
|
||||||
|
* )
|
||||||
|
*/
|
||||||
|
class AuthController extends Controller
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @OA\Get(
|
||||||
|
* path="/api/profile",
|
||||||
|
* summary="Get current user profile",
|
||||||
|
* tags={"Auth"},
|
||||||
|
* security={{"Authorization":{}}},
|
||||||
|
* @OA\Response(
|
||||||
|
* response=200,
|
||||||
|
* description="User profile",
|
||||||
|
* @OA\JsonContent(
|
||||||
|
* allOf={
|
||||||
|
* @OA\Schema(ref="#/components/schemas/ApiResponse"),
|
||||||
|
* @OA\Schema(
|
||||||
|
* @OA\Property(property="data", ref="#/components/schemas/User")
|
||||||
|
* )
|
||||||
|
* }
|
||||||
|
* )
|
||||||
|
* ),
|
||||||
|
* @OA\Response(
|
||||||
|
* response=401,
|
||||||
|
* description="Unauthorized",
|
||||||
|
* @OA\JsonContent(
|
||||||
|
* allOf={
|
||||||
|
* @OA\Schema(ref="#/components/schemas/ApiResponse"),
|
||||||
|
* @OA\Schema(
|
||||||
|
* @OA\Property(property="code", type="string", example="UNAUTHORIZED"),
|
||||||
|
* @OA\Property(property="message", type="string", example="Unauthorized"),
|
||||||
|
* @OA\Property(property="data", type="null")
|
||||||
|
* )
|
||||||
|
* }
|
||||||
|
* )
|
||||||
|
* ),
|
||||||
|
* @OA\Parameter(
|
||||||
|
* name="Accept",
|
||||||
|
* in="header",
|
||||||
|
* required=true,
|
||||||
|
* @OA\Schema(type="string", default="application/json")
|
||||||
|
* )
|
||||||
|
* )
|
||||||
|
*/
|
||||||
|
public function profile(Request $request)
|
||||||
|
{
|
||||||
|
return \App\Http\Responses\ApiResponse::success($request->user());
|
||||||
|
}
|
||||||
|
}
|
32
app/Http/Controllers/Controller.php
Normal file
32
app/Http/Controllers/Controller.php
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
|
||||||
|
use Illuminate\Foundation\Bus\DispatchesJobs;
|
||||||
|
use Illuminate\Foundation\Validation\ValidatesRequests;
|
||||||
|
use Illuminate\Routing\Controller as BaseController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @OA\Info(
|
||||||
|
* title="My API",
|
||||||
|
* version="1.0.0",
|
||||||
|
* description="API documentation using L5 Swagger"
|
||||||
|
* )
|
||||||
|
*
|
||||||
|
* @OA\Server(
|
||||||
|
* url=L5_SWAGGER_CONST_HOST,
|
||||||
|
* description="API Server"
|
||||||
|
* )
|
||||||
|
*
|
||||||
|
* @OA\SecurityScheme(
|
||||||
|
* securityScheme="Authorization",
|
||||||
|
* type="http",
|
||||||
|
* scheme="bearer",
|
||||||
|
* bearerFormat="JWT"
|
||||||
|
* )
|
||||||
|
*/
|
||||||
|
class Controller extends BaseController
|
||||||
|
{
|
||||||
|
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
|
||||||
|
}
|
45
app/Imports/DataImport.php
Normal file
45
app/Imports/DataImport.php
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Imports;
|
||||||
|
|
||||||
|
use Maatwebsite\Excel\Concerns\ToCollection;
|
||||||
|
use Maatwebsite\Excel\Concerns\WithHeadingRow;
|
||||||
|
use Maatwebsite\Excel\Concerns\WithChunkReading;
|
||||||
|
use Illuminate\Support\Collection;
|
||||||
|
use Maatwebsite\Excel\Imports\HeadingRowFormatter;
|
||||||
|
use Illuminate\Support\Facades\Log;
|
||||||
|
use App\Jobs\ImportUserChunkJob;
|
||||||
|
|
||||||
|
class DataImport implements ToCollection, WithHeadingRow, WithChunkReading
|
||||||
|
{
|
||||||
|
protected int $con=0;
|
||||||
|
protected string $modelName;
|
||||||
|
public function __construct(string $modelName)
|
||||||
|
{
|
||||||
|
HeadingRowFormatter::default('none');
|
||||||
|
$this->modelName= $modelName;
|
||||||
|
}
|
||||||
|
public function collection(Collection $rows)
|
||||||
|
{
|
||||||
|
|
||||||
|
Log::warning('匯入啟動', [
|
||||||
|
'model' => $this->modelName,
|
||||||
|
'rows_id' =>++$this->con,
|
||||||
|
'rows_count' => $rows->count()
|
||||||
|
]);
|
||||||
|
if($this->modelName=='User'){
|
||||||
|
ImportUserChunkJob::dispatch($rows,$this->con);
|
||||||
|
}else{
|
||||||
|
Log::warning('未知的 modelName', ['model' => $this->modelName]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public function chunkSize(): int
|
||||||
|
{
|
||||||
|
return 1000;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function headingRow(): int
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
59
app/Jobs/ImportJob.php
Normal file
59
app/Jobs/ImportJob.php
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Jobs;
|
||||||
|
|
||||||
|
use Illuminate\Bus\Queueable;
|
||||||
|
use Illuminate\Support\Facades\Storage;
|
||||||
|
use Maatwebsite\Excel\Facades\Excel;
|
||||||
|
use Illuminate\Queue\SerializesModels;
|
||||||
|
use Illuminate\Queue\InteractsWithQueue;
|
||||||
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||||
|
use Illuminate\Foundation\Bus\Dispatchable;
|
||||||
|
use Illuminate\Support\Facades\Log;
|
||||||
|
use App\Imports\DataImport;
|
||||||
|
|
||||||
|
class ImportJob implements ShouldQueue
|
||||||
|
{
|
||||||
|
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||||
|
|
||||||
|
protected string $modelName;
|
||||||
|
protected string $filePath;
|
||||||
|
public $timeout = 3600;
|
||||||
|
public $tries = 1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new job instance.
|
||||||
|
*/
|
||||||
|
public function __construct(string $filePath,string $modelName)
|
||||||
|
{
|
||||||
|
$this->filePath = $filePath;
|
||||||
|
$this->modelName= $modelName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Execute the job.
|
||||||
|
*/
|
||||||
|
public function handle(): void
|
||||||
|
{
|
||||||
|
ini_set('memory_limit', '512M'); // ✅ 增加記憶體限制
|
||||||
|
Log::info('[ImportJob] 開始處理檔案:' . $this->filePath);
|
||||||
|
|
||||||
|
try {
|
||||||
|
if (!Storage::exists($this->filePath)) {
|
||||||
|
Log::warning('[ImportJob] 檔案不存在:' . $this->filePath);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Excel::import(new DataImport($this->modelName), $this->filePath);
|
||||||
|
Log::info('[ImportJob] 已提交所有 chunk 匯入任務。');
|
||||||
|
|
||||||
|
Storage::delete($this->filePath);
|
||||||
|
Log::info('[ImportJob] 已刪除檔案:' . $this->filePath);
|
||||||
|
} catch (\Throwable $e) {
|
||||||
|
Log::error("[ImportJob] 匯入失敗:{$e->getMessage()}", [
|
||||||
|
'file' => $this->filePath,
|
||||||
|
'trace' => $e->getTraceAsString(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
67
app/Jobs/ImportUserChunkJob.php
Normal file
67
app/Jobs/ImportUserChunkJob.php
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Jobs;
|
||||||
|
|
||||||
|
use App\Models\User;
|
||||||
|
use Illuminate\Bus\Queueable;
|
||||||
|
use Illuminate\Queue\SerializesModels;
|
||||||
|
use Illuminate\Queue\InteractsWithQueue;
|
||||||
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||||
|
use Illuminate\Foundation\Bus\Dispatchable;
|
||||||
|
use Illuminate\Support\Collection;
|
||||||
|
use Illuminate\Support\Facades\Log;
|
||||||
|
|
||||||
|
class ImportUserChunkJob implements ShouldQueue
|
||||||
|
{
|
||||||
|
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||||
|
|
||||||
|
protected Collection $rows;
|
||||||
|
protected String $id;
|
||||||
|
|
||||||
|
public function __construct(Collection $rows,String $id)
|
||||||
|
{
|
||||||
|
$this->rows = $rows;
|
||||||
|
$this->id = $id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function handle(): void
|
||||||
|
{
|
||||||
|
Log::warning('匯入啟動', [
|
||||||
|
'model' => "ImportUserChunkJob",
|
||||||
|
'rows_id' =>$this->id,
|
||||||
|
]);
|
||||||
|
$now = now();
|
||||||
|
foreach ($this->rows as $index => $row) {
|
||||||
|
try {
|
||||||
|
$name = $this->normalizeName($row['歌手姓名'] ?? '');
|
||||||
|
|
||||||
|
if (empty($name) || User::where('name', $name)->exists()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
// 準備 song 資料
|
||||||
|
$toInsert[] = [
|
||||||
|
'name' => $name,
|
||||||
|
'category' => ArtistCategory::tryFrom(trim($row['歌手分類'] ?? '未定義')) ?? ArtistCategory::Unset,
|
||||||
|
'simplified' => $simplified,
|
||||||
|
'phonetic_abbr' => $phoneticAbbr,
|
||||||
|
'pinyin_abbr' => $pinyinAbbr,
|
||||||
|
'strokes_abbr' => $strokesAbbr,
|
||||||
|
'enable' =>trim($row['狀態'] ?? 1),
|
||||||
|
'created_at' => $now,
|
||||||
|
'updated_at' => $now,
|
||||||
|
];
|
||||||
|
} catch (\Throwable $e) {
|
||||||
|
\Log::error("Row {$index} failed: {$e->getMessage()}", [
|
||||||
|
'row' => $row,
|
||||||
|
'trace' => $e->getTraceAsString()
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
User::insert($toInsert);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function normalizeName(?string $str): string
|
||||||
|
{
|
||||||
|
return strtoupper(mb_convert_kana(trim($str ?? ''), 'as'));
|
||||||
|
}
|
||||||
|
}
|
20
app/Livewire/Actions/Logout.php
Normal file
20
app/Livewire/Actions/Logout.php
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Livewire\Actions;
|
||||||
|
|
||||||
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
use Illuminate\Support\Facades\Session;
|
||||||
|
|
||||||
|
class Logout
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Log the current user out of the application.
|
||||||
|
*/
|
||||||
|
public function __invoke(): void
|
||||||
|
{
|
||||||
|
Auth::guard('web')->logout();
|
||||||
|
|
||||||
|
Session::invalidate();
|
||||||
|
Session::regenerateToken();
|
||||||
|
}
|
||||||
|
}
|
120
app/Livewire/Admin/ActivityLogTable.php
Normal file
120
app/Livewire/Admin/ActivityLogTable.php
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Livewire\Admin;
|
||||||
|
|
||||||
|
use App\Models\ActivityLog;
|
||||||
|
use Illuminate\Support\Carbon;
|
||||||
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
|
use PowerComponents\LivewirePowerGrid\Column;
|
||||||
|
use PowerComponents\LivewirePowerGrid\Facades\Filter;
|
||||||
|
use PowerComponents\LivewirePowerGrid\Facades\PowerGrid;
|
||||||
|
use PowerComponents\LivewirePowerGrid\PowerGridFields;
|
||||||
|
use PowerComponents\LivewirePowerGrid\PowerGridComponent;
|
||||||
|
use PowerComponents\LivewirePowerGrid\Traits\WithExport;
|
||||||
|
use PowerComponents\LivewirePowerGrid\Components\SetUp\Exportable;
|
||||||
|
use Spatie\Activitylog\Models\Activity;
|
||||||
|
|
||||||
|
|
||||||
|
final class ActivityLogTable extends PowerGridComponent
|
||||||
|
{
|
||||||
|
use WithExport;
|
||||||
|
public string $tableName = 'activity-log-table';
|
||||||
|
public bool $canDownload;
|
||||||
|
|
||||||
|
public bool $showFilters = false;
|
||||||
|
public function boot(): void
|
||||||
|
{
|
||||||
|
config(['livewire-powergrid.filter' => 'outside']);
|
||||||
|
//權限設定
|
||||||
|
$this->canDownload=true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setUp(): array
|
||||||
|
{
|
||||||
|
if($this->canDownload ){
|
||||||
|
$this->showCheckBox();
|
||||||
|
}
|
||||||
|
$actions = [];
|
||||||
|
if($this->canDownload){
|
||||||
|
$actions[]=PowerGrid::exportable(fileName: $this->tableName.'-file')
|
||||||
|
->type(Exportable::TYPE_XLS, Exportable::TYPE_CSV);
|
||||||
|
}
|
||||||
|
$header = PowerGrid::header()
|
||||||
|
->withoutLoading()
|
||||||
|
->showToggleColumns();
|
||||||
|
//->showSoftDeletes()
|
||||||
|
//->showSearchInput()
|
||||||
|
$header->includeViewOnTop('livewire.admin.activity-log-header');
|
||||||
|
|
||||||
|
$actions[]=$header;
|
||||||
|
$actions[]=PowerGrid::footer()->showPerPage()->showRecordCount();
|
||||||
|
return $actions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function datasource(): Builder
|
||||||
|
{
|
||||||
|
return Activity::with(['causer'])->latest();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function relationSearch(): array
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function fields(): PowerGridFields
|
||||||
|
{
|
||||||
|
return PowerGrid::fields()
|
||||||
|
->add('id')
|
||||||
|
->add('created_at_formatted', fn (Activity $model) => Carbon::parse($model->created_at)->format('Y-m-d H:i:s'))
|
||||||
|
->add('causer_name', fn (Activity $model) => optional($model->causer)->name)
|
||||||
|
->add('subject_type_label', fn (Activity $model) => class_basename($model->subject_type))
|
||||||
|
->add('subject_type')
|
||||||
|
->add('subject_id')
|
||||||
|
->add('description')
|
||||||
|
->add('changes_str', function (Activity $model) {
|
||||||
|
$old = $model->properties['old'] ?? [];
|
||||||
|
$new = $model->properties['attributes'] ?? [];
|
||||||
|
|
||||||
|
$changes = [];
|
||||||
|
|
||||||
|
foreach ($new as $key => $newValue) {
|
||||||
|
if (in_array($key, ['updated_at', 'created_at'])) continue;
|
||||||
|
$oldValue = $old[$key] ?? '(空)';
|
||||||
|
if ($newValue != $oldValue) {
|
||||||
|
$changes[] = "<strong>{$key}</strong>: {$oldValue} → {$newValue}";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//dd(implode('<br>', $changes));
|
||||||
|
return implode('<br>', $changes);
|
||||||
|
})
|
||||||
|
;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function columns(): array
|
||||||
|
{
|
||||||
|
$column=[];
|
||||||
|
$column[]=Column::make('時間', 'created_at_formatted', 'created_at')->sortable()->searchable();
|
||||||
|
$column[]=Column::make('操作者', 'causer_name')->sortable()->searchable()->bodyAttribute('whitespace-nowrap');
|
||||||
|
$column[]=Column::make('模型', 'subject_type_label')->sortable()->searchable();
|
||||||
|
$column[]=Column::make('模型 ID', 'subject_id')->sortable()->searchable();
|
||||||
|
$column[]=Column::make('動作', 'description')->sortable()->searchable();
|
||||||
|
$column[]=Column::make('變更內容', 'changes_str')->sortable(false)->searchable(false)->bodyAttribute('whitespace-normal text-sm text-gray-700');
|
||||||
|
return $column;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function filters(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Filter::datetimepicker('created_at'),
|
||||||
|
Filter::inputText('causer_name')->placeholder('操作者'),
|
||||||
|
Filter::inputText('subject_type_label')->placeholder('模型'),
|
||||||
|
Filter::number('subject_id'),
|
||||||
|
Filter::inputText('description')->placeholder('動作'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
16
app/Livewire/Admin/Dashboard.php
Normal file
16
app/Livewire/Admin/Dashboard.php
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Livewire\Admin;
|
||||||
|
|
||||||
|
use Livewire\Component;
|
||||||
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
|
||||||
|
class Dashboard extends Component
|
||||||
|
{
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
$user = Auth::user();
|
||||||
|
|
||||||
|
return view('livewire.admin.dashboard', compact('user'));
|
||||||
|
}
|
||||||
|
}
|
114
app/Livewire/Admin/RoleForm.php
Normal file
114
app/Livewire/Admin/RoleForm.php
Normal file
@ -0,0 +1,114 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Livewire\Admin;
|
||||||
|
|
||||||
|
use Illuminate\Validation\Rule;
|
||||||
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
|
||||||
|
use Livewire\Component;
|
||||||
|
use WireUi\Traits\WireUiActions;
|
||||||
|
|
||||||
|
use Spatie\Permission\Models\Role;
|
||||||
|
use Spatie\Permission\Models\Permission;
|
||||||
|
|
||||||
|
class RoleForm extends Component
|
||||||
|
{
|
||||||
|
use WireUiActions;
|
||||||
|
|
||||||
|
protected $listeners = ['openCreateRoleModal','openEditRoleModal', 'deleteRole'];
|
||||||
|
|
||||||
|
public bool $canCreate;
|
||||||
|
public bool $canEdit;
|
||||||
|
public bool $canDelect;
|
||||||
|
|
||||||
|
public $showCreateModal=false;
|
||||||
|
public ?int $roleId = null;
|
||||||
|
public $name = '';
|
||||||
|
public $permissions = []; // 所有權限清單
|
||||||
|
public $selectedPermissions = []; // 表單中選到的權限
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public function mount()
|
||||||
|
{
|
||||||
|
$this->permissions = Permission::all();
|
||||||
|
$this->canCreate = Auth::user()?->can('role-edit') ?? false;
|
||||||
|
$this->canEdit = Auth::user()?->can('role-edit') ?? false;
|
||||||
|
$this->canDelect = Auth::user()?->can('role-delete') ?? false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function openCreateRoleModal()
|
||||||
|
{
|
||||||
|
$this->resetFields();
|
||||||
|
$this->showCreateModal = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function openEditRoleModal($id)
|
||||||
|
{
|
||||||
|
$role = Role::findOrFail($id);
|
||||||
|
$this->roleId = $role->id;
|
||||||
|
$this->name = $role->name;
|
||||||
|
$this->selectedPermissions = $role->permissions()->pluck('id')->toArray();
|
||||||
|
$this->showCreateModal = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function save()
|
||||||
|
{
|
||||||
|
$this->validate([
|
||||||
|
'name' => 'required|string|max:255',
|
||||||
|
'selectedPermissions' => 'array',
|
||||||
|
]);
|
||||||
|
|
||||||
|
if ($this->roleId) {
|
||||||
|
if ($this->canEdit) {
|
||||||
|
$role = Role::findOrFail($this->roleId);
|
||||||
|
$role->update(['name' => $this->name]);
|
||||||
|
$role->syncPermissions($this->selectedPermissions);
|
||||||
|
$this->notification()->send([
|
||||||
|
'icon' => 'success',
|
||||||
|
'title' => '成功',
|
||||||
|
'description' => '角色已更新',
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if ($this->canCreate) {
|
||||||
|
$role = Role::create(['name' => $this->name]);
|
||||||
|
$role->syncPermissions($this->selectedPermissions);
|
||||||
|
$this->notification()->send([
|
||||||
|
'icon' => 'success',
|
||||||
|
'title' => '成功',
|
||||||
|
'description' => '角色已新增',
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->resetFields();
|
||||||
|
$this->showCreateModal = false;
|
||||||
|
$this->dispatch('pg:eventRefresh-role-table');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function deleteRole($id)
|
||||||
|
{
|
||||||
|
if ($this->canDelect) {
|
||||||
|
Role::findOrFail($id)->delete();
|
||||||
|
$this->notification()->send([
|
||||||
|
'icon' => 'success',
|
||||||
|
'title' => '成功',
|
||||||
|
'description' => '角色已刪除',
|
||||||
|
]);
|
||||||
|
$this->dispatch('pg:eventRefresh-role-table');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function resetFields()
|
||||||
|
{
|
||||||
|
$this->name = '';
|
||||||
|
$this->selectedPermissions = [];
|
||||||
|
$this->roleId = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
return view('livewire.admin.role-form');
|
||||||
|
}
|
||||||
|
}
|
181
app/Livewire/Admin/RoleTable.php
Normal file
181
app/Livewire/Admin/RoleTable.php
Normal file
@ -0,0 +1,181 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Livewire\Admin;
|
||||||
|
|
||||||
|
use Spatie\Permission\Models\Role;
|
||||||
|
use Spatie\Permission\Models\Permission;
|
||||||
|
use Illuminate\Support\Carbon;
|
||||||
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
|
use PowerComponents\LivewirePowerGrid\Button;
|
||||||
|
use PowerComponents\LivewirePowerGrid\Column;
|
||||||
|
use PowerComponents\LivewirePowerGrid\Facades\Filter;
|
||||||
|
use PowerComponents\LivewirePowerGrid\Facades\PowerGrid;
|
||||||
|
use PowerComponents\LivewirePowerGrid\PowerGridFields;
|
||||||
|
use PowerComponents\LivewirePowerGrid\PowerGridComponent;
|
||||||
|
use Livewire\Attributes\On;
|
||||||
|
use WireUi\Traits\WireUiActions;
|
||||||
|
|
||||||
|
final class RoleTable extends PowerGridComponent
|
||||||
|
{
|
||||||
|
use WireUiActions;
|
||||||
|
|
||||||
|
public string $tableName = 'role-table';
|
||||||
|
public bool $canCreate;
|
||||||
|
public bool $canEdit;
|
||||||
|
public bool $canDelect;
|
||||||
|
|
||||||
|
public function boot(): void
|
||||||
|
{
|
||||||
|
config(['livewire-powergrid.filter' => 'outside']);
|
||||||
|
//權限設定
|
||||||
|
$this->canCreate = Auth::user()?->can('role-edit') ?? false;
|
||||||
|
$this->canEdit = Auth::user()?->can('role-edit') ?? false;
|
||||||
|
$this->canDelect = Auth::user()?->can('role-delete') ?? false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setUp(): array
|
||||||
|
{
|
||||||
|
if($this->canDelect){
|
||||||
|
$this->showCheckBox();
|
||||||
|
}
|
||||||
|
$actions = [];
|
||||||
|
$header =PowerGrid::header();
|
||||||
|
if($this->canCreate){
|
||||||
|
$header->includeViewOnTop('livewire.admin.role-header');
|
||||||
|
}
|
||||||
|
$actions[]=$header;
|
||||||
|
$actions[]=PowerGrid::footer()
|
||||||
|
->showPerPage()
|
||||||
|
->showRecordCount();
|
||||||
|
return $actions;
|
||||||
|
}
|
||||||
|
public function header(): array
|
||||||
|
{
|
||||||
|
$actions = [];
|
||||||
|
if ($this->canDelect) {
|
||||||
|
$actions[]=Button::add('bulk-delete')
|
||||||
|
->slot('Bulk delete (<span x-text="window.pgBulkActions.count(\'' . $this->tableName . '\')"></span>)')
|
||||||
|
->icon('solid-trash',['id' => 'my-custom-icon-id', 'class' => 'font-bold'])
|
||||||
|
->class('inline-flex items-center gap-1 px-3 py-1 rounded ')
|
||||||
|
->dispatch('bulkDelete.' . $this->tableName, []);
|
||||||
|
}
|
||||||
|
return $actions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function datasource(): Builder
|
||||||
|
{
|
||||||
|
//dd(Role::with('permissions'));
|
||||||
|
return Role::with('permissions');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function relationSearch(): array
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function fields(): PowerGridFields
|
||||||
|
{
|
||||||
|
$allPermissions = Permission::pluck('name')->sort()->values();
|
||||||
|
return PowerGrid::fields()
|
||||||
|
->add('id')
|
||||||
|
->add('name')
|
||||||
|
->add('permissions_list', function (Role $model) use ($allPermissions) {
|
||||||
|
$rolePermissions = $model->permissions->pluck('name')->sort()->values();
|
||||||
|
|
||||||
|
if ($rolePermissions->count() === $allPermissions->count() && $rolePermissions->values()->all() === $allPermissions->values()->all()) {
|
||||||
|
return 'all';
|
||||||
|
}
|
||||||
|
|
||||||
|
return $rolePermissions->implode(', ');
|
||||||
|
})
|
||||||
|
->add('created_at_formatted', fn (Role $model) => Carbon::parse($model->created_at)->format('Y-m-d H:i:s'));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function columns(): array
|
||||||
|
{
|
||||||
|
$column=[];
|
||||||
|
$column[]=Column::make(__('roles.no'), 'id')->sortable()->searchable();
|
||||||
|
$column[]=Column::make(__('roles.name'), 'name')->sortable()->searchable()
|
||||||
|
->editOnClick(
|
||||||
|
hasPermission: $this->canEdit,
|
||||||
|
dataField: 'name',
|
||||||
|
fallback: 'N/A',
|
||||||
|
saveOnMouseOut: true
|
||||||
|
);
|
||||||
|
$column[]=Column::make(__('roles.permissions'), 'permissions_list');
|
||||||
|
$column[]=Column::make('Created at', 'created_at_formatted', 'created_at')->sortable();
|
||||||
|
$column[]=Column::action('Action');
|
||||||
|
return $column;
|
||||||
|
}
|
||||||
|
#[On('bulkDelete.{tableName}')]
|
||||||
|
public function bulkDelete(): void
|
||||||
|
{
|
||||||
|
if ($this->canDelect) {
|
||||||
|
$this->js('alert(window.pgBulkActions.get(\'' . $this->tableName . '\'))');
|
||||||
|
if($this->checkboxValues){
|
||||||
|
Role::destroy($this->checkboxValues);
|
||||||
|
$this->js('window.pgBulkActions.clearAll()'); // clear the count on the interface.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#[On('onUpdatedEditable')]
|
||||||
|
public function onUpdatedEditable($id, $field, $value): void
|
||||||
|
{
|
||||||
|
if ($field === 'name' && $this->canEdit) {
|
||||||
|
$this->noUpdated($id,$field,$value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private function noUpdated($id,$field,$value){
|
||||||
|
$role = Role::find($id);
|
||||||
|
if ($role) {
|
||||||
|
$role->{$field} = $value;
|
||||||
|
$role->save(); // 明確觸發 saving
|
||||||
|
}
|
||||||
|
$this->notification()->send([
|
||||||
|
'icon' => 'success',
|
||||||
|
'title' => $id.'.'.__('roles.'.$field).':'.$value,
|
||||||
|
'description' => '已經寫入',
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
public function filters(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Filter::inputText('name')->placeholder(__('roles.name')),
|
||||||
|
Filter::datetimepicker('created_at'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function actions(Role $row): array
|
||||||
|
{
|
||||||
|
$actions = [];
|
||||||
|
if ($this->canEdit) {
|
||||||
|
$actions[] =Button::add('edit')
|
||||||
|
->slot(__('roles.edit'))
|
||||||
|
->icon('solid-pencil-square')
|
||||||
|
->class('inline-flex items-center gap-1 px-3 py-1 rounded ')
|
||||||
|
->dispatchTo('admin.role-form', 'openEditRoleModal', ['id' => $row->id]);
|
||||||
|
}
|
||||||
|
if($this->canDelect){
|
||||||
|
$actions[] =Button::add('delete')
|
||||||
|
->slot(__('roles.delete'))
|
||||||
|
->icon('solid-trash')
|
||||||
|
->class('inline-flex items-center gap-1 px-3 py-1 rounded ')
|
||||||
|
->dispatchTo('admin.role-form', 'deleteRole', ['id' => $row->id]);
|
||||||
|
}
|
||||||
|
return $actions;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
public function actionRules($row): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
// Hide button edit for ID 1
|
||||||
|
Rule::button('edit')
|
||||||
|
->when(fn($row) => $row->id === 1)
|
||||||
|
->hide(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
}
|
153
app/Livewire/Admin/UserForm.php
Normal file
153
app/Livewire/Admin/UserForm.php
Normal file
@ -0,0 +1,153 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Livewire\Admin;
|
||||||
|
|
||||||
|
use Illuminate\Validation\Rule;
|
||||||
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
|
||||||
|
use Livewire\Component;
|
||||||
|
use WireUi\Traits\WireUiActions;
|
||||||
|
|
||||||
|
use App\Models\User;
|
||||||
|
use App\Enums\UserGender;
|
||||||
|
use App\Enums\UserStatus;
|
||||||
|
use Spatie\Permission\Models\Role;
|
||||||
|
|
||||||
|
class UserForm extends Component
|
||||||
|
{
|
||||||
|
use WireUiActions;
|
||||||
|
|
||||||
|
protected $listeners = ['openModal','closeModal', 'deleteUser'];
|
||||||
|
|
||||||
|
public bool $canCreate;
|
||||||
|
public bool $canEdit;
|
||||||
|
public bool $canDelect;
|
||||||
|
|
||||||
|
public bool $showModal = false;
|
||||||
|
|
||||||
|
public array $genderOptions =[];
|
||||||
|
public array $statusOptions =[];
|
||||||
|
public $rolesOptions = []; // 所有角色清單
|
||||||
|
public $selectedRoles = []; // 表單中選到的權限
|
||||||
|
public ?int $userId = null;
|
||||||
|
public array $fields = [
|
||||||
|
'name' =>'',
|
||||||
|
'email' => '',
|
||||||
|
'phone' => '',
|
||||||
|
'birthday' => '',
|
||||||
|
'gender' => 'unset',
|
||||||
|
'status' => 0,
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
protected $rules = [
|
||||||
|
'fields.name' => 'required|string|max:255',
|
||||||
|
'fields.email' => 'required|string|email|max:255',
|
||||||
|
'fields.phone' => 'nullable|regex:/^09\d{8}$/',
|
||||||
|
'fields.birthday' =>'nullable|date',
|
||||||
|
'fields.gender' => 'required|in:male,female,other,unset',
|
||||||
|
'fields.status' => 'required|integer|in:0,1,2',
|
||||||
|
];
|
||||||
|
|
||||||
|
public function mount()
|
||||||
|
{
|
||||||
|
$this->fields['birthday'] = now()->toDateString();
|
||||||
|
$this->genderOptions = collect(UserGender::cases())->map(fn ($gender) => [
|
||||||
|
'name' => $gender->labels(),
|
||||||
|
'value' => $gender->value,
|
||||||
|
])->toArray();
|
||||||
|
$this->statusOptions = collect(UserStatus::cases())->map(fn ($status) => [
|
||||||
|
'name' => $status->labels(),
|
||||||
|
'value' => $status->value,
|
||||||
|
])->toArray();
|
||||||
|
$this->rolesOptions = Role::all();
|
||||||
|
$this->canCreate = Auth::user()?->can('user-edit') ?? false;
|
||||||
|
$this->canEdit = Auth::user()?->can('user-edit') ?? false;
|
||||||
|
$this->canDelect = Auth::user()?->can('user-delete') ?? false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function openModal($id = null)
|
||||||
|
{
|
||||||
|
$this->resetFields();
|
||||||
|
if($id){
|
||||||
|
$obj = User::findOrFail($id);
|
||||||
|
$this->userId = $obj->id;
|
||||||
|
$this->fields = $obj->only(array_keys($this->fields));
|
||||||
|
$this->selectedRoles = $obj->roles()->pluck('id')->toArray();
|
||||||
|
}
|
||||||
|
$this->showModal = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function closeModal()
|
||||||
|
{
|
||||||
|
$this->resetFields();
|
||||||
|
$this->showModal = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function save()
|
||||||
|
{
|
||||||
|
//$this->validate();
|
||||||
|
|
||||||
|
if ($this->userId) {
|
||||||
|
if ($this->canEdit) {
|
||||||
|
$obj = User::findOrFail($this->userId);
|
||||||
|
$obj->update($this->fields);
|
||||||
|
$obj->syncRoles($this->selectedRoles);
|
||||||
|
$this->notification()->send([
|
||||||
|
'icon' => 'success',
|
||||||
|
'title' => '成功',
|
||||||
|
'description' => '使用者已更新',
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if ($this->canCreate) {
|
||||||
|
$obj = User::create($this->fields);
|
||||||
|
$obj->syncRoles($this->selectedRoles);
|
||||||
|
$this->notification()->send([
|
||||||
|
'icon' => 'success',
|
||||||
|
'title' => '成功',
|
||||||
|
'description' => '使用者已新增',
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->resetFields();
|
||||||
|
$this->showModal = false;
|
||||||
|
$this->dispatch('pg:eventRefresh-user-table');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function deleteUser($id)
|
||||||
|
{
|
||||||
|
if ($this->canDelect) {
|
||||||
|
User::findOrFail($id)->delete();
|
||||||
|
$this->notification()->send([
|
||||||
|
'icon' => 'success',
|
||||||
|
'title' => '成功',
|
||||||
|
'description' => '使用者已刪除',
|
||||||
|
]);
|
||||||
|
$this->dispatch('pg:eventRefresh-user-table');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function resetFields()
|
||||||
|
{
|
||||||
|
foreach ($this->fields as $key => $value) {
|
||||||
|
if ($key == 'gender') {
|
||||||
|
$this->fields[$key] = 'unset';
|
||||||
|
} elseif ($key == 'status') {
|
||||||
|
$this->fields[$key] = 0;
|
||||||
|
} elseif ($key == 'birthday') {
|
||||||
|
$this->fields[$key] = now()->toDateString();
|
||||||
|
} else {
|
||||||
|
$this->fields[$key] = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$this->userId = null;
|
||||||
|
$this->selectedRoles = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
return view('livewire.admin.user-form');
|
||||||
|
}
|
||||||
|
}
|
114
app/Livewire/Admin/UserImportData.php
Normal file
114
app/Livewire/Admin/UserImportData.php
Normal file
@ -0,0 +1,114 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Livewire\Admin;
|
||||||
|
|
||||||
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
use Illuminate\Support\Facades\Storage;
|
||||||
|
use Illuminate\Support\Facades\File;
|
||||||
|
use WireUi\Traits\WireUiActions;
|
||||||
|
use Livewire\Component;
|
||||||
|
use Livewire\WithFileUploads;
|
||||||
|
use App\Jobs\ImportJob;
|
||||||
|
|
||||||
|
|
||||||
|
class UserImportData extends Component
|
||||||
|
{
|
||||||
|
use WithFileUploads, WireUiActions;
|
||||||
|
|
||||||
|
protected $listeners = ['openModal','closeModal'];
|
||||||
|
|
||||||
|
public bool $canCreate;
|
||||||
|
|
||||||
|
public bool $showModal = false;
|
||||||
|
|
||||||
|
public $file;
|
||||||
|
public string $maxUploadSize;
|
||||||
|
|
||||||
|
public function mount()
|
||||||
|
{
|
||||||
|
$this->canCreate = Auth::user()?->can('user-edit') ?? false;
|
||||||
|
$this->maxUploadSize = $this->getMaxUploadSize();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function openModal()
|
||||||
|
{
|
||||||
|
$this->showModal = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function closeModal()
|
||||||
|
{
|
||||||
|
$this->deleteTmpFile(); // 關閉 modal 時刪除暫存檔案
|
||||||
|
$this->reset(['file']);
|
||||||
|
$this->showModal = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function import()
|
||||||
|
{
|
||||||
|
// 檢查檔案是否有上傳
|
||||||
|
$this->validate([
|
||||||
|
'file' => 'required|file|mimes:csv,xlsx,xls'
|
||||||
|
]);
|
||||||
|
if ($this->canCreate) {
|
||||||
|
// 儲存檔案至 storage
|
||||||
|
$path = $this->file->storeAs('imports', uniqid() . '_' . $this->file->getClientOriginalName());
|
||||||
|
|
||||||
|
// 丟到 queue 執行
|
||||||
|
ImportJob::dispatch($path,'User');
|
||||||
|
|
||||||
|
$this->notification()->send([
|
||||||
|
'icon' => 'info',
|
||||||
|
'title' => $this->file->getClientOriginalName(),
|
||||||
|
'description' => '已排入背景匯入作業,請稍候查看結果',
|
||||||
|
]);
|
||||||
|
$this->deleteTmpFile(); // 匯入後也順便刪除 tmp 檔
|
||||||
|
$this->reset(['file']);
|
||||||
|
$this->showModal = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
protected function deleteTmpFile()
|
||||||
|
{
|
||||||
|
if($this->file!=null){
|
||||||
|
$Path = $this->file->getRealPath();
|
||||||
|
if ($Path && File::exists($Path)) {
|
||||||
|
File::delete($Path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getMaxUploadSize(): string
|
||||||
|
{
|
||||||
|
$uploadMax = $this->convertPHPSizeToBytes(ini_get('upload_max_filesize'));
|
||||||
|
$postMax = $this->convertPHPSizeToBytes(ini_get('post_max_size'));
|
||||||
|
$max = min($uploadMax, $postMax);
|
||||||
|
return $this->humanFileSize($max);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function convertPHPSizeToBytes(string $s): int
|
||||||
|
{
|
||||||
|
$s = trim($s);
|
||||||
|
$unit = strtolower($s[strlen($s) - 1]);
|
||||||
|
$bytes = (int) $s;
|
||||||
|
switch ($unit) {
|
||||||
|
case 'g':
|
||||||
|
$bytes *= 1024;
|
||||||
|
case 'm':
|
||||||
|
$bytes *= 1024;
|
||||||
|
case 'k':
|
||||||
|
$bytes *= 1024;
|
||||||
|
}
|
||||||
|
return $bytes;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function humanFileSize(int $bytes, int $decimals = 2): string
|
||||||
|
{
|
||||||
|
$sizes = ['B', 'KB', 'MB', 'GB'];
|
||||||
|
$factor = floor((strlen((string) $bytes) - 1) / 3);
|
||||||
|
return sprintf("%.{$decimals}f", $bytes / pow(1024, $factor)) . $sizes[$factor];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
return view('livewire.admin.user-import-data');
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
265
app/Livewire/Admin/UserTable.php
Normal file
265
app/Livewire/Admin/UserTable.php
Normal file
@ -0,0 +1,265 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Livewire\Admin;
|
||||||
|
|
||||||
|
use App\Models\User;
|
||||||
|
use App\Enums\UserGender;
|
||||||
|
use App\Enums\UserStatus;
|
||||||
|
use Illuminate\Support\Carbon;
|
||||||
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
use Illuminate\Support\Facades\Blade;
|
||||||
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
|
use PowerComponents\LivewirePowerGrid\Button;
|
||||||
|
use PowerComponents\LivewirePowerGrid\Column;
|
||||||
|
use PowerComponents\LivewirePowerGrid\Facades\Filter;
|
||||||
|
use PowerComponents\LivewirePowerGrid\Facades\PowerGrid;
|
||||||
|
use PowerComponents\LivewirePowerGrid\PowerGridFields;
|
||||||
|
use PowerComponents\LivewirePowerGrid\PowerGridComponent;
|
||||||
|
use PowerComponents\LivewirePowerGrid\Traits\WithExport;
|
||||||
|
use PowerComponents\LivewirePowerGrid\Components\SetUp\Exportable;
|
||||||
|
use PowerComponents\LivewirePowerGrid\Facades\Rule;
|
||||||
|
use Livewire\Attributes\On;
|
||||||
|
use WireUi\Traits\WireUiActions;
|
||||||
|
|
||||||
|
final class UserTable extends PowerGridComponent
|
||||||
|
{
|
||||||
|
use WithExport, WireUiActions;
|
||||||
|
|
||||||
|
public string $tableName = 'user-table';
|
||||||
|
|
||||||
|
public bool $showFilters = false;
|
||||||
|
public bool $canCreate;
|
||||||
|
public bool $canEdit;
|
||||||
|
public bool $canDownload;
|
||||||
|
public bool $canDelect;
|
||||||
|
|
||||||
|
public function boot(): void
|
||||||
|
{
|
||||||
|
config(['livewire-powergrid.filter' => 'outside']);
|
||||||
|
//權限設定
|
||||||
|
$this->canCreate = Auth::user()?->can('user-edit') ?? false;
|
||||||
|
$this->canEdit = Auth::user()?->can('user-edit') ?? false;
|
||||||
|
$this->canDownload=Auth::user()?->can('user-delete') ?? false;
|
||||||
|
$this->canDelect = Auth::user()?->can('user-delete') ?? false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function setUp(): array
|
||||||
|
{
|
||||||
|
if($this->canDownload || $this->canDelect){
|
||||||
|
$this->showCheckBox();
|
||||||
|
}
|
||||||
|
$actions = [];
|
||||||
|
$actions[] =PowerGrid::exportable(fileName: $this->tableName.'-file')
|
||||||
|
->type(Exportable::TYPE_XLS, Exportable::TYPE_CSV);
|
||||||
|
$header = PowerGrid::header()
|
||||||
|
->showToggleColumns();
|
||||||
|
if($this->canCreate){
|
||||||
|
$header->includeViewOnTop('livewire.admin.user-header');
|
||||||
|
}
|
||||||
|
$actions[]=$header;
|
||||||
|
$actions[]=PowerGrid::footer()->showPerPage()->showRecordCount();
|
||||||
|
return $actions;
|
||||||
|
}
|
||||||
|
public function header(): array
|
||||||
|
{
|
||||||
|
$actions = [];
|
||||||
|
if ($this->canDelect) {
|
||||||
|
$actions[]=Button::add('bulk-delete')
|
||||||
|
->slot('Bulk delete (<span x-text="window.pgBulkActions.count(\'' . $this->tableName . '\')"></span>)')
|
||||||
|
->icon('solid-trash',['id' => 'my-custom-icon-id', 'class' => 'font-bold'])
|
||||||
|
->class('inline-flex items-center gap-1 px-3 py-1 rounded ')
|
||||||
|
->dispatch('bulkDelete.' . $this->tableName, []);
|
||||||
|
}
|
||||||
|
return $actions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function datasource(): Builder
|
||||||
|
{
|
||||||
|
return User::query();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function relationSearch(): array
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function fields(): PowerGridFields
|
||||||
|
{
|
||||||
|
return PowerGrid::fields()
|
||||||
|
->add('id')
|
||||||
|
->add('name')
|
||||||
|
->add('email')
|
||||||
|
->add('phone')
|
||||||
|
->add('birthday_formatted',fn (User $model) => Carbon::parse($model->birthday)->format('Y-m-d'))
|
||||||
|
->add('gender_str', function (User $model) {
|
||||||
|
if ($this->canEdit) {
|
||||||
|
return Blade::render(
|
||||||
|
'<x-select-category type="occurrence" :options=$options :modelId=$modelId :fieldName=$fieldName :selected=$selected/>',
|
||||||
|
[
|
||||||
|
'options' => UserGender::options(),
|
||||||
|
'modelId' => intval($model->id),
|
||||||
|
'fieldName'=>'gender',
|
||||||
|
'selected' => $model->gender->value
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
// 沒有權限就顯示對應的文字
|
||||||
|
|
||||||
|
return $model->gender->labelPowergridFilter(); // 假設 label() 會回傳顯示文字
|
||||||
|
} )
|
||||||
|
->add('status_str', function (User $model) {
|
||||||
|
if ($this->canEdit) {
|
||||||
|
return Blade::render(
|
||||||
|
'<x-select-category type="occurrence" :options=$options :modelId=$modelId :fieldName=$fieldName :selected=$selected/>',
|
||||||
|
[
|
||||||
|
'options' => UserStatus::options(),
|
||||||
|
'modelId' => intval($model->id),
|
||||||
|
'fieldName'=>'status',
|
||||||
|
'selected' => $model->status->value
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
// 沒有權限就顯示對應的文字
|
||||||
|
|
||||||
|
return $model->status->labelPowergridFilter(); // 假設 label() 會回傳顯示文字
|
||||||
|
} )
|
||||||
|
->add('roles' ,fn(User $model)=> $model->roles->pluck('name')->implode(', '))
|
||||||
|
->add('created_at_formatted', fn (User $model) => Carbon::parse($model->created_at)->format('Y-m-d H:i:s'));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function columns(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Column::make('ID', 'id'),
|
||||||
|
Column::make(__('users.name'), 'name')
|
||||||
|
->sortable()
|
||||||
|
->searchable()
|
||||||
|
->editOnClick(
|
||||||
|
hasPermission: $this->canEdit,
|
||||||
|
dataField: 'name',
|
||||||
|
fallback: 'N/A',
|
||||||
|
saveOnMouseOut: true
|
||||||
|
),
|
||||||
|
Column::make('Email', 'email')
|
||||||
|
->sortable()
|
||||||
|
->searchable()
|
||||||
|
->editOnClick(
|
||||||
|
hasPermission: $this->canEdit,
|
||||||
|
dataField: 'email',
|
||||||
|
fallback: 'N/A',
|
||||||
|
saveOnMouseOut: true
|
||||||
|
),
|
||||||
|
Column::make(__('users.phone'), 'phone')
|
||||||
|
->sortable()
|
||||||
|
->searchable()
|
||||||
|
->editOnClick(
|
||||||
|
hasPermission: $this->canEdit,
|
||||||
|
dataField: 'phone',
|
||||||
|
fallback: 'N/A',
|
||||||
|
saveOnMouseOut: true
|
||||||
|
),
|
||||||
|
|
||||||
|
Column::make(__('users.gender'), 'gender_str','users.gender'),
|
||||||
|
Column::make(__('users.birthday'), 'birthday_formatted')->sortable()->searchable(),
|
||||||
|
Column::make(__('users.status'), 'status_str','users.status'),
|
||||||
|
Column::make(__('users.role'), 'roles'),
|
||||||
|
Column::make('建立時間', 'created_at_formatted', 'created_at')->sortable(),
|
||||||
|
Column::action('操作')
|
||||||
|
];
|
||||||
|
}
|
||||||
|
#[On('bulkDelete.{tableName}')]
|
||||||
|
public function bulkDelete(): void
|
||||||
|
{
|
||||||
|
if ($this->canDelect) {
|
||||||
|
$this->js('alert(window.pgBulkActions.get(\'' . $this->tableName . '\'))');
|
||||||
|
if($this->checkboxValues){
|
||||||
|
User::destroy($this->checkboxValues);
|
||||||
|
$this->js('window.pgBulkActions.clearAll()'); // clear the count on the interface.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#[On('categoryChanged')]
|
||||||
|
public function categoryChanged($value,$fieldName, $modelId): void
|
||||||
|
{
|
||||||
|
// dd($value,$fieldName, $modelId);
|
||||||
|
if (in_array($fieldName,['gender','status']) && $this->canEdit) {
|
||||||
|
$this->noUpdated($modelId,$fieldName,$value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#[On('onUpdatedEditable')]
|
||||||
|
public function onUpdatedEditable($id, $field, $value): void
|
||||||
|
{
|
||||||
|
if (in_array($field,['name','email','phone']) && $this->canEdit) {
|
||||||
|
$this->noUpdated($id,$field,$value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#[On('onUpdatedToggleable')]
|
||||||
|
public function onUpdatedToggleable($id, $field, $value): void
|
||||||
|
{
|
||||||
|
if (in_array($field,[]) && $this->canEdit) {
|
||||||
|
$this->noUpdated($id,$field,$value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private function noUpdated($id,$field,$value){
|
||||||
|
$user = User::find($id);
|
||||||
|
if ($user) {
|
||||||
|
$user->{$field} = $value;
|
||||||
|
$user->save(); // 明確觸發 saving
|
||||||
|
}
|
||||||
|
$this->notification()->send([
|
||||||
|
'icon' => 'success',
|
||||||
|
'title' => $id.'.'.__('users.'.$field).':'.$value,
|
||||||
|
'description' => '已經寫入',
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function filters(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Filter::inputText('name')->placeholder(__('users.name')),
|
||||||
|
Filter::inputText('email')->placeholder('Email'),
|
||||||
|
Filter::inputText('phone')->placeholder(__('users.phone')),
|
||||||
|
Filter::enumSelect('gender_str','users.gender')
|
||||||
|
->datasource(UserGender::cases())
|
||||||
|
->optionLabel('users.gender'),
|
||||||
|
Filter::datepicker('birthday'),
|
||||||
|
Filter::enumSelect('status_str', 'users.status')
|
||||||
|
->datasource(UserStatus::cases())
|
||||||
|
->optionLabel('users.status'),
|
||||||
|
Filter::datetimepicker('created_at'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function actions(User $row): array
|
||||||
|
{
|
||||||
|
$actions = [];
|
||||||
|
if ($this->canEdit) {
|
||||||
|
$actions[]=Button::add('edit')
|
||||||
|
->slot(__('users.edit'))
|
||||||
|
->icon('solid-pencil-square')
|
||||||
|
->class('inline-flex items-center gap-1 px-3 py-1 rounded ')
|
||||||
|
->dispatchTo('admin.user-form', 'openModal', ['id' => $row->id]);
|
||||||
|
}
|
||||||
|
if($this->canDelect){
|
||||||
|
$actions[]=Button::add('delete')
|
||||||
|
->slot(__('users.delete'))
|
||||||
|
->icon('solid-trash')
|
||||||
|
->class('inline-flex items-center gap-1 px-3 py-1 rounded ')
|
||||||
|
->dispatchTo('admin.user-form', 'deleteUser', ['id' => $row->id]);
|
||||||
|
}
|
||||||
|
return $actions;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* public function actionRules($row): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
// Hide button edit for ID 1
|
||||||
|
Rule::button('edit')
|
||||||
|
->when(fn($row) => $row->id === 1)
|
||||||
|
->hide(),
|
||||||
|
];
|
||||||
|
} */
|
||||||
|
|
||||||
|
}
|
72
app/Livewire/Forms/LoginForm.php
Normal file
72
app/Livewire/Forms/LoginForm.php
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Livewire\Forms;
|
||||||
|
|
||||||
|
use Illuminate\Auth\Events\Lockout;
|
||||||
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
use Illuminate\Support\Facades\RateLimiter;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
use Illuminate\Validation\ValidationException;
|
||||||
|
use Livewire\Attributes\Validate;
|
||||||
|
use Livewire\Form;
|
||||||
|
|
||||||
|
class LoginForm extends Form
|
||||||
|
{
|
||||||
|
#[Validate('required|string|email')]
|
||||||
|
public string $email = '';
|
||||||
|
|
||||||
|
#[Validate('required|string')]
|
||||||
|
public string $password = '';
|
||||||
|
|
||||||
|
#[Validate('boolean')]
|
||||||
|
public bool $remember = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Attempt to authenticate the request's credentials.
|
||||||
|
*
|
||||||
|
* @throws \Illuminate\Validation\ValidationException
|
||||||
|
*/
|
||||||
|
public function authenticate(): void
|
||||||
|
{
|
||||||
|
$this->ensureIsNotRateLimited();
|
||||||
|
|
||||||
|
if (! Auth::attempt($this->only(['email', 'password']), $this->remember)) {
|
||||||
|
RateLimiter::hit($this->throttleKey());
|
||||||
|
|
||||||
|
throw ValidationException::withMessages([
|
||||||
|
'form.email' => trans('auth.failed'),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
RateLimiter::clear($this->throttleKey());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Ensure the authentication request is not rate limited.
|
||||||
|
*/
|
||||||
|
protected function ensureIsNotRateLimited(): void
|
||||||
|
{
|
||||||
|
if (! RateLimiter::tooManyAttempts($this->throttleKey(), 5)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
event(new Lockout(request()));
|
||||||
|
|
||||||
|
$seconds = RateLimiter::availableIn($this->throttleKey());
|
||||||
|
|
||||||
|
throw ValidationException::withMessages([
|
||||||
|
'form.email' => trans('auth.throttle', [
|
||||||
|
'seconds' => $seconds,
|
||||||
|
'minutes' => ceil($seconds / 60),
|
||||||
|
]),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the authentication rate limiting throttle key.
|
||||||
|
*/
|
||||||
|
protected function throttleKey(): string
|
||||||
|
{
|
||||||
|
return Str::transliterate(Str::lower($this->email).'|'.request()->ip());
|
||||||
|
}
|
||||||
|
}
|
58
app/Models/User.php
Normal file
58
app/Models/User.php
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
// use Illuminate\Contracts\Auth\MustVerifyEmail;
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||||
|
use Illuminate\Notifications\Notifiable;
|
||||||
|
use Spatie\Permission\Traits\HasRoles;
|
||||||
|
use App\Traits\LogsModelActivity;
|
||||||
|
use Spatie\Activitylog\Traits\CausesActivity;
|
||||||
|
|
||||||
|
class User extends Authenticatable
|
||||||
|
{
|
||||||
|
/** @use HasFactory<\Database\Factories\UserFactory> */
|
||||||
|
use HasFactory, Notifiable, HasRoles, LogsModelActivity,CausesActivity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The attributes that are mass assignable.
|
||||||
|
*
|
||||||
|
* @var list<string>
|
||||||
|
*/
|
||||||
|
protected $fillable = [
|
||||||
|
'name',
|
||||||
|
'email',
|
||||||
|
'phone',
|
||||||
|
'birthday',
|
||||||
|
'gender',
|
||||||
|
'status',
|
||||||
|
'password',
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The attributes that should be hidden for serialization.
|
||||||
|
*
|
||||||
|
* @var list<string>
|
||||||
|
*/
|
||||||
|
protected $hidden = [
|
||||||
|
'password',
|
||||||
|
'remember_token',
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the attributes that should be cast.
|
||||||
|
*
|
||||||
|
* @return array<string, string>
|
||||||
|
*/
|
||||||
|
protected function casts(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'email_verified_at' => 'datetime',
|
||||||
|
'password' => 'hashed',
|
||||||
|
'birthday' => 'date',
|
||||||
|
'gender' => \App\Enums\UserGender::class,
|
||||||
|
'status' => \App\Enums\UserStatus::class,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
24
app/Providers/AppServiceProvider.php
Normal file
24
app/Providers/AppServiceProvider.php
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Providers;
|
||||||
|
|
||||||
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
|
||||||
|
class AppServiceProvider extends ServiceProvider
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Register any application services.
|
||||||
|
*/
|
||||||
|
public function register(): void
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Bootstrap any application services.
|
||||||
|
*/
|
||||||
|
public function boot(): void
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
}
|
28
app/Providers/VoltServiceProvider.php
Normal file
28
app/Providers/VoltServiceProvider.php
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Providers;
|
||||||
|
|
||||||
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
use Livewire\Volt\Volt;
|
||||||
|
|
||||||
|
class VoltServiceProvider extends ServiceProvider
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Register services.
|
||||||
|
*/
|
||||||
|
public function register(): void
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Bootstrap services.
|
||||||
|
*/
|
||||||
|
public function boot(): void
|
||||||
|
{
|
||||||
|
Volt::mount([
|
||||||
|
config('livewire.view_path', resource_path('views/livewire')),
|
||||||
|
resource_path('views/pages'),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
23
app/Traits/LogsModelActivity.php
Normal file
23
app/Traits/LogsModelActivity.php
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Traits;
|
||||||
|
|
||||||
|
use Spatie\Activitylog\LogOptions;
|
||||||
|
use Spatie\Activitylog\Traits\LogsActivity;
|
||||||
|
|
||||||
|
trait LogsModelActivity
|
||||||
|
{
|
||||||
|
use LogsActivity;
|
||||||
|
|
||||||
|
public function getActivitylogOptions(): LogOptions
|
||||||
|
{
|
||||||
|
return LogOptions::defaults()
|
||||||
|
->useLogName(strtolower(class_basename(static::class)))
|
||||||
|
->logOnly($this->getFillable())
|
||||||
|
->logOnlyDirty()
|
||||||
|
->dontSubmitEmptyLogs()
|
||||||
|
->setDescriptionForEvent(function (string $eventName) {
|
||||||
|
return class_basename(static::class) . " 已 {$eventName}";
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
17
app/View/Components/AppLayout.php
Normal file
17
app/View/Components/AppLayout.php
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\View\Components;
|
||||||
|
|
||||||
|
use Illuminate\View\Component;
|
||||||
|
use Illuminate\View\View;
|
||||||
|
|
||||||
|
class AppLayout extends Component
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Get the view / contents that represents the component.
|
||||||
|
*/
|
||||||
|
public function render(): View
|
||||||
|
{
|
||||||
|
return view('layouts.app');
|
||||||
|
}
|
||||||
|
}
|
17
app/View/Components/GuestLayout.php
Normal file
17
app/View/Components/GuestLayout.php
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\View\Components;
|
||||||
|
|
||||||
|
use Illuminate\View\Component;
|
||||||
|
use Illuminate\View\View;
|
||||||
|
|
||||||
|
class GuestLayout extends Component
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Get the view / contents that represents the component.
|
||||||
|
*/
|
||||||
|
public function render(): View
|
||||||
|
{
|
||||||
|
return view('layouts.guest');
|
||||||
|
}
|
||||||
|
}
|
27
app/View/Components/SelectCategory.php
Normal file
27
app/View/Components/SelectCategory.php
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\View\Components;
|
||||||
|
|
||||||
|
use Closure;
|
||||||
|
use Illuminate\Contracts\View\View;
|
||||||
|
use Illuminate\Support\Collection;
|
||||||
|
use Illuminate\View\Component;
|
||||||
|
|
||||||
|
class SelectCategory extends Component
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Create a new component instance.
|
||||||
|
*/
|
||||||
|
public function __construct(public Collection $options, public int $modelId,public string $fieldName, public string $selected)
|
||||||
|
{
|
||||||
|
//dd($options,$modelId,$fieldName,$selected);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the view / contents that represent the component.
|
||||||
|
*/
|
||||||
|
public function render(): View|Closure|string
|
||||||
|
{
|
||||||
|
return view('components.select-category');
|
||||||
|
}
|
||||||
|
}
|
26
app/View/Components/Table.php
Normal file
26
app/View/Components/Table.php
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\View\Components;
|
||||||
|
|
||||||
|
use Closure;
|
||||||
|
use Illuminate\Contracts\View\View;
|
||||||
|
use Illuminate\View\Component;
|
||||||
|
|
||||||
|
class Table extends Component
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Create a new component instance.
|
||||||
|
*/
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the view / contents that represent the component.
|
||||||
|
*/
|
||||||
|
public function render(): View|Closure|string
|
||||||
|
{
|
||||||
|
return view('components.table');
|
||||||
|
}
|
||||||
|
}
|
18
artisan
Executable file
18
artisan
Executable file
@ -0,0 +1,18 @@
|
|||||||
|
#!/usr/bin/env php
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Application;
|
||||||
|
use Symfony\Component\Console\Input\ArgvInput;
|
||||||
|
|
||||||
|
define('LARAVEL_START', microtime(true));
|
||||||
|
|
||||||
|
// Register the Composer autoloader...
|
||||||
|
require __DIR__.'/vendor/autoload.php';
|
||||||
|
|
||||||
|
// Bootstrap Laravel and handle the command...
|
||||||
|
/** @var Application $app */
|
||||||
|
$app = require_once __DIR__.'/bootstrap/app.php';
|
||||||
|
|
||||||
|
$status = $app->handleCommand(new ArgvInput);
|
||||||
|
|
||||||
|
exit($status);
|
22
bootstrap/app.php
Normal file
22
bootstrap/app.php
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Application;
|
||||||
|
use Illuminate\Foundation\Configuration\Exceptions;
|
||||||
|
use Illuminate\Foundation\Configuration\Middleware;
|
||||||
|
|
||||||
|
return Application::configure(basePath: dirname(__DIR__))
|
||||||
|
->withRouting(
|
||||||
|
web: __DIR__.'/../routes/web.php',
|
||||||
|
commands: __DIR__.'/../routes/console.php',
|
||||||
|
health: '/up',
|
||||||
|
)
|
||||||
|
->withMiddleware(function (Middleware $middleware) {
|
||||||
|
$middleware->alias([
|
||||||
|
'role' => \Spatie\Permission\Middleware\RoleMiddleware::class,
|
||||||
|
'permission' => \Spatie\Permission\Middleware\PermissionMiddleware::class,
|
||||||
|
'role_or_permission' => \Spatie\Permission\Middleware\RoleOrPermissionMiddleware::class
|
||||||
|
]);
|
||||||
|
})
|
||||||
|
->withExceptions(function (Exceptions $exceptions) {
|
||||||
|
//
|
||||||
|
})->create();
|
2
bootstrap/cache/.gitignore
vendored
Normal file
2
bootstrap/cache/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
*
|
||||||
|
!.gitignore
|
6
bootstrap/providers.php
Normal file
6
bootstrap/providers.php
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
App\Providers\AppServiceProvider::class,
|
||||||
|
App\Providers\VoltServiceProvider::class,
|
||||||
|
];
|
87
composer.json
Normal file
87
composer.json
Normal file
@ -0,0 +1,87 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://getcomposer.org/schema.json",
|
||||||
|
"name": "laravel/laravel",
|
||||||
|
"type": "project",
|
||||||
|
"description": "The skeleton application for the Laravel framework.",
|
||||||
|
"keywords": ["laravel", "framework"],
|
||||||
|
"license": "MIT",
|
||||||
|
"require": {
|
||||||
|
"php": "^8.2",
|
||||||
|
"darkaonline/l5-swagger": "^9.0",
|
||||||
|
"laravel/framework": "^12.0",
|
||||||
|
"laravel/sanctum": "^4.1",
|
||||||
|
"laravel/tinker": "^2.10.1",
|
||||||
|
"livewire/livewire": "^3.4",
|
||||||
|
"livewire/volt": "^1.7.0",
|
||||||
|
"maatwebsite/excel": "^3.1",
|
||||||
|
"openspout/openspout": "^4.0",
|
||||||
|
"power-components/livewire-powergrid": "^6.3",
|
||||||
|
"spatie/laravel-activitylog": "^4.10",
|
||||||
|
"spatie/laravel-permission": "^6.17",
|
||||||
|
"wire-elements/modal": "^2.0",
|
||||||
|
"wireui/wireui": "^2.4"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"fakerphp/faker": "^1.23",
|
||||||
|
"laravel/breeze": "^2.3",
|
||||||
|
"laravel/pail": "^1.2.2",
|
||||||
|
"laravel/pint": "^1.13",
|
||||||
|
"laravel/sail": "^1.41",
|
||||||
|
"mockery/mockery": "^1.6",
|
||||||
|
"nunomaduro/collision": "^8.6",
|
||||||
|
"phpunit/phpunit": "^11.5.3"
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"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",
|
||||||
|
"@php -r \"file_exists('database/database.sqlite') || touch('database/database.sqlite');\"",
|
||||||
|
"@php artisan migrate --graceful --ansi"
|
||||||
|
],
|
||||||
|
"dev": [
|
||||||
|
"Composer\\Config::disableProcessTimeout",
|
||||||
|
"npx concurrently -c \"#93c5fd,#c4b5fd,#fb7185,#fdba74\" \"php artisan serve\" \"php artisan queue:listen --tries=1\" \"php artisan pail --timeout=0\" \"npm run dev\" --names=server,queue,logs,vite"
|
||||||
|
],
|
||||||
|
"test": [
|
||||||
|
"@php artisan config:clear --ansi",
|
||||||
|
"@php artisan test"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"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
|
||||||
|
}
|
9895
composer.lock
generated
Normal file
9895
composer.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
52
config/activitylog.php
Normal file
52
config/activitylog.php
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If set to false, no activities will be saved to the database.
|
||||||
|
*/
|
||||||
|
'enabled' => env('ACTIVITY_LOGGER_ENABLED', true),
|
||||||
|
|
||||||
|
/*
|
||||||
|
* When the clean-command is executed, all recording activities older than
|
||||||
|
* the number of days specified here will be deleted.
|
||||||
|
*/
|
||||||
|
'delete_records_older_than_days' => 365,
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If no log name is passed to the activity() helper
|
||||||
|
* we use this default log name.
|
||||||
|
*/
|
||||||
|
'default_log_name' => 'default',
|
||||||
|
|
||||||
|
/*
|
||||||
|
* You can specify an auth driver here that gets user models.
|
||||||
|
* If this is null we'll use the current Laravel auth driver.
|
||||||
|
*/
|
||||||
|
'default_auth_driver' => null,
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If set to true, the subject returns soft deleted models.
|
||||||
|
*/
|
||||||
|
'subject_returns_soft_deleted_models' => false,
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This model will be used to log activity.
|
||||||
|
* It should implement the Spatie\Activitylog\Contracts\Activity interface
|
||||||
|
* and extend Illuminate\Database\Eloquent\Model.
|
||||||
|
*/
|
||||||
|
'activity_model' => \Spatie\Activitylog\Models\Activity::class,
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This is the name of the table that will be created by the migration and
|
||||||
|
* used by the Activity model shipped with this package.
|
||||||
|
*/
|
||||||
|
'table_name' => env('ACTIVITY_LOGGER_TABLE_NAME', 'activity_log'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This is the database connection that will be used by the migration and
|
||||||
|
* the Activity model shipped with this package. In case it's not set
|
||||||
|
* Laravel's database.default will be used instead.
|
||||||
|
*/
|
||||||
|
'database_connection' => env('ACTIVITY_LOGGER_DB_CONNECTION'),
|
||||||
|
];
|
126
config/app.php
Normal file
126
config/app.php
Normal file
@ -0,0 +1,126 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Application Name
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| This value is the name of your application, which will be used when the
|
||||||
|
| framework needs to place the application's name in a notification or
|
||||||
|
| other UI elements where an application name needs to be displayed.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'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
|
||||||
|
| the application so that it's available within Artisan commands.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'url' => env('APP_URL', 'http://localhost'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Application Timezone
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Here you may specify the default timezone for your application, which
|
||||||
|
| will be used by the PHP date and date-time functions. The timezone
|
||||||
|
| is set to "UTC" by default as it is suitable for most use cases.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'timezone' => env('APP_TIMEZONE', 'UTC'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Application Locale Configuration
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| The application locale determines the default locale that will be used
|
||||||
|
| by Laravel's translation / localization methods. This option can be
|
||||||
|
| set to any locale for which you plan to have translation strings.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'locale' => env('APP_LOCALE', 'en'),
|
||||||
|
|
||||||
|
'fallback_locale' => env('APP_FALLBACK_LOCALE', 'en'),
|
||||||
|
|
||||||
|
'faker_locale' => env('APP_FAKER_LOCALE', 'en_US'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Encryption Key
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| This key is utilized by Laravel's encryption services and should be set
|
||||||
|
| to a random, 32 character string to ensure that all encrypted values
|
||||||
|
| are secure. You should do this prior to deploying the application.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'cipher' => 'AES-256-CBC',
|
||||||
|
|
||||||
|
'key' => env('APP_KEY'),
|
||||||
|
|
||||||
|
'previous_keys' => [
|
||||||
|
...array_filter(
|
||||||
|
explode(',', env('APP_PREVIOUS_KEYS', ''))
|
||||||
|
),
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| 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' => env('APP_MAINTENANCE_DRIVER', 'file'),
|
||||||
|
'store' => env('APP_MAINTENANCE_STORE', 'database'),
|
||||||
|
],
|
||||||
|
|
||||||
|
];
|
115
config/auth.php
Normal file
115
config/auth.php
Normal file
@ -0,0 +1,115 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Authentication Defaults
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| This option defines the default authentication "guard" and password
|
||||||
|
| reset "broker" for your application. You may change these values
|
||||||
|
| as required, but they're a perfect start for most applications.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'defaults' => [
|
||||||
|
'guard' => env('AUTH_GUARD', 'web'),
|
||||||
|
'passwords' => env('AUTH_PASSWORD_BROKER', 'users'),
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Authentication Guards
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Next, you may define every authentication guard for your application.
|
||||||
|
| Of course, a great default configuration has been defined for you
|
||||||
|
| which utilizes session storage plus the Eloquent user provider.
|
||||||
|
|
|
||||||
|
| All authentication guards have a user provider, which defines how the
|
||||||
|
| users are actually retrieved out of your database or other storage
|
||||||
|
| system used by the application. Typically, Eloquent is utilized.
|
||||||
|
|
|
||||||
|
| Supported: "session"
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'guards' => [
|
||||||
|
'web' => [
|
||||||
|
'driver' => 'session',
|
||||||
|
'provider' => 'users',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| User Providers
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| All authentication guards have a user provider, which defines how the
|
||||||
|
| users are actually retrieved out of your database or other storage
|
||||||
|
| system used by the application. Typically, Eloquent is utilized.
|
||||||
|
|
|
||||||
|
| If you have multiple user tables or models you may configure multiple
|
||||||
|
| providers to represent the model / table. These providers may then
|
||||||
|
| be assigned to any extra authentication guards you have defined.
|
||||||
|
|
|
||||||
|
| Supported: "database", "eloquent"
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'providers' => [
|
||||||
|
'users' => [
|
||||||
|
'driver' => 'eloquent',
|
||||||
|
'model' => env('AUTH_MODEL', App\Models\User::class),
|
||||||
|
],
|
||||||
|
|
||||||
|
// 'users' => [
|
||||||
|
// 'driver' => 'database',
|
||||||
|
// 'table' => 'users',
|
||||||
|
// ],
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Resetting Passwords
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| These configuration options specify the behavior of Laravel's password
|
||||||
|
| reset functionality, including the table utilized for token storage
|
||||||
|
| and the user provider that is invoked to actually retrieve users.
|
||||||
|
|
|
||||||
|
| 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' => env('AUTH_PASSWORD_RESET_TOKEN_TABLE', 'password_reset_tokens'),
|
||||||
|
'expire' => 60,
|
||||||
|
'throttle' => 60,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Password Confirmation Timeout
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Here you may define the amount of seconds before a password confirmation
|
||||||
|
| window expires and users are asked to re-enter their password via the
|
||||||
|
| confirmation screen. By default, the timeout lasts for three hours.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'password_timeout' => env('AUTH_PASSWORD_TIMEOUT', 10800),
|
||||||
|
|
||||||
|
];
|
108
config/cache.php
Normal file
108
config/cache.php
Normal file
@ -0,0 +1,108 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Default Cache Store
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| This option controls the default cache store that will be used by the
|
||||||
|
| framework. This connection is utilized if another isn't explicitly
|
||||||
|
| specified when running a cache operation inside the application.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'default' => env('CACHE_STORE', 'database'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| 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: "array", "database", "file", "memcached",
|
||||||
|
| "redis", "dynamodb", "octane", "null"
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'stores' => [
|
||||||
|
|
||||||
|
'array' => [
|
||||||
|
'driver' => 'array',
|
||||||
|
'serialize' => false,
|
||||||
|
],
|
||||||
|
|
||||||
|
'database' => [
|
||||||
|
'driver' => 'database',
|
||||||
|
'connection' => env('DB_CACHE_CONNECTION'),
|
||||||
|
'table' => env('DB_CACHE_TABLE', 'cache'),
|
||||||
|
'lock_connection' => env('DB_CACHE_LOCK_CONNECTION'),
|
||||||
|
'lock_table' => env('DB_CACHE_LOCK_TABLE'),
|
||||||
|
],
|
||||||
|
|
||||||
|
'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' => env('REDIS_CACHE_CONNECTION', 'cache'),
|
||||||
|
'lock_connection' => env('REDIS_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, and 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_'),
|
||||||
|
|
||||||
|
];
|
174
config/database.php
Normal file
174
config/database.php
Normal file
@ -0,0 +1,174 @@
|
|||||||
|
<?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 database operations. This is
|
||||||
|
| the connection which will be utilized unless another connection
|
||||||
|
| is explicitly specified when you execute a query / statement.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'default' => env('DB_CONNECTION', 'sqlite'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Database Connections
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Below are all of the database connections defined for your application.
|
||||||
|
| An example configuration is provided for each database system which
|
||||||
|
| is supported by Laravel. You're free to add / remove connections.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'connections' => [
|
||||||
|
|
||||||
|
'sqlite' => [
|
||||||
|
'driver' => 'sqlite',
|
||||||
|
'url' => env('DB_URL'),
|
||||||
|
'database' => env('DB_DATABASE', database_path('database.sqlite')),
|
||||||
|
'prefix' => '',
|
||||||
|
'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
|
||||||
|
'busy_timeout' => null,
|
||||||
|
'journal_mode' => null,
|
||||||
|
'synchronous' => null,
|
||||||
|
],
|
||||||
|
|
||||||
|
'mysql' => [
|
||||||
|
'driver' => 'mysql',
|
||||||
|
'url' => env('DB_URL'),
|
||||||
|
'host' => env('DB_HOST', '127.0.0.1'),
|
||||||
|
'port' => env('DB_PORT', '3306'),
|
||||||
|
'database' => env('DB_DATABASE', 'laravel'),
|
||||||
|
'username' => env('DB_USERNAME', 'root'),
|
||||||
|
'password' => env('DB_PASSWORD', ''),
|
||||||
|
'unix_socket' => env('DB_SOCKET', ''),
|
||||||
|
'charset' => env('DB_CHARSET', 'utf8mb4'),
|
||||||
|
'collation' => env('DB_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'),
|
||||||
|
]) : [],
|
||||||
|
],
|
||||||
|
|
||||||
|
'mariadb' => [
|
||||||
|
'driver' => 'mariadb',
|
||||||
|
'url' => env('DB_URL'),
|
||||||
|
'host' => env('DB_HOST', '127.0.0.1'),
|
||||||
|
'port' => env('DB_PORT', '3306'),
|
||||||
|
'database' => env('DB_DATABASE', 'laravel'),
|
||||||
|
'username' => env('DB_USERNAME', 'root'),
|
||||||
|
'password' => env('DB_PASSWORD', ''),
|
||||||
|
'unix_socket' => env('DB_SOCKET', ''),
|
||||||
|
'charset' => env('DB_CHARSET', 'utf8mb4'),
|
||||||
|
'collation' => env('DB_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('DB_URL'),
|
||||||
|
'host' => env('DB_HOST', '127.0.0.1'),
|
||||||
|
'port' => env('DB_PORT', '5432'),
|
||||||
|
'database' => env('DB_DATABASE', 'laravel'),
|
||||||
|
'username' => env('DB_USERNAME', 'root'),
|
||||||
|
'password' => env('DB_PASSWORD', ''),
|
||||||
|
'charset' => env('DB_CHARSET', 'utf8'),
|
||||||
|
'prefix' => '',
|
||||||
|
'prefix_indexes' => true,
|
||||||
|
'search_path' => 'public',
|
||||||
|
'sslmode' => 'prefer',
|
||||||
|
],
|
||||||
|
|
||||||
|
'sqlsrv' => [
|
||||||
|
'driver' => 'sqlsrv',
|
||||||
|
'url' => env('DB_URL'),
|
||||||
|
'host' => env('DB_HOST', 'localhost'),
|
||||||
|
'port' => env('DB_PORT', '1433'),
|
||||||
|
'database' => env('DB_DATABASE', 'laravel'),
|
||||||
|
'username' => env('DB_USERNAME', 'root'),
|
||||||
|
'password' => env('DB_PASSWORD', ''),
|
||||||
|
'charset' => env('DB_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 on the database.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'migrations' => [
|
||||||
|
'table' => 'migrations',
|
||||||
|
'update_date_on_publish' => true,
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| 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 Memcached. You may define your connection settings here.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'redis' => [
|
||||||
|
|
||||||
|
'client' => env('REDIS_CLIENT', 'phpredis'),
|
||||||
|
|
||||||
|
'options' => [
|
||||||
|
'cluster' => env('REDIS_CLUSTER', 'redis'),
|
||||||
|
'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),
|
||||||
|
'persistent' => env('REDIS_PERSISTENT', false),
|
||||||
|
],
|
||||||
|
|
||||||
|
'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'),
|
||||||
|
],
|
||||||
|
|
||||||
|
],
|
||||||
|
|
||||||
|
];
|
380
config/excel.php
Normal file
380
config/excel.php
Normal file
@ -0,0 +1,380 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Maatwebsite\Excel\Excel;
|
||||||
|
use PhpOffice\PhpSpreadsheet\Reader\Csv;
|
||||||
|
|
||||||
|
return [
|
||||||
|
'exports' => [
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Chunk size
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| When using FromQuery, the query is automatically chunked.
|
||||||
|
| Here you can specify how big the chunk should be.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
'chunk_size' => 1000,
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Pre-calculate formulas during export
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
'pre_calculate_formulas' => false,
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Enable strict null comparison
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| When enabling strict null comparison empty cells ('') will
|
||||||
|
| be added to the sheet.
|
||||||
|
*/
|
||||||
|
'strict_null_comparison' => false,
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| CSV Settings
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Configure e.g. delimiter, enclosure and line ending for CSV exports.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
'csv' => [
|
||||||
|
'delimiter' => ',',
|
||||||
|
'enclosure' => '"',
|
||||||
|
'line_ending' => PHP_EOL,
|
||||||
|
'use_bom' => false,
|
||||||
|
'include_separator_line' => false,
|
||||||
|
'excel_compatibility' => false,
|
||||||
|
'output_encoding' => '',
|
||||||
|
'test_auto_detect' => true,
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Worksheet properties
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Configure e.g. default title, creator, subject,...
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
'properties' => [
|
||||||
|
'creator' => '',
|
||||||
|
'lastModifiedBy' => '',
|
||||||
|
'title' => '',
|
||||||
|
'description' => '',
|
||||||
|
'subject' => '',
|
||||||
|
'keywords' => '',
|
||||||
|
'category' => '',
|
||||||
|
'manager' => '',
|
||||||
|
'company' => '',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
'imports' => [
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Read Only
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| When dealing with imports, you might only be interested in the
|
||||||
|
| data that the sheet exists. By default we ignore all styles,
|
||||||
|
| however if you want to do some logic based on style data
|
||||||
|
| you can enable it by setting read_only to false.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
'read_only' => true,
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Ignore Empty
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| When dealing with imports, you might be interested in ignoring
|
||||||
|
| rows that have null values or empty strings. By default rows
|
||||||
|
| containing empty strings or empty values are not ignored but can be
|
||||||
|
| ignored by enabling the setting ignore_empty to true.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
'ignore_empty' => false,
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Heading Row Formatter
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Configure the heading row formatter.
|
||||||
|
| Available options: none|slug|custom
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
'heading_row' => [
|
||||||
|
'formatter' => 'slug',
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| CSV Settings
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Configure e.g. delimiter, enclosure and line ending for CSV imports.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
'csv' => [
|
||||||
|
'delimiter' => null,
|
||||||
|
'enclosure' => '"',
|
||||||
|
'escape_character' => '\\',
|
||||||
|
'contiguous' => false,
|
||||||
|
'input_encoding' => Csv::GUESS_ENCODING,
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Worksheet properties
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Configure e.g. default title, creator, subject,...
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
'properties' => [
|
||||||
|
'creator' => '',
|
||||||
|
'lastModifiedBy' => '',
|
||||||
|
'title' => '',
|
||||||
|
'description' => '',
|
||||||
|
'subject' => '',
|
||||||
|
'keywords' => '',
|
||||||
|
'category' => '',
|
||||||
|
'manager' => '',
|
||||||
|
'company' => '',
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Cell Middleware
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Configure middleware that is executed on getting a cell value
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
'cells' => [
|
||||||
|
'middleware' => [
|
||||||
|
//\Maatwebsite\Excel\Middleware\TrimCellValue::class,
|
||||||
|
//\Maatwebsite\Excel\Middleware\ConvertEmptyCellValuesToNull::class,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Extension detector
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Configure here which writer/reader type should be used when the package
|
||||||
|
| needs to guess the correct type based on the extension alone.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
'extension_detector' => [
|
||||||
|
'xlsx' => Excel::XLSX,
|
||||||
|
'xlsm' => Excel::XLSX,
|
||||||
|
'xltx' => Excel::XLSX,
|
||||||
|
'xltm' => Excel::XLSX,
|
||||||
|
'xls' => Excel::XLS,
|
||||||
|
'xlt' => Excel::XLS,
|
||||||
|
'ods' => Excel::ODS,
|
||||||
|
'ots' => Excel::ODS,
|
||||||
|
'slk' => Excel::SLK,
|
||||||
|
'xml' => Excel::XML,
|
||||||
|
'gnumeric' => Excel::GNUMERIC,
|
||||||
|
'htm' => Excel::HTML,
|
||||||
|
'html' => Excel::HTML,
|
||||||
|
'csv' => Excel::CSV,
|
||||||
|
'tsv' => Excel::TSV,
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| PDF Extension
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Configure here which Pdf driver should be used by default.
|
||||||
|
| Available options: Excel::MPDF | Excel::TCPDF | Excel::DOMPDF
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
'pdf' => Excel::DOMPDF,
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Value Binder
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| PhpSpreadsheet offers a way to hook into the process of a value being
|
||||||
|
| written to a cell. In there some assumptions are made on how the
|
||||||
|
| value should be formatted. If you want to change those defaults,
|
||||||
|
| you can implement your own default value binder.
|
||||||
|
|
|
||||||
|
| Possible value binders:
|
||||||
|
|
|
||||||
|
| [x] Maatwebsite\Excel\DefaultValueBinder::class
|
||||||
|
| [x] PhpOffice\PhpSpreadsheet\Cell\StringValueBinder::class
|
||||||
|
| [x] PhpOffice\PhpSpreadsheet\Cell\AdvancedValueBinder::class
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
'value_binder' => [
|
||||||
|
'default' => Maatwebsite\Excel\DefaultValueBinder::class,
|
||||||
|
],
|
||||||
|
|
||||||
|
'cache' => [
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Default cell caching driver
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| By default PhpSpreadsheet keeps all cell values in memory, however when
|
||||||
|
| dealing with large files, this might result into memory issues. If you
|
||||||
|
| want to mitigate that, you can configure a cell caching driver here.
|
||||||
|
| When using the illuminate driver, it will store each value in the
|
||||||
|
| cache store. This can slow down the process, because it needs to
|
||||||
|
| store each value. You can use the "batch" store if you want to
|
||||||
|
| only persist to the store when the memory limit is reached.
|
||||||
|
|
|
||||||
|
| Drivers: memory|illuminate|batch
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
'driver' => 'memory',
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Batch memory caching
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| When dealing with the "batch" caching driver, it will only
|
||||||
|
| persist to the store when the memory limit is reached.
|
||||||
|
| Here you can tweak the memory limit to your liking.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
'batch' => [
|
||||||
|
'memory_limit' => 60000,
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Illuminate cache
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| When using the "illuminate" caching driver, it will automatically use
|
||||||
|
| your default cache store. However if you prefer to have the cell
|
||||||
|
| cache on a separate store, you can configure the store name here.
|
||||||
|
| You can use any store defined in your cache config. When leaving
|
||||||
|
| at "null" it will use the default store.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
'illuminate' => [
|
||||||
|
'store' => null,
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Cache Time-to-live (TTL)
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| The TTL of items written to cache. If you want to keep the items cached
|
||||||
|
| indefinitely, set this to null. Otherwise, set a number of seconds,
|
||||||
|
| a \DateInterval, or a callable.
|
||||||
|
|
|
||||||
|
| Allowable types: callable|\DateInterval|int|null
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
'default_ttl' => 10800,
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Transaction Handler
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| By default the import is wrapped in a transaction. This is useful
|
||||||
|
| for when an import may fail and you want to retry it. With the
|
||||||
|
| transactions, the previous import gets rolled-back.
|
||||||
|
|
|
||||||
|
| You can disable the transaction handler by setting this to null.
|
||||||
|
| Or you can choose a custom made transaction handler here.
|
||||||
|
|
|
||||||
|
| Supported handlers: null|db
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
'transactions' => [
|
||||||
|
'handler' => 'db',
|
||||||
|
'db' => [
|
||||||
|
'connection' => null,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
'temporary_files' => [
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Local Temporary Path
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| When exporting and importing files, we use a temporary file, before
|
||||||
|
| storing reading or downloading. Here you can customize that path.
|
||||||
|
| permissions is an array with the permission flags for the directory (dir)
|
||||||
|
| and the create file (file).
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
'local_path' => storage_path('framework/cache/laravel-excel'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Local Temporary Path Permissions
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Permissions is an array with the permission flags for the directory (dir)
|
||||||
|
| and the create file (file).
|
||||||
|
| If omitted the default permissions of the filesystem will be used.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
'local_permissions' => [
|
||||||
|
// 'dir' => 0755,
|
||||||
|
// 'file' => 0644,
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Remote Temporary Disk
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| When dealing with a multi server setup with queues in which you
|
||||||
|
| cannot rely on having a shared local temporary path, you might
|
||||||
|
| want to store the temporary file on a shared disk. During the
|
||||||
|
| queue executing, we'll retrieve the temporary file from that
|
||||||
|
| location instead. When left to null, it will always use
|
||||||
|
| the local path. This setting only has effect when using
|
||||||
|
| in conjunction with queued imports and exports.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
'remote_disk' => null,
|
||||||
|
'remote_prefix' => null,
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Force Resync
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| When dealing with a multi server setup as above, it's possible
|
||||||
|
| for the clean up that occurs after entire queue has been run to only
|
||||||
|
| cleanup the server that the last AfterImportJob runs on. The rest of the server
|
||||||
|
| would still have the local temporary file stored on it. In this case your
|
||||||
|
| local storage limits can be exceeded and future imports won't be processed.
|
||||||
|
| To mitigate this you can set this config value to be true, so that after every
|
||||||
|
| queued chunk is processed the local temporary file is deleted on the server that
|
||||||
|
| processed it.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
'force_resync_remote' => null,
|
||||||
|
],
|
||||||
|
];
|
80
config/filesystems.php
Normal file
80
config/filesystems.php
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
<?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 for file storage.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'default' => env('FILESYSTEM_DISK', 'local'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Filesystem Disks
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Below you may configure as many filesystem disks as necessary, and you
|
||||||
|
| may even configure multiple disks for the same driver. Examples for
|
||||||
|
| most supported storage drivers are configured here for reference.
|
||||||
|
|
|
||||||
|
| Supported drivers: "local", "ftp", "sftp", "s3"
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'disks' => [
|
||||||
|
|
||||||
|
'local' => [
|
||||||
|
'driver' => 'local',
|
||||||
|
'root' => storage_path('app/private'),
|
||||||
|
'serve' => true,
|
||||||
|
'throw' => false,
|
||||||
|
'report' => false,
|
||||||
|
],
|
||||||
|
|
||||||
|
'public' => [
|
||||||
|
'driver' => 'local',
|
||||||
|
'root' => storage_path('app/public'),
|
||||||
|
'url' => env('APP_URL').'/storage',
|
||||||
|
'visibility' => 'public',
|
||||||
|
'throw' => false,
|
||||||
|
'report' => 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,
|
||||||
|
'report' => 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'),
|
||||||
|
],
|
||||||
|
|
||||||
|
];
|
318
config/l5-swagger.php
Normal file
318
config/l5-swagger.php
Normal file
@ -0,0 +1,318 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
'default' => 'default',
|
||||||
|
'documentations' => [
|
||||||
|
'default' => [
|
||||||
|
'api' => [
|
||||||
|
'title' => 'L5 Swagger UI',
|
||||||
|
],
|
||||||
|
|
||||||
|
'routes' => [
|
||||||
|
/*
|
||||||
|
* Route for accessing api documentation interface
|
||||||
|
*/
|
||||||
|
'api' => 'api/documentation',
|
||||||
|
],
|
||||||
|
'paths' => [
|
||||||
|
/*
|
||||||
|
* Edit to include full URL in ui for assets
|
||||||
|
*/
|
||||||
|
'use_absolute_path' => env('L5_SWAGGER_USE_ABSOLUTE_PATH', true),
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Edit to set path where swagger ui assets should be stored
|
||||||
|
*/
|
||||||
|
'swagger_ui_assets_path' => env('L5_SWAGGER_UI_ASSETS_PATH', 'vendor/swagger-api/swagger-ui/dist/'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
* File name of the generated json documentation file
|
||||||
|
*/
|
||||||
|
'docs_json' => 'api-docs.json',
|
||||||
|
|
||||||
|
/*
|
||||||
|
* File name of the generated YAML documentation file
|
||||||
|
*/
|
||||||
|
'docs_yaml' => 'api-docs.yaml',
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Set this to `json` or `yaml` to determine which documentation file to use in UI
|
||||||
|
*/
|
||||||
|
'format_to_use_for_docs' => env('L5_FORMAT_TO_USE_FOR_DOCS', 'json'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Absolute paths to directory containing the swagger annotations are stored.
|
||||||
|
*/
|
||||||
|
'annotations' => [
|
||||||
|
base_path('app'),
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'defaults' => [
|
||||||
|
'routes' => [
|
||||||
|
/*
|
||||||
|
* Route for accessing parsed swagger annotations.
|
||||||
|
*/
|
||||||
|
'docs' => 'docs',
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Route for Oauth2 authentication callback.
|
||||||
|
*/
|
||||||
|
'oauth2_callback' => 'api/oauth2-callback',
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Middleware allows to prevent unexpected access to API documentation
|
||||||
|
*/
|
||||||
|
'middleware' => [
|
||||||
|
'api' => [],
|
||||||
|
'asset' => [],
|
||||||
|
'docs' => [],
|
||||||
|
'oauth2_callback' => [],
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Route Group options
|
||||||
|
*/
|
||||||
|
'group_options' => [],
|
||||||
|
],
|
||||||
|
|
||||||
|
'paths' => [
|
||||||
|
/*
|
||||||
|
* Absolute path to location where parsed annotations will be stored
|
||||||
|
*/
|
||||||
|
'docs' => storage_path('api-docs'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Absolute path to directory where to export views
|
||||||
|
*/
|
||||||
|
'views' => base_path('resources/views/vendor/l5-swagger'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Edit to set the api's base path
|
||||||
|
*/
|
||||||
|
'base' => env('L5_SWAGGER_BASE_PATH', null),
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Absolute path to directories that should be excluded from scanning
|
||||||
|
* @deprecated Please use `scanOptions.exclude`
|
||||||
|
* `scanOptions.exclude` overwrites this
|
||||||
|
*/
|
||||||
|
'excludes' => [],
|
||||||
|
],
|
||||||
|
|
||||||
|
'scanOptions' => [
|
||||||
|
/**
|
||||||
|
* Configuration for default processors. Allows to pass processors configuration to swagger-php.
|
||||||
|
*
|
||||||
|
* @link https://zircote.github.io/swagger-php/reference/processors.html
|
||||||
|
*/
|
||||||
|
'default_processors_configuration' => [
|
||||||
|
/** Example */
|
||||||
|
/**
|
||||||
|
* 'operationId.hash' => true,
|
||||||
|
* 'pathFilter' => [
|
||||||
|
* 'tags' => [
|
||||||
|
* '/pets/',
|
||||||
|
* '/store/',
|
||||||
|
* ],
|
||||||
|
* ],.
|
||||||
|
*/
|
||||||
|
],
|
||||||
|
|
||||||
|
/**
|
||||||
|
* analyser: defaults to \OpenApi\StaticAnalyser .
|
||||||
|
*
|
||||||
|
* @see \OpenApi\scan
|
||||||
|
*/
|
||||||
|
'analyser' => null,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* analysis: defaults to a new \OpenApi\Analysis .
|
||||||
|
*
|
||||||
|
* @see \OpenApi\scan
|
||||||
|
*/
|
||||||
|
'analysis' => null,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Custom query path processors classes.
|
||||||
|
*
|
||||||
|
* @link https://github.com/zircote/swagger-php/tree/master/Examples/processors/schema-query-parameter
|
||||||
|
* @see \OpenApi\scan
|
||||||
|
*/
|
||||||
|
'processors' => [
|
||||||
|
// new \App\SwaggerProcessors\SchemaQueryParameter(),
|
||||||
|
],
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pattern: string $pattern File pattern(s) to scan (default: *.php) .
|
||||||
|
*
|
||||||
|
* @see \OpenApi\scan
|
||||||
|
*/
|
||||||
|
'pattern' => null,
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Absolute path to directories that should be excluded from scanning
|
||||||
|
* @note This option overwrites `paths.excludes`
|
||||||
|
* @see \OpenApi\scan
|
||||||
|
*/
|
||||||
|
'exclude' => [],
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Allows to generate specs either for OpenAPI 3.0.0 or OpenAPI 3.1.0.
|
||||||
|
* By default the spec will be in version 3.0.0
|
||||||
|
*/
|
||||||
|
'open_api_spec_version' => env('L5_SWAGGER_OPEN_API_SPEC_VERSION', \L5Swagger\Generator::OPEN_API_DEFAULT_SPEC_VERSION),
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
* API security definitions. Will be generated into documentation file.
|
||||||
|
*/
|
||||||
|
'securityDefinitions' => [
|
||||||
|
'securitySchemes' => [
|
||||||
|
/*
|
||||||
|
* Examples of Security schemes
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
'api_key_security_example' => [ // Unique name of security
|
||||||
|
'type' => 'apiKey', // The type of the security scheme. Valid values are "basic", "apiKey" or "oauth2".
|
||||||
|
'description' => 'A short description for security scheme',
|
||||||
|
'name' => 'api_key', // The name of the header or query parameter to be used.
|
||||||
|
'in' => 'header', // The location of the API key. Valid values are "query" or "header".
|
||||||
|
],
|
||||||
|
'oauth2_security_example' => [ // Unique name of security
|
||||||
|
'type' => 'oauth2', // The type of the security scheme. Valid values are "basic", "apiKey" or "oauth2".
|
||||||
|
'description' => 'A short description for oauth2 security scheme.',
|
||||||
|
'flow' => 'implicit', // The flow used by the OAuth2 security scheme. Valid values are "implicit", "password", "application" or "accessCode".
|
||||||
|
'authorizationUrl' => 'http://example.com/auth', // The authorization URL to be used for (implicit/accessCode)
|
||||||
|
//'tokenUrl' => 'http://example.com/auth' // The authorization URL to be used for (password/application/accessCode)
|
||||||
|
'scopes' => [
|
||||||
|
'read:projects' => 'read your projects',
|
||||||
|
'write:projects' => 'modify projects in your account',
|
||||||
|
]
|
||||||
|
],
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Open API 3.0 support
|
||||||
|
'passport' => [ // Unique name of security
|
||||||
|
'type' => 'oauth2', // The type of the security scheme. Valid values are "basic", "apiKey" or "oauth2".
|
||||||
|
'description' => 'Laravel passport oauth2 security.',
|
||||||
|
'in' => 'header',
|
||||||
|
'scheme' => 'https',
|
||||||
|
'flows' => [
|
||||||
|
"password" => [
|
||||||
|
"authorizationUrl" => config('app.url') . '/oauth/authorize',
|
||||||
|
"tokenUrl" => config('app.url') . '/oauth/token',
|
||||||
|
"refreshUrl" => config('app.url') . '/token/refresh',
|
||||||
|
"scopes" => []
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'sanctum' => [ // Unique name of security
|
||||||
|
'type' => 'apiKey', // Valid values are "basic", "apiKey" or "oauth2".
|
||||||
|
'description' => 'Enter token in format (Bearer <token>)',
|
||||||
|
'name' => 'Authorization', // The name of the header or query parameter to be used.
|
||||||
|
'in' => 'header', // The location of the API key. Valid values are "query" or "header".
|
||||||
|
],
|
||||||
|
*/
|
||||||
|
],
|
||||||
|
'security' => [
|
||||||
|
/*
|
||||||
|
* Examples of Securities
|
||||||
|
*/
|
||||||
|
[
|
||||||
|
/*
|
||||||
|
'oauth2_security_example' => [
|
||||||
|
'read',
|
||||||
|
'write'
|
||||||
|
],
|
||||||
|
|
||||||
|
'passport' => []
|
||||||
|
*/
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Set this to `true` in development mode so that docs would be regenerated on each request
|
||||||
|
* Set this to `false` to disable swagger generation on production
|
||||||
|
*/
|
||||||
|
'generate_always' => env('L5_SWAGGER_GENERATE_ALWAYS', false),
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Set this to `true` to generate a copy of documentation in yaml format
|
||||||
|
*/
|
||||||
|
'generate_yaml_copy' => env('L5_SWAGGER_GENERATE_YAML_COPY', false),
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Edit to trust the proxy's ip address - needed for AWS Load Balancer
|
||||||
|
* string[]
|
||||||
|
*/
|
||||||
|
'proxy' => false,
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Configs plugin allows to fetch external configs instead of passing them to SwaggerUIBundle.
|
||||||
|
* See more at: https://github.com/swagger-api/swagger-ui#configs-plugin
|
||||||
|
*/
|
||||||
|
'additional_config_url' => null,
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Apply a sort to the operation list of each API. It can be 'alpha' (sort by paths alphanumerically),
|
||||||
|
* 'method' (sort by HTTP method).
|
||||||
|
* Default is the order returned by the server unchanged.
|
||||||
|
*/
|
||||||
|
'operations_sort' => env('L5_SWAGGER_OPERATIONS_SORT', null),
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Pass the validatorUrl parameter to SwaggerUi init on the JS side.
|
||||||
|
* A null value here disables validation.
|
||||||
|
*/
|
||||||
|
'validator_url' => null,
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Swagger UI configuration parameters
|
||||||
|
*/
|
||||||
|
'ui' => [
|
||||||
|
'display' => [
|
||||||
|
'dark_mode' => env('L5_SWAGGER_UI_DARK_MODE', false),
|
||||||
|
/*
|
||||||
|
* Controls the default expansion setting for the operations and tags. It can be :
|
||||||
|
* 'list' (expands only the tags),
|
||||||
|
* 'full' (expands the tags and operations),
|
||||||
|
* 'none' (expands nothing).
|
||||||
|
*/
|
||||||
|
'doc_expansion' => env('L5_SWAGGER_UI_DOC_EXPANSION', 'none'),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If set, enables filtering. The top bar will show an edit box that
|
||||||
|
* you can use to filter the tagged operations that are shown. Can be
|
||||||
|
* Boolean to enable or disable, or a string, in which case filtering
|
||||||
|
* will be enabled using that string as the filter expression. Filtering
|
||||||
|
* is case-sensitive matching the filter expression anywhere inside
|
||||||
|
* the tag.
|
||||||
|
*/
|
||||||
|
'filter' => env('L5_SWAGGER_UI_FILTERS', true), // true | false
|
||||||
|
],
|
||||||
|
|
||||||
|
'authorization' => [
|
||||||
|
/*
|
||||||
|
* If set to true, it persists authorization data, and it would not be lost on browser close/refresh
|
||||||
|
*/
|
||||||
|
'persist_authorization' => env('L5_SWAGGER_UI_PERSIST_AUTHORIZATION', false),
|
||||||
|
|
||||||
|
'oauth2' => [
|
||||||
|
/*
|
||||||
|
* If set to true, adds PKCE to AuthorizationCodeGrant flow
|
||||||
|
*/
|
||||||
|
'use_pkce_with_authorization_code_grant' => false,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
/*
|
||||||
|
* Constants which can be used in annotations
|
||||||
|
*/
|
||||||
|
'constants' => [
|
||||||
|
'L5_SWAGGER_CONST_HOST' => env('L5_SWAGGER_CONST_HOST', 'http://my-default-host.com'),
|
||||||
|
],
|
||||||
|
],
|
||||||
|
];
|
166
config/livewire-powergrid.php
Normal file
166
config/livewire-powergrid.php
Normal file
@ -0,0 +1,166 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Support\Js;
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Theme
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| PowerGrid supports Tailwind and Bootstrap 5 themes.
|
||||||
|
| Configure here the theme of your choice.
|
||||||
|
*/
|
||||||
|
|
||||||
|
'theme' => \PowerComponents\LivewirePowerGrid\Themes\Tailwind::class,
|
||||||
|
// 'theme' => \PowerComponents\LivewirePowerGrid\Themes\DaisyUI::class,
|
||||||
|
// 'theme' => \PowerComponents\LivewirePowerGrid\Themes\Bootstrap5::class,
|
||||||
|
|
||||||
|
'cache_ttl' => null,
|
||||||
|
|
||||||
|
'icon_resources' => [
|
||||||
|
'paths' => [
|
||||||
|
// 'default' => 'resources/views/components/icons',
|
||||||
|
// 'outline' => 'vendor/wireui/wireui/resources/views/components/icons/outline',
|
||||||
|
// 'solid' => 'vendor/wireui/wireui/resources/views/components/icons/solid',
|
||||||
|
'outline' => 'vendor/wireui/heroicons/src/views/components/outline',
|
||||||
|
'solid' => 'vendor/wireui/heroicons/src/views/components/solid',
|
||||||
|
],
|
||||||
|
|
||||||
|
'allowed' => [
|
||||||
|
// 'pencil',
|
||||||
|
],
|
||||||
|
|
||||||
|
'attributes' => ['class' => 'w-5 text-red-600'],
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Plugins
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Plugins used: flatpickr.js to datepicker.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'plugins' => [
|
||||||
|
/*
|
||||||
|
* https://flatpickr.js.org
|
||||||
|
*/
|
||||||
|
'flatpickr' => [
|
||||||
|
'locales' => [
|
||||||
|
'zh_tw' => [
|
||||||
|
'locale' => 'zh_tw',
|
||||||
|
'dateFormat' => 'Y-m-d H:i',
|
||||||
|
'enableTime' => true,
|
||||||
|
'time_24hr' => true,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
'select' => [
|
||||||
|
'default' => 'tom',
|
||||||
|
|
||||||
|
/*
|
||||||
|
* TomSelect Options
|
||||||
|
* https://tom-select.js.org
|
||||||
|
*/
|
||||||
|
'tom' => [
|
||||||
|
'plugins' => [
|
||||||
|
'clear_button' => [
|
||||||
|
'title' => 'Remove all selected options',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Slim Select options
|
||||||
|
* https://slimselectjs.com/
|
||||||
|
*/
|
||||||
|
'slim' => [
|
||||||
|
'settings' => [
|
||||||
|
'alwaysOpen' => false,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Filters
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| PowerGrid supports inline and outside filters.
|
||||||
|
| 'inline': Filters data inside the table.
|
||||||
|
| 'outside': Filters data outside the table.
|
||||||
|
| 'null'
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'filter' => 'inline',
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Filters Attributes
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
||||||
|
| You can add custom attributes to the filters.
|
||||||
|
| The key is the filter type and the value is a callback function.
|
||||||
|
| like: input_text, select, datetime, etc.
|
||||||
|
| The callback function receives the field and title as parameters.
|
||||||
|
| The callback function must return an array with the attributes.
|
||||||
|
*/
|
||||||
|
|
||||||
|
'filter_attributes' => [
|
||||||
|
'input_text' => \PowerComponents\LivewirePowerGrid\FilterAttributes\InputText::class,
|
||||||
|
'boolean' => \PowerComponents\LivewirePowerGrid\FilterAttributes\Boolean::class,
|
||||||
|
'number' => \PowerComponents\LivewirePowerGrid\FilterAttributes\Number::class,
|
||||||
|
'select' => \PowerComponents\LivewirePowerGrid\FilterAttributes\Select::class,
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Persisting
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| PowerGrid supports persisting of the filters, columns and sorting.
|
||||||
|
| 'session': persist in the session.
|
||||||
|
| 'cache': persist with cache.
|
||||||
|
| 'cookies': persist with cookies (default).
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'persist_driver' => 'cookies',
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Exportable class
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'exportable' => [
|
||||||
|
'default' => 'openspout_v4',
|
||||||
|
'openspout_v4' => [
|
||||||
|
'xlsx' => \PowerComponents\LivewirePowerGrid\Components\Exports\OpenSpout\v4\ExportToXLS::class,
|
||||||
|
'csv' => \PowerComponents\LivewirePowerGrid\Components\Exports\OpenSpout\v4\ExportToCsv::class,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Auto-Discover Models
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| PowerGrid will search for Models in the directories listed below.
|
||||||
|
| These Models be listed as options when you run the
|
||||||
|
| "artisan powergrid:create" command.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'auto_discover_models_paths' => [
|
||||||
|
app_path('Models'),
|
||||||
|
],
|
||||||
|
];
|
132
config/logging.php
Normal file
132
config/logging.php
Normal file
@ -0,0 +1,132 @@
|
|||||||
|
<?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 is utilized to write
|
||||||
|
| messages to your logs. The value provided here should match one of
|
||||||
|
| the channels present in the list of "channels" configured below.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'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' => env('LOG_DEPRECATIONS_TRACE', false),
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Log Channels
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Here you may configure the log channels for your application. Laravel
|
||||||
|
| utilizes the Monolog PHP logging library, which includes a variety
|
||||||
|
| of powerful log handlers and formatters that you're free to use.
|
||||||
|
|
|
||||||
|
| Available drivers: "single", "daily", "slack", "syslog",
|
||||||
|
| "errorlog", "monolog", "custom", "stack"
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'channels' => [
|
||||||
|
|
||||||
|
'stack' => [
|
||||||
|
'driver' => 'stack',
|
||||||
|
'channels' => explode(',', env('LOG_STACK', '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' => env('LOG_DAILY_DAYS', 14),
|
||||||
|
'replace_placeholders' => true,
|
||||||
|
],
|
||||||
|
|
||||||
|
'slack' => [
|
||||||
|
'driver' => 'slack',
|
||||||
|
'url' => env('LOG_SLACK_WEBHOOK_URL'),
|
||||||
|
'username' => env('LOG_SLACK_USERNAME', 'Laravel Log'),
|
||||||
|
'emoji' => env('LOG_SLACK_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,
|
||||||
|
'handler_with' => [
|
||||||
|
'stream' => 'php://stderr',
|
||||||
|
],
|
||||||
|
'formatter' => env('LOG_STDERR_FORMATTER'),
|
||||||
|
'processors' => [PsrLogMessageProcessor::class],
|
||||||
|
],
|
||||||
|
|
||||||
|
'syslog' => [
|
||||||
|
'driver' => 'syslog',
|
||||||
|
'level' => env('LOG_LEVEL', 'debug'),
|
||||||
|
'facility' => env('LOG_SYSLOG_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'),
|
||||||
|
],
|
||||||
|
|
||||||
|
],
|
||||||
|
|
||||||
|
];
|
118
config/mail.php
Normal file
118
config/mail.php
Normal file
@ -0,0 +1,118 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Default Mailer
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| This option controls the default mailer that is used to send all email
|
||||||
|
| messages unless another mailer is explicitly specified when sending
|
||||||
|
| the message. All additional mailers can be configured within the
|
||||||
|
| "mailers" array. Examples of each type of mailer are provided.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'default' => env('MAIL_MAILER', 'log'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| 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 that can be used
|
||||||
|
| when delivering an email. You may specify which one you're using for
|
||||||
|
| your mailers below. You may also add additional mailers if needed.
|
||||||
|
|
|
||||||
|
| Supported: "smtp", "sendmail", "mailgun", "ses", "ses-v2",
|
||||||
|
| "postmark", "resend", "log", "array",
|
||||||
|
| "failover", "roundrobin"
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'mailers' => [
|
||||||
|
|
||||||
|
'smtp' => [
|
||||||
|
'transport' => 'smtp',
|
||||||
|
'scheme' => env('MAIL_SCHEME'),
|
||||||
|
'url' => env('MAIL_URL'),
|
||||||
|
'host' => env('MAIL_HOST', '127.0.0.1'),
|
||||||
|
'port' => env('MAIL_PORT', 2525),
|
||||||
|
'username' => env('MAIL_USERNAME'),
|
||||||
|
'password' => env('MAIL_PASSWORD'),
|
||||||
|
'timeout' => null,
|
||||||
|
'local_domain' => env('MAIL_EHLO_DOMAIN', parse_url(env('APP_URL', 'http://localhost'), PHP_URL_HOST)),
|
||||||
|
],
|
||||||
|
|
||||||
|
'ses' => [
|
||||||
|
'transport' => 'ses',
|
||||||
|
],
|
||||||
|
|
||||||
|
'postmark' => [
|
||||||
|
'transport' => 'postmark',
|
||||||
|
// 'message_stream_id' => env('POSTMARK_MESSAGE_STREAM_ID'),
|
||||||
|
// 'client' => [
|
||||||
|
// 'timeout' => 5,
|
||||||
|
// ],
|
||||||
|
],
|
||||||
|
|
||||||
|
'resend' => [
|
||||||
|
'transport' => 'resend',
|
||||||
|
],
|
||||||
|
|
||||||
|
'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',
|
||||||
|
],
|
||||||
|
'retry_after' => 60,
|
||||||
|
],
|
||||||
|
|
||||||
|
'roundrobin' => [
|
||||||
|
'transport' => 'roundrobin',
|
||||||
|
'mailers' => [
|
||||||
|
'ses',
|
||||||
|
'postmark',
|
||||||
|
],
|
||||||
|
'retry_after' => 60,
|
||||||
|
],
|
||||||
|
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Global "From" Address
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| You may wish for all emails 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 emails that are sent by your application.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'from' => [
|
||||||
|
'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
|
||||||
|
'name' => env('MAIL_FROM_NAME', 'Example'),
|
||||||
|
],
|
||||||
|
|
||||||
|
];
|
202
config/permission.php
Normal file
202
config/permission.php
Normal file
@ -0,0 +1,202 @@
|
|||||||
|
<?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, Laravel\Octane\Events\OperationTerminated event listener will be registered
|
||||||
|
* this will refresh permissions on every TickTerminated, TaskTerminated and RequestTerminated
|
||||||
|
* NOTE: This should not be needed in most cases, but an Octane/Vapor combination benefited from it.
|
||||||
|
*/
|
||||||
|
'register_octane_reset_listener' => false,
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Events will fire when a role or permission is assigned/unassigned:
|
||||||
|
* \Spatie\Permission\Events\RoleAttached
|
||||||
|
* \Spatie\Permission\Events\RoleDetached
|
||||||
|
* \Spatie\Permission\Events\PermissionAttached
|
||||||
|
* \Spatie\Permission\Events\PermissionDetached
|
||||||
|
*
|
||||||
|
* To enable, set to true, and then create listeners to watch these events.
|
||||||
|
*/
|
||||||
|
'events_enabled' => false,
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Teams Feature.
|
||||||
|
* 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 this package's migration file)
|
||||||
|
*/
|
||||||
|
|
||||||
|
'teams' => false,
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The class to use to resolve the permissions team id
|
||||||
|
*/
|
||||||
|
'team_resolver' => \Spatie\Permission\DefaultTeamResolver::class,
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Passport Client Credentials Grant
|
||||||
|
* When set to true the package will use Passports Client to check permissions
|
||||||
|
*/
|
||||||
|
|
||||||
|
'use_passport_client_credentials' => false,
|
||||||
|
|
||||||
|
/*
|
||||||
|
* When set to true, the required permission names are added to exception messages.
|
||||||
|
* 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 exception messages.
|
||||||
|
* 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.
|
||||||
|
* See documentation to understand supported syntax.
|
||||||
|
*/
|
||||||
|
|
||||||
|
'enable_wildcard_permission' => false,
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The class to use for interpreting wildcard permissions.
|
||||||
|
* If you need to modify delimiters, override the class and specify its name here.
|
||||||
|
*/
|
||||||
|
// 'permission.wildcard_permission' => Spatie\Permission\WildcardPermission::class,
|
||||||
|
|
||||||
|
/* Cache-specific settings */
|
||||||
|
|
||||||
|
'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',
|
||||||
|
],
|
||||||
|
];
|
112
config/queue.php
Normal file
112
config/queue.php
Normal file
@ -0,0 +1,112 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Default Queue Connection Name
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Laravel's queue supports a variety of backends via a single, unified
|
||||||
|
| API, giving you convenient access to each backend using identical
|
||||||
|
| syntax for each. The default queue connection is defined below.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'default' => env('QUEUE_CONNECTION', 'database'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Queue Connections
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Here you may configure the connection options for every queue backend
|
||||||
|
| used by your application. An example configuration is provided for
|
||||||
|
| each backend supported by Laravel. You're also free to add more.
|
||||||
|
|
|
||||||
|
| Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null"
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'connections' => [
|
||||||
|
|
||||||
|
'sync' => [
|
||||||
|
'driver' => 'sync',
|
||||||
|
],
|
||||||
|
|
||||||
|
'database' => [
|
||||||
|
'driver' => 'database',
|
||||||
|
'connection' => env('DB_QUEUE_CONNECTION'),
|
||||||
|
'table' => env('DB_QUEUE_TABLE', 'jobs'),
|
||||||
|
'queue' => env('DB_QUEUE', 'default'),
|
||||||
|
'retry_after' => (int) env('DB_QUEUE_RETRY_AFTER', 90),
|
||||||
|
'after_commit' => false,
|
||||||
|
],
|
||||||
|
|
||||||
|
'beanstalkd' => [
|
||||||
|
'driver' => 'beanstalkd',
|
||||||
|
'host' => env('BEANSTALKD_QUEUE_HOST', 'localhost'),
|
||||||
|
'queue' => env('BEANSTALKD_QUEUE', 'default'),
|
||||||
|
'retry_after' => (int) env('BEANSTALKD_QUEUE_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' => env('REDIS_QUEUE_CONNECTION', 'default'),
|
||||||
|
'queue' => env('REDIS_QUEUE', 'default'),
|
||||||
|
'retry_after' => (int) env('REDIS_QUEUE_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', 'sqlite'),
|
||||||
|
'table' => 'job_batches',
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Failed Queue Jobs
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| These options configure the behavior of failed queue job logging so you
|
||||||
|
| can control how and where failed jobs are stored. Laravel ships with
|
||||||
|
| support for storing failed jobs in a simple file or in a database.
|
||||||
|
|
|
||||||
|
| Supported drivers: "database-uuids", "dynamodb", "file", "null"
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'failed' => [
|
||||||
|
'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'),
|
||||||
|
'database' => env('DB_CONNECTION', 'sqlite'),
|
||||||
|
'table' => 'failed_jobs',
|
||||||
|
],
|
||||||
|
|
||||||
|
];
|
84
config/sanctum.php
Normal file
84
config/sanctum.php
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
<?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::currentRequestHost(),
|
||||||
|
))),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| 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' => Illuminate\Cookie\Middleware\EncryptCookies::class,
|
||||||
|
'validate_csrf_token' => Illuminate\Foundation\Http\Middleware\ValidateCsrfToken::class,
|
||||||
|
],
|
||||||
|
|
||||||
|
];
|
38
config/services.php
Normal file
38
config/services.php
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
<?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.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'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'),
|
||||||
|
],
|
||||||
|
|
||||||
|
'resend' => [
|
||||||
|
'key' => env('RESEND_KEY'),
|
||||||
|
],
|
||||||
|
|
||||||
|
'slack' => [
|
||||||
|
'notifications' => [
|
||||||
|
'bot_user_oauth_token' => env('SLACK_BOT_USER_OAUTH_TOKEN'),
|
||||||
|
'channel' => env('SLACK_BOT_USER_DEFAULT_CHANNEL'),
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
];
|
217
config/session.php
Normal file
217
config/session.php
Normal file
@ -0,0 +1,217 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Default Session Driver
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| This option determines the default session driver that is utilized for
|
||||||
|
| incoming requests. Laravel supports a variety of storage options to
|
||||||
|
| persist session data. Database storage is a great default choice.
|
||||||
|
|
|
||||||
|
| Supported: "file", "cookie", "database", "apc",
|
||||||
|
| "memcached", "redis", "dynamodb", "array"
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'driver' => env('SESSION_DRIVER', 'database'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| 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 expire immediately when the browser is closed then you may
|
||||||
|
| indicate that via the expire_on_close configuration option.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'lifetime' => (int) env('SESSION_LIFETIME', 120),
|
||||||
|
|
||||||
|
'expire_on_close' => env('SESSION_EXPIRE_ON_CLOSE', false),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Session Encryption
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| This option allows you to easily specify that all of your session data
|
||||||
|
| should be encrypted before it's stored. All encryption is performed
|
||||||
|
| automatically by Laravel and you may use the session like normal.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'encrypt' => env('SESSION_ENCRYPT', false),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Session File Location
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| When utilizing the "file" session driver, the session files are placed
|
||||||
|
| on disk. The default storage location is defined here; however, you
|
||||||
|
| are free to provide another location where they should be stored.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'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 to
|
||||||
|
| be used to store sessions. Of course, a sensible default is defined
|
||||||
|
| for you; however, you're welcome to change this to another table.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'table' => env('SESSION_TABLE', 'sessions'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Session Cache Store
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| When using one of the framework's cache driven session backends, you may
|
||||||
|
| define the cache store which should be used to store the session data
|
||||||
|
| between requests. This must match one of your defined 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 session cookie that is created by
|
||||||
|
| the framework. Typically, you should not need to change this value
|
||||||
|
| since doing so does not grant a meaningful security improvement.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'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're free to change this when necessary.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'path' => env('SESSION_PATH', '/'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Session Cookie Domain
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| This value determines the domain and subdomains the session cookie is
|
||||||
|
| available to. By default, the cookie will be available to the root
|
||||||
|
| domain and all subdomains. Typically, this shouldn't be changed.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'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. It's unlikely you should disable this option.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'http_only' => env('SESSION_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" to permit secure cross-site requests.
|
||||||
|
|
|
||||||
|
| See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#samesitesamesite-value
|
||||||
|
|
|
||||||
|
| Supported: "lax", "strict", "none", null
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'same_site' => env('SESSION_SAME_SITE', 'lax'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Partitioned Cookies
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Setting this value to true will tie the cookie to the top-level site for
|
||||||
|
| a cross-site context. Partitioned cookies are accepted by the browser
|
||||||
|
| when flagged "secure" and the Same-Site attribute is set to "none".
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'partitioned' => env('SESSION_PARTITIONED_COOKIE', false),
|
||||||
|
|
||||||
|
];
|
126
config/wireui.php
Normal file
126
config/wireui.php
Normal file
@ -0,0 +1,126 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use WireUi\Components;
|
||||||
|
use WireUi\Enum\Packs;
|
||||||
|
use WireUi\WireUiConfig as Config;
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Prefix
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| This option controls the prefix for WireUI components. Examples:
|
||||||
|
|
|
||||||
|
| 'wireui-' => 'x-wireui-button'
|
||||||
|
| 'wireui:' => 'x-wireui:button'
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'prefix' => 'wireui:',
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Global Styles
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| This option controls the global styles for WireUI components.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'style' => [
|
||||||
|
'shadow' => Packs\Shadow::BASE,
|
||||||
|
'rounded' => Packs\Rounded::MD,
|
||||||
|
'color' => Packs\Color::PRIMARY,
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Default Configuration
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| This option controls the default configuration for WireUI components.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'alert' => Config::alert(),
|
||||||
|
|
||||||
|
'avatar' => Config::avatar(),
|
||||||
|
|
||||||
|
'badge' => Config::badge(),
|
||||||
|
|
||||||
|
'mini-badge' => Config::miniBadge(),
|
||||||
|
|
||||||
|
'button' => Config::button(),
|
||||||
|
|
||||||
|
'mini-button' => Config::miniButton(),
|
||||||
|
|
||||||
|
'card' => Config::card(),
|
||||||
|
|
||||||
|
'checkbox' => Config::checkbox(),
|
||||||
|
|
||||||
|
'color-picker' => Config::wrapper(),
|
||||||
|
|
||||||
|
'datetime-picker' => Config::dateTimePicker(),
|
||||||
|
|
||||||
|
'dialog' => Config::dialog(),
|
||||||
|
|
||||||
|
'dropdown' => Config::dropdown(),
|
||||||
|
|
||||||
|
'icon' => Config::icon(),
|
||||||
|
|
||||||
|
'input' => Config::wrapper(),
|
||||||
|
|
||||||
|
'currency' => Config::wrapper(),
|
||||||
|
|
||||||
|
'maskable' => Config::wrapper(),
|
||||||
|
|
||||||
|
'number' => Config::wrapper(),
|
||||||
|
|
||||||
|
'password' => Config::wrapper(),
|
||||||
|
|
||||||
|
'phone' => Config::wrapper(),
|
||||||
|
|
||||||
|
'link' => Config::link(),
|
||||||
|
|
||||||
|
'modal' => Config::modal(),
|
||||||
|
|
||||||
|
'modal-card' => Config::modal(),
|
||||||
|
|
||||||
|
'native-select' => Config::wrapper(),
|
||||||
|
|
||||||
|
'notifications' => Config::notifications(),
|
||||||
|
|
||||||
|
'radio' => Config::radio(),
|
||||||
|
|
||||||
|
'select' => Config::wrapper(),
|
||||||
|
|
||||||
|
'textarea' => Config::wrapper(),
|
||||||
|
|
||||||
|
'time-picker' => Config::timePicker(),
|
||||||
|
|
||||||
|
'time-selector' => Config::timeSelector(),
|
||||||
|
|
||||||
|
'toggle' => Config::toggle(),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| WireUI Components
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Change the alias to call the component with a different name.
|
||||||
|
| Extend the component and replace your changes in this file.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'components' => Config::defaultComponents([
|
||||||
|
// 'button' => [
|
||||||
|
// 'alias' => 'new-button',
|
||||||
|
// ],
|
||||||
|
// 'mini-button' => [
|
||||||
|
// 'class' => Components\Button\Mini::class,
|
||||||
|
// 'alias' => 'new-mini-button',
|
||||||
|
// ],
|
||||||
|
]),
|
||||||
|
];
|
1
database/.gitignore
vendored
Normal file
1
database/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
*.sqlite*
|
44
database/factories/UserFactory.php
Normal file
44
database/factories/UserFactory.php
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
<?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
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The current password being used by the 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,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
53
database/migrations/0001_01_01_000000_create_users_table.php
Normal file
53
database/migrations/0001_01_01_000000_create_users_table.php
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
<?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->string('phone', 10)->unique();
|
||||||
|
$table->date('birthday')->nullable(); // 生日
|
||||||
|
$table->enum('gender', ['unset','male', 'female', 'other'])->default('unset'); // 性別
|
||||||
|
$table->tinyInteger('status')->default(0); // 啟動
|
||||||
|
$table->timestamp('email_verified_at')->nullable();
|
||||||
|
$table->string('password');
|
||||||
|
$table->rememberToken();
|
||||||
|
$table->timestamps();
|
||||||
|
});
|
||||||
|
|
||||||
|
Schema::create('password_reset_tokens', function (Blueprint $table) {
|
||||||
|
$table->string('email')->primary();
|
||||||
|
$table->string('token');
|
||||||
|
$table->timestamp('created_at')->nullable();
|
||||||
|
});
|
||||||
|
|
||||||
|
Schema::create('sessions', function (Blueprint $table) {
|
||||||
|
$table->string('id')->primary();
|
||||||
|
$table->foreignId('user_id')->nullable()->index();
|
||||||
|
$table->string('ip_address', 45)->nullable();
|
||||||
|
$table->text('user_agent')->nullable();
|
||||||
|
$table->longText('payload');
|
||||||
|
$table->integer('last_activity')->index();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('users');
|
||||||
|
Schema::dropIfExists('password_reset_tokens');
|
||||||
|
Schema::dropIfExists('sessions');
|
||||||
|
}
|
||||||
|
};
|
35
database/migrations/0001_01_01_000001_create_cache_table.php
Normal file
35
database/migrations/0001_01_01_000001_create_cache_table.php
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
<?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('cache', function (Blueprint $table) {
|
||||||
|
$table->string('key')->primary();
|
||||||
|
$table->mediumText('value');
|
||||||
|
$table->integer('expiration');
|
||||||
|
});
|
||||||
|
|
||||||
|
Schema::create('cache_locks', function (Blueprint $table) {
|
||||||
|
$table->string('key')->primary();
|
||||||
|
$table->string('owner');
|
||||||
|
$table->integer('expiration');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('cache');
|
||||||
|
Schema::dropIfExists('cache_locks');
|
||||||
|
}
|
||||||
|
};
|
57
database/migrations/0001_01_01_000002_create_jobs_table.php
Normal file
57
database/migrations/0001_01_01_000002_create_jobs_table.php
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
<?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('jobs', function (Blueprint $table) {
|
||||||
|
$table->id();
|
||||||
|
$table->string('queue')->index();
|
||||||
|
$table->longText('payload');
|
||||||
|
$table->unsignedTinyInteger('attempts');
|
||||||
|
$table->unsignedInteger('reserved_at')->nullable();
|
||||||
|
$table->unsignedInteger('available_at');
|
||||||
|
$table->unsignedInteger('created_at');
|
||||||
|
});
|
||||||
|
|
||||||
|
Schema::create('job_batches', function (Blueprint $table) {
|
||||||
|
$table->string('id')->primary();
|
||||||
|
$table->string('name');
|
||||||
|
$table->integer('total_jobs');
|
||||||
|
$table->integer('pending_jobs');
|
||||||
|
$table->integer('failed_jobs');
|
||||||
|
$table->longText('failed_job_ids');
|
||||||
|
$table->mediumText('options')->nullable();
|
||||||
|
$table->integer('cancelled_at')->nullable();
|
||||||
|
$table->integer('created_at');
|
||||||
|
$table->integer('finished_at')->nullable();
|
||||||
|
});
|
||||||
|
|
||||||
|
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('jobs');
|
||||||
|
Schema::dropIfExists('job_batches');
|
||||||
|
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,140 @@
|
|||||||
|
<?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
|
||||||
|
{
|
||||||
|
$teams = config('permission.teams');
|
||||||
|
$tableNames = config('permission.table_names');
|
||||||
|
$columnNames = config('permission.column_names');
|
||||||
|
$pivotRole = $columnNames['role_pivot_key'] ?? 'role_id';
|
||||||
|
$pivotPermission = $columnNames['permission_pivot_key'] ?? 'permission_id';
|
||||||
|
|
||||||
|
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'], static function (Blueprint $table) {
|
||||||
|
// $table->engine('InnoDB');
|
||||||
|
$table->bigIncrements('id'); // permission id
|
||||||
|
$table->string('name'); // For MyISAM use string('name', 225); // (or 166 for InnoDB with Redundant/Compact row format)
|
||||||
|
$table->string('guard_name'); // For MyISAM use string('guard_name', 25);
|
||||||
|
$table->timestamps();
|
||||||
|
|
||||||
|
$table->unique(['name', 'guard_name']);
|
||||||
|
});
|
||||||
|
|
||||||
|
Schema::create($tableNames['roles'], static function (Blueprint $table) use ($teams, $columnNames) {
|
||||||
|
// $table->engine('InnoDB');
|
||||||
|
$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'); // For MyISAM use string('name', 225); // (or 166 for InnoDB with Redundant/Compact row format)
|
||||||
|
$table->string('guard_name'); // For MyISAM use string('guard_name', 25);
|
||||||
|
$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'], static function (Blueprint $table) use ($tableNames, $columnNames, $pivotPermission, $teams) {
|
||||||
|
$table->unsignedBigInteger($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($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'], $pivotPermission, $columnNames['model_morph_key'], 'model_type'],
|
||||||
|
'model_has_permissions_permission_model_type_primary');
|
||||||
|
} else {
|
||||||
|
$table->primary([$pivotPermission, $columnNames['model_morph_key'], 'model_type'],
|
||||||
|
'model_has_permissions_permission_model_type_primary');
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
Schema::create($tableNames['model_has_roles'], static function (Blueprint $table) use ($tableNames, $columnNames, $pivotRole, $teams) {
|
||||||
|
$table->unsignedBigInteger($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($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'], $pivotRole, $columnNames['model_morph_key'], 'model_type'],
|
||||||
|
'model_has_roles_role_model_type_primary');
|
||||||
|
} else {
|
||||||
|
$table->primary([$pivotRole, $columnNames['model_morph_key'], 'model_type'],
|
||||||
|
'model_has_roles_role_model_type_primary');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
Schema::create($tableNames['role_has_permissions'], static function (Blueprint $table) use ($tableNames, $pivotRole, $pivotPermission) {
|
||||||
|
$table->unsignedBigInteger($pivotPermission);
|
||||||
|
$table->unsignedBigInteger($pivotRole);
|
||||||
|
|
||||||
|
$table->foreign($pivotPermission)
|
||||||
|
->references('id') // permission id
|
||||||
|
->on($tableNames['permissions'])
|
||||||
|
->onDelete('cascade');
|
||||||
|
|
||||||
|
$table->foreign($pivotRole)
|
||||||
|
->references('id') // role id
|
||||||
|
->on($tableNames['roles'])
|
||||||
|
->onDelete('cascade');
|
||||||
|
|
||||||
|
$table->primary([$pivotPermission, $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.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
$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,27 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
|
||||||
|
class CreateActivityLogTable extends Migration
|
||||||
|
{
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::connection(config('activitylog.database_connection'))->create(config('activitylog.table_name'), function (Blueprint $table) {
|
||||||
|
$table->bigIncrements('id');
|
||||||
|
$table->string('log_name')->nullable();
|
||||||
|
$table->text('description');
|
||||||
|
$table->nullableMorphs('subject', 'subject');
|
||||||
|
$table->nullableMorphs('causer', 'causer');
|
||||||
|
$table->json('properties')->nullable();
|
||||||
|
$table->timestamps();
|
||||||
|
$table->index('log_name');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::connection(config('activitylog.database_connection'))->dropIfExists(config('activitylog.table_name'));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
|
||||||
|
class AddEventColumnToActivityLogTable extends Migration
|
||||||
|
{
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::connection(config('activitylog.database_connection'))->table(config('activitylog.table_name'), function (Blueprint $table) {
|
||||||
|
$table->string('event')->nullable()->after('subject_type');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::connection(config('activitylog.database_connection'))->table(config('activitylog.table_name'), function (Blueprint $table) {
|
||||||
|
$table->dropColumn('event');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
|
||||||
|
class AddBatchUuidColumnToActivityLogTable extends Migration
|
||||||
|
{
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::connection(config('activitylog.database_connection'))->table(config('activitylog.table_name'), function (Blueprint $table) {
|
||||||
|
$table->uuid('batch_uuid')->nullable()->after('properties');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::connection(config('activitylog.database_connection'))->table(config('activitylog.table_name'), function (Blueprint $table) {
|
||||||
|
$table->dropColumn('batch_uuid');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
33
database/seeders/CreateAdminUserSeeder.php
Normal file
33
database/seeders/CreateAdminUserSeeder.php
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Database\Seeders;
|
||||||
|
|
||||||
|
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||||
|
use Illuminate\Database\Seeder;
|
||||||
|
use App\Models\User;
|
||||||
|
|
||||||
|
class CreateAdminUserSeeder extends Seeder
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the database seeds.
|
||||||
|
*/
|
||||||
|
public function run(): void
|
||||||
|
{
|
||||||
|
$user = User::create([
|
||||||
|
'name' => 'Allen Yan(admin)',
|
||||||
|
'email' => 'admin@gmail.com',
|
||||||
|
'phone' => '0900000000',
|
||||||
|
'birthday' => now()->toDateString(),
|
||||||
|
'password' => bcrypt('aa1234')
|
||||||
|
]);
|
||||||
|
$user->assignRole('Admin');
|
||||||
|
$user = User::create([
|
||||||
|
'name' => 'Allen Yan(User)',
|
||||||
|
'email' => 'allen.yan@gmail.com',
|
||||||
|
'phone' => '0900000001',
|
||||||
|
'birthday' => now()->toDateString(),
|
||||||
|
'password' => bcrypt('aa1234')
|
||||||
|
]);
|
||||||
|
$user->assignRole('User');
|
||||||
|
}
|
||||||
|
}
|
21
database/seeders/DatabaseSeeder.php
Normal file
21
database/seeders/DatabaseSeeder.php
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Database\Seeders;
|
||||||
|
|
||||||
|
use App\Models\User;
|
||||||
|
// use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||||
|
use Illuminate\Database\Seeder;
|
||||||
|
|
||||||
|
class DatabaseSeeder extends Seeder
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Seed the application's database.
|
||||||
|
*/
|
||||||
|
public function run(): void
|
||||||
|
{
|
||||||
|
$this->call([
|
||||||
|
PermissionTableSeeder::class,
|
||||||
|
CreateAdminUserSeeder::class,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
38
database/seeders/PermissionTableSeeder.php
Normal file
38
database/seeders/PermissionTableSeeder.php
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Database\Seeders;
|
||||||
|
|
||||||
|
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||||
|
use Illuminate\Database\Seeder;
|
||||||
|
use Spatie\Permission\Models\Role;
|
||||||
|
use Spatie\Permission\Models\Permission;
|
||||||
|
|
||||||
|
class PermissionTableSeeder extends Seeder
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the database seeds.
|
||||||
|
*/
|
||||||
|
public function run(): void
|
||||||
|
{
|
||||||
|
$permissions = [
|
||||||
|
'role-list',
|
||||||
|
'role-create',
|
||||||
|
'role-edit',
|
||||||
|
'role-delete',
|
||||||
|
'user-list',
|
||||||
|
'user-create',
|
||||||
|
'user-edit',
|
||||||
|
'user-delete',
|
||||||
|
];
|
||||||
|
|
||||||
|
foreach ($permissions as $permission) {
|
||||||
|
Permission::create(['name' => $permission]);
|
||||||
|
}
|
||||||
|
// 建立 Admin 角色,給所有權限
|
||||||
|
$adminRole = Role::firstOrCreate(['name' => 'Admin']);
|
||||||
|
$adminRole->syncPermissions(Permission::all());
|
||||||
|
|
||||||
|
// 建立 User 角色,不給任何權限
|
||||||
|
Role::firstOrCreate(['name' => 'User']);
|
||||||
|
}
|
||||||
|
}
|
3838
package-lock.json
generated
Normal file
3838
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
22
package.json
Normal file
22
package.json
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"private": true,
|
||||||
|
"type": "module",
|
||||||
|
"scripts": {
|
||||||
|
"build": "vite build",
|
||||||
|
"dev": "vite"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@tailwindcss/forms": "^0.5.2",
|
||||||
|
"@tailwindcss/vite": "^4.0.0",
|
||||||
|
"autoprefixer": "^10.4.2",
|
||||||
|
"axios": "^1.8.2",
|
||||||
|
"concurrently": "^9.0.1",
|
||||||
|
"laravel-vite-plugin": "^1.2.0",
|
||||||
|
"postcss": "^8.4.31",
|
||||||
|
"tailwindcss": "^3.1.0",
|
||||||
|
"vite": "^6.2.4"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"flatpickr": "^4.6.13"
|
||||||
|
}
|
||||||
|
}
|
33
phpunit.xml
Normal file
33
phpunit.xml
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
|
||||||
|
bootstrap="vendor/autoload.php"
|
||||||
|
colors="true"
|
||||||
|
>
|
||||||
|
<testsuites>
|
||||||
|
<testsuite name="Unit">
|
||||||
|
<directory>tests/Unit</directory>
|
||||||
|
</testsuite>
|
||||||
|
<testsuite name="Feature">
|
||||||
|
<directory>tests/Feature</directory>
|
||||||
|
</testsuite>
|
||||||
|
</testsuites>
|
||||||
|
<source>
|
||||||
|
<include>
|
||||||
|
<directory>app</directory>
|
||||||
|
</include>
|
||||||
|
</source>
|
||||||
|
<php>
|
||||||
|
<env name="APP_ENV" value="testing"/>
|
||||||
|
<env name="APP_MAINTENANCE_DRIVER" value="file"/>
|
||||||
|
<env name="BCRYPT_ROUNDS" value="4"/>
|
||||||
|
<env name="CACHE_STORE" value="array"/>
|
||||||
|
<env name="DB_CONNECTION" value="sqlite"/>
|
||||||
|
<env name="DB_DATABASE" value=":memory:"/>
|
||||||
|
<env name="MAIL_MAILER" value="array"/>
|
||||||
|
<env name="PULSE_ENABLED" value="false"/>
|
||||||
|
<env name="QUEUE_CONNECTION" value="sync"/>
|
||||||
|
<env name="SESSION_DRIVER" value="array"/>
|
||||||
|
<env name="TELESCOPE_ENABLED" value="false"/>
|
||||||
|
</php>
|
||||||
|
</phpunit>
|
6
postcss.config.js
Normal file
6
postcss.config.js
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
export default {
|
||||||
|
plugins: {
|
||||||
|
tailwindcss: {},
|
||||||
|
autoprefixer: {},
|
||||||
|
},
|
||||||
|
};
|
25
public/.htaccess
Normal file
25
public/.htaccess
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
<IfModule mod_rewrite.c>
|
||||||
|
<IfModule mod_negotiation.c>
|
||||||
|
Options -MultiViews -Indexes
|
||||||
|
</IfModule>
|
||||||
|
|
||||||
|
RewriteEngine On
|
||||||
|
|
||||||
|
# Handle Authorization Header
|
||||||
|
RewriteCond %{HTTP:Authorization} .
|
||||||
|
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
|
||||||
|
|
||||||
|
# Handle X-XSRF-Token Header
|
||||||
|
RewriteCond %{HTTP:x-xsrf-token} .
|
||||||
|
RewriteRule .* - [E=HTTP_X_XSRF_TOKEN:%{HTTP:X-XSRF-Token}]
|
||||||
|
|
||||||
|
# Redirect Trailing Slashes If Not A Folder...
|
||||||
|
RewriteCond %{REQUEST_FILENAME} !-d
|
||||||
|
RewriteCond %{REQUEST_URI} (.+)/$
|
||||||
|
RewriteRule ^ %1 [L,R=301]
|
||||||
|
|
||||||
|
# Send Requests To Front Controller...
|
||||||
|
RewriteCond %{REQUEST_FILENAME} !-d
|
||||||
|
RewriteCond %{REQUEST_FILENAME} !-f
|
||||||
|
RewriteRule ^ index.php [L]
|
||||||
|
</IfModule>
|
0
public/favicon.ico
Normal file
0
public/favicon.ico
Normal file
20
public/index.php
Normal file
20
public/index.php
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Application;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
define('LARAVEL_START', microtime(true));
|
||||||
|
|
||||||
|
// Determine if the application is in maintenance mode...
|
||||||
|
if (file_exists($maintenance = __DIR__.'/../storage/framework/maintenance.php')) {
|
||||||
|
require $maintenance;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Register the Composer autoloader...
|
||||||
|
require __DIR__.'/../vendor/autoload.php';
|
||||||
|
|
||||||
|
// Bootstrap Laravel and handle the request...
|
||||||
|
/** @var Application $app */
|
||||||
|
$app = require_once __DIR__.'/../bootstrap/app.php';
|
||||||
|
|
||||||
|
$app->handleRequest(Request::capture());
|
2
public/robots.txt
Normal file
2
public/robots.txt
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
User-agent: *
|
||||||
|
Disallow:
|
8
resources/css/app.css
Normal file
8
resources/css/app.css
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
/* 引入 PowerGrid 的樣式 */
|
||||||
|
@import './../../vendor/power-components/livewire-powergrid/dist/tailwind.css';
|
||||||
|
@import "flatpickr/dist/flatpickr.min.css";
|
||||||
|
|
||||||
|
@tailwind base;
|
||||||
|
@tailwind components;
|
||||||
|
@tailwind utilities;
|
||||||
|
|
7
resources/js/app.js
Normal file
7
resources/js/app.js
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
import './bootstrap';
|
||||||
|
import './../../vendor/power-components/livewire-powergrid/dist/powergrid';
|
||||||
|
import flatpickr from "flatpickr";
|
||||||
|
import 'flatpickr/dist/flatpickr.min.css';
|
||||||
|
import { Mandarin } from 'flatpickr/dist/l10n/zh.js';
|
||||||
|
|
||||||
|
flatpickr.localize(Mandarin);
|
4
resources/js/bootstrap.js
vendored
Normal file
4
resources/js/bootstrap.js
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
import axios from 'axios';
|
||||||
|
window.axios = axios;
|
||||||
|
|
||||||
|
window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
|
75
resources/lang/vendor/livewire-powergrid/en/datatable.php
vendored
Normal file
75
resources/lang/vendor/livewire-powergrid/en/datatable.php
vendored
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
'buttons' => [
|
||||||
|
'filter' => 'Filter',
|
||||||
|
'clear_all_filters' => 'Clear all',
|
||||||
|
],
|
||||||
|
'labels' => [
|
||||||
|
'action' => 'Actions',
|
||||||
|
'results_per_page' => 'Records per page',
|
||||||
|
'clear_filter' => 'Clear filter',
|
||||||
|
'no_data' => 'No records found',
|
||||||
|
'all' => 'All',
|
||||||
|
'selected' => 'Selected',
|
||||||
|
'filtered' => 'Filtered',
|
||||||
|
],
|
||||||
|
'placeholders' => [
|
||||||
|
'search' => 'Search...',
|
||||||
|
'select' => 'Select a period',
|
||||||
|
],
|
||||||
|
'pagination' => [
|
||||||
|
'showing' => 'Showing',
|
||||||
|
'to' => 'to',
|
||||||
|
'of' => 'of',
|
||||||
|
'results' => 'Results',
|
||||||
|
'all' => 'All',
|
||||||
|
],
|
||||||
|
'multi_select' => [
|
||||||
|
'select' => 'Select',
|
||||||
|
'all' => 'All',
|
||||||
|
],
|
||||||
|
'select' => [
|
||||||
|
'select' => 'Select',
|
||||||
|
'all' => 'All',
|
||||||
|
],
|
||||||
|
'boolean_filter' => [
|
||||||
|
'all' => 'All',
|
||||||
|
],
|
||||||
|
'input_text_options' => [
|
||||||
|
'is' => 'Is',
|
||||||
|
'is_not' => 'Is not',
|
||||||
|
'contains' => 'Contains',
|
||||||
|
'contains_not' => 'Does not contain',
|
||||||
|
'starts_with' => 'Starts with',
|
||||||
|
'ends_with' => 'Ends with',
|
||||||
|
'is_empty' => 'Is empty',
|
||||||
|
'is_not_empty' => 'Is not empty',
|
||||||
|
'is_null' => 'Is null',
|
||||||
|
'is_not_null' => 'Is not null',
|
||||||
|
'is_blank' => 'Is blank',
|
||||||
|
'is_not_blank' => 'Is not blank',
|
||||||
|
],
|
||||||
|
'export' => [
|
||||||
|
'exporting' => 'Please wait!',
|
||||||
|
'completed' => 'Export completed! Your files are ready for download',
|
||||||
|
],
|
||||||
|
'soft_deletes' => [
|
||||||
|
'message_with_trashed' => 'Displaying all records, including deleted ones.',
|
||||||
|
'message_only_trashed' => 'Displaying only deleted records.',
|
||||||
|
'without_trashed' => 'Without deleted',
|
||||||
|
'with_trashed' => 'With deleted',
|
||||||
|
'only_trashed' => 'Only deleted',
|
||||||
|
],
|
||||||
|
'multi_sort' => [
|
||||||
|
'message' => 'Multiple sort is active',
|
||||||
|
],
|
||||||
|
'buttons_macros' => [
|
||||||
|
'confirm' => [
|
||||||
|
'message' => 'Are you sure you want to perform this action?',
|
||||||
|
],
|
||||||
|
'confirm_prompt' => [
|
||||||
|
'message' => "Are you sure you want to perform this action? \n\n Enter :confirmValue to confirm.",
|
||||||
|
],
|
||||||
|
],
|
||||||
|
];
|
75
resources/lang/vendor/livewire-powergrid/zh-tw/datatable.php
vendored
Normal file
75
resources/lang/vendor/livewire-powergrid/zh-tw/datatable.php
vendored
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
'buttons' => [
|
||||||
|
'filter' => '篩選',
|
||||||
|
'clear_all_filters' => '清除全部',
|
||||||
|
],
|
||||||
|
'labels' => [
|
||||||
|
'action' => '操作',
|
||||||
|
'results_per_page' => '每頁記錄數',
|
||||||
|
'clear_filter' => '清除篩選',
|
||||||
|
'no_data' => '未找到任何記錄',
|
||||||
|
'all' => '全部',
|
||||||
|
'selected' => '選定',
|
||||||
|
'filtered' => '已過濾',
|
||||||
|
],
|
||||||
|
'placeholders' => [
|
||||||
|
'search' => '搜尋...',
|
||||||
|
'select' => '選擇時段',
|
||||||
|
],
|
||||||
|
'pagination' => [
|
||||||
|
'showing' => 'Showing',
|
||||||
|
'to' => 'to',
|
||||||
|
'of' => 'of',
|
||||||
|
'results' => 'Results',
|
||||||
|
'all' => '全部',
|
||||||
|
],
|
||||||
|
'multi_select' => [
|
||||||
|
'select' => 'Select',
|
||||||
|
'all' => '全部',
|
||||||
|
],
|
||||||
|
'select' => [
|
||||||
|
'select' => 'Select',
|
||||||
|
'all' => '全部',
|
||||||
|
],
|
||||||
|
'boolean_filter' => [
|
||||||
|
'all' => '全部',
|
||||||
|
],
|
||||||
|
'input_text_options' => [
|
||||||
|
'is' => 'Is',
|
||||||
|
'is_not' => 'Is not',
|
||||||
|
'contains' => 'Contains',
|
||||||
|
'contains_not' => 'Does not contain',
|
||||||
|
'starts_with' => 'Starts with',
|
||||||
|
'ends_with' => 'Ends with',
|
||||||
|
'is_empty' => 'Is empty',
|
||||||
|
'is_not_empty' => 'Is not empty',
|
||||||
|
'is_null' => 'Is null',
|
||||||
|
'is_not_null' => 'Is not null',
|
||||||
|
'is_blank' => 'Is blank',
|
||||||
|
'is_not_blank' => 'Is not blank',
|
||||||
|
],
|
||||||
|
'export' => [
|
||||||
|
'exporting' => 'Please wait!',
|
||||||
|
'completed' => 'Export completed! Your files are ready for download',
|
||||||
|
],
|
||||||
|
'soft_deletes' => [
|
||||||
|
'message_with_trashed' => 'Displaying all records, including deleted ones.',
|
||||||
|
'message_only_trashed' => 'Displaying only deleted records.',
|
||||||
|
'without_trashed' => 'Without deleted',
|
||||||
|
'with_trashed' => 'With deleted',
|
||||||
|
'only_trashed' => 'Only deleted',
|
||||||
|
],
|
||||||
|
'multi_sort' => [
|
||||||
|
'message' => 'Multiple sort is active',
|
||||||
|
],
|
||||||
|
'buttons_macros' => [
|
||||||
|
'confirm' => [
|
||||||
|
'message' => 'Are you sure you want to perform this action?',
|
||||||
|
],
|
||||||
|
'confirm_prompt' => [
|
||||||
|
'message' => "Are you sure you want to perform this action? \n\n Enter :confirmValue to confirm.",
|
||||||
|
],
|
||||||
|
],
|
||||||
|
];
|
178
resources/lang/zh-tw.json
Normal file
178
resources/lang/zh-tw.json
Normal file
@ -0,0 +1,178 @@
|
|||||||
|
{
|
||||||
|
"api.api_token_manager": "resources/views/api/api-token-manager.blade.php"
|
||||||
|
,"Create API Token":"創建API令牌"
|
||||||
|
,"API tokens allow third-party services to authenticate with our application on your behalf.":"API 令牌允許第三方服務代表您透過我們的應用程式進行身份驗證。"
|
||||||
|
,"Token Name":"Token 名稱"
|
||||||
|
,"Permissions":"權限"
|
||||||
|
,"Created.":"已建立。"
|
||||||
|
,"Create":"創造"
|
||||||
|
,"Manage API Tokens":"管理 API Token"
|
||||||
|
,"You may delete any of your existing tokens if they are no longer needed.":"如果不再需要任何現有令牌,您可以將其刪除。"
|
||||||
|
,"Last used":"最後使用"
|
||||||
|
,"Delete":"刪除"
|
||||||
|
,"API Token":"API Token"
|
||||||
|
,"Please copy your new API token. For your security, it won't be shown again.":"請複製您的新 API token。為了您的安全,它不會再次顯示。"
|
||||||
|
,"Close":"關閉"
|
||||||
|
,"API Token Permissions":"API token 權限"
|
||||||
|
,"Cancel":"取消"
|
||||||
|
,"Save":"儲存"
|
||||||
|
,"Delete API Token":"刪除 API token"
|
||||||
|
,"Are you sure you would like to delete this API token?":"您確定要刪除此 API token嗎?"
|
||||||
|
,"api.index.blade": "resources/views/api/index.blade.php"
|
||||||
|
,"API Tokens":"API Tokens"
|
||||||
|
,"auth.confirm-password":"resources/views/auth/confirm-password.blade.php"
|
||||||
|
,"This is a secure area of the application. Please confirm your password before continuing.":"這是應用程式的安全區域。 請先確認您的密碼,然後再繼續。"
|
||||||
|
,"Confirm":"確認"
|
||||||
|
,"auth.forgot-password":"resources/views/auth/forgot-password.blade.php"
|
||||||
|
,"Forgot your password? No problem. Just let us know your email address and we will email you a password reset link that will allow you to choose a new one.":"忘記密碼了嗎? 沒問題。 只需告訴我們您的電子郵件地址,我們就會透過電子郵件向您發送密碼重設鏈接,您可以透過該連結選擇新密碼。"
|
||||||
|
,"Email Password Reset Link":"電子郵件密碼重設鏈接"
|
||||||
|
,"auth.login":"resources/views/auth/login.blade.php"
|
||||||
|
,"Email":"電子郵件"
|
||||||
|
,"Password":"密碼"
|
||||||
|
,"Remember me":"記住帳號"
|
||||||
|
,"Forgot your password?":"忘記密碼了嗎?"
|
||||||
|
,"Log in": "登入"
|
||||||
|
,"auth.register":"resources/views/auth/register.blade.php"
|
||||||
|
,"Name":"名稱"
|
||||||
|
,"I agree to the :terms_of_service and :privacy_policy":"我同意 :terms_of_service 和 :privacy_policy"
|
||||||
|
,"Confirm Password":"確認密碼"
|
||||||
|
,"Already registered?":"已經註冊?"
|
||||||
|
,"Register":"註冊"
|
||||||
|
,"auth.reset-password":"resources/views/auth/reset-password.blade.php"
|
||||||
|
,"Reset Password":"重新設密碼"
|
||||||
|
,"auth.two-factor-challenge":"resources/views/auth/two-factor-challenge.blade.php"
|
||||||
|
,"Please confirm access to your account by entering the authentication code provided by your authenticator application.":"請輸入驗證器應用程式提供的驗證碼來確認對您帳戶的存取。"
|
||||||
|
,"Please confirm access to your account by entering one of your emergency recovery codes.":"請輸入您的緊急恢復代碼之一來確認對您帳戶的訪問。"
|
||||||
|
,"Code":"代碼"
|
||||||
|
,"Recovery Code":"恢復代碼"
|
||||||
|
,"Use a recovery code":"使用恢復代碼"
|
||||||
|
,"Use an authentication code":"使用驗證碼"
|
||||||
|
,"auth.verify-email":"resources/views/auth/verify-email.blade.php"
|
||||||
|
,"Before continuing, could you verify your email address by clicking on the link we just emailed to you? If you didn't receive the email, we will gladly send you another.":"在繼續之前,您可以點擊我們剛剛發送到您郵箱的鏈接來驗證您的郵箱地址嗎?如果您沒有收到郵件,我們很樂意重新發送。"
|
||||||
|
,"A new verification link has been sent to the email address you provided in your profile settings.":"一個新的驗證鏈接已經發送到您在個人資料設置中提供的郵箱地址。"
|
||||||
|
,"Resend Verification Email":"重新發送驗證郵件"
|
||||||
|
,"Edit Profile":"修改個人資料"
|
||||||
|
,"Log Out": "登出"
|
||||||
|
,"components.confirms-password":"resources/views/components/confirms-password.blade.php"
|
||||||
|
,"For your security, please confirm your password to continue.":"為了您的安全,請確認您的密碼以繼續。"
|
||||||
|
,"components/validation-errors":"resources/views/components/validation-errors.blade.php"
|
||||||
|
,"Whoops! Something went wrong.":"哎呀! 出了些問題。"
|
||||||
|
,"emails.team-invitation":"resources/views/emails/team-invitation.blade.php"
|
||||||
|
,"You have been invited to join the :team team!":""
|
||||||
|
,"If you do not have an account, you may create one by clicking the button below. After creating an account, you may click the invitation acceptance button in this email to accept the team invitation:":""
|
||||||
|
,"Create Account":""
|
||||||
|
,"If you already have an account, you may accept this invitation by clicking the button below:":""
|
||||||
|
,"You may accept this invitation by clicking the button below:":""
|
||||||
|
,"Accept Invitation":""
|
||||||
|
,"If you did not expect to receive an invitation to this team, you may discard this email.":""
|
||||||
|
,"profile.connect-google-information":"resources/views/profile/connect-google-information.blade.php"
|
||||||
|
,"Link Google": "連結Google"
|
||||||
|
,"connect google information.": "連接Google資訊。"
|
||||||
|
,"currently there are google login options available.": "目前有可用的Google登入選項。"
|
||||||
|
,"profile.connect-line-information":"resources/views/profile/connect-line-information.blade.php"
|
||||||
|
,"Link Line": "連結Line"
|
||||||
|
,"connect line information.": "連接 Line 資訊。"
|
||||||
|
,"currently there are line login options available.": "目前有可用的Line登入選項。"
|
||||||
|
,"profile.delete-user-form":"resources/views/profile/delete-user-form.blade.php"
|
||||||
|
,"Delete Account":"刪除帳戶"
|
||||||
|
,"Permanently delete your account.":"永久刪除您的帳戶。"
|
||||||
|
,"Once your account is deleted, all of its resources and data will be permanently deleted. Before deleting your account, please download any data or information that you wish to retain.":"一旦您的帳戶被刪除,其所有資源和資料將永久刪除。 在刪除您的帳戶之前,請下載您希望保留的任何資料或資訊。"
|
||||||
|
,"Are you sure you want to delete your account? Once your account is deleted, all of its resources and data will be permanently deleted. Please enter your password to confirm you would like to permanently delete your account.":"您確定要刪除您的帳戶嗎? 一旦您的帳戶被刪除,其所有資源和資料將永久刪除。 請輸入您的密碼以確認您想要永久刪除您的帳戶。"
|
||||||
|
,"profile.logout-other-browser-sessions-form":"resources/views/profile/logout-other-browser-sessions-form.blade.php"
|
||||||
|
,"Browser Sessions":"瀏覽器會話"
|
||||||
|
,"Manage and log out your active sessions on other browsers and devices.":"管理並登出其他瀏覽器和裝置上的活動會話。"
|
||||||
|
,"If necessary, you may log out of all of your other browser sessions across all of your devices. Some of your recent sessions are listed below; however, this list may not be exhaustive. If you feel your account has been compromised, you should also update your password.":"如有必要,您可以在所有裝置上登出所有其他瀏覽器工作階段。下面列出了您最近的一些會話;但是,此清單可能並不詳盡。如果您認為您的帳戶已被盜用,您可以也應該更新您的密碼。"
|
||||||
|
,"Unknown":"未知"
|
||||||
|
,"This device":"這個設備"
|
||||||
|
,"Last active":"最後登入"
|
||||||
|
,"Log Out Other Browser Sessions":"登出其他瀏覽器會話"
|
||||||
|
,"Done.":"完畢。"
|
||||||
|
,"Please enter your password to confirm you would like to log out of your other browser sessions across all of your devices.":"請輸入您的密碼以確認您想要退出所有裝置上的其他瀏覽器會話。"
|
||||||
|
,"profile.show":"resources/views/profile/show.blade.php"
|
||||||
|
,"Profile":"檔案"
|
||||||
|
,"profile.two-factor-authentication-form":"resources/views/profile/two-factor-authentication-form.blade.php"
|
||||||
|
,"Two Factor Authentication":"雙重身份驗證"
|
||||||
|
,"Add additional security to your account using two factor authentication.":"使用兩因素身份驗證為您的帳戶添加額外的安全性。"
|
||||||
|
,"Finish enabling two factor authentication.":"完成啟用兩因素身份驗證。"
|
||||||
|
,"You have enabled two factor authentication.":"您已啟用兩因素身份驗證。"
|
||||||
|
,"You have not enabled two factor authentication.":"您尚未啟用兩因素身份驗證。"
|
||||||
|
,"When two factor authentication is enabled, you will be prompted for a secure, random token during authentication. You may retrieve this token from your phone's Google Authenticator application.":"啟用兩因素身份驗證後,系統將在身份驗證過程中提示您輸入安全的隨機令牌。 您可以從手機的 Google 身份驗證器應用程式中檢索此令牌。"
|
||||||
|
,"To finish enabling two factor authentication, scan the following QR code using your phone's authenticator application or enter the setup key and provide the generated OTP code.":"若要完成啟用兩因素身份驗證,請使用手機的身份驗證器應用程式掃描以下二維碼,或輸入設定密鑰並提供產生的 OTP 代碼。"
|
||||||
|
,"Two factor authentication is now enabled. Scan the following QR code using your phone's authenticator application or enter the setup key.":"現已啟用兩因素身份驗證。 使用手機的驗證器應用程式掃描以下二維碼或輸入設定金鑰。"
|
||||||
|
,"Setup Key":"設定 Key"
|
||||||
|
,"Store these recovery codes in a secure password manager. They can be used to recover access to your account if your two factor authentication device is lost.":"將這些恢復代碼儲存在安全的密碼管理器中。 如果您的雙重認證裝置遺失,它們可用於恢復對您帳戶的存取權限。"
|
||||||
|
,"Enable":"啟用"
|
||||||
|
,"Regenerate Recovery Codes":"重新產生恢復程式碼"
|
||||||
|
,"Show Recovery Codes":"顯示恢復代碼"
|
||||||
|
,"Disable":"停用"
|
||||||
|
,"profile.update-password-form":"resources/views/profile/update-password-form.blade.php"
|
||||||
|
,"Update Password":"更新密碼"
|
||||||
|
,"Ensure your account is using a long, random password to stay secure.":"確保您的帳戶使用長的隨機密碼以確保安全。"
|
||||||
|
,"Current Password":"目前密碼"
|
||||||
|
,"New Password":"新密碼"
|
||||||
|
,"Saved.":"已儲存。"
|
||||||
|
,"profile.update-profile-information-form":"resources/views/profile/update-profile-information-form.blade.php"
|
||||||
|
,"Profile Information":"檔案資訊"
|
||||||
|
,"Update your account's profile information and email address.":"更新您帳戶的個人資料資訊和電子郵件地址。"
|
||||||
|
,"Photo":"照片"
|
||||||
|
,"Select A New Photo":"選擇一張新照片"
|
||||||
|
,"Remove Photo":"刪除照片"
|
||||||
|
,"Your email address is unverified.":"您的電子郵件地址未經驗證。"
|
||||||
|
,"Click here to re-send the verification email.":"點擊此處重新發送驗證郵件。"
|
||||||
|
,"A new verification link has been sent to your email address.":"新的驗證連結已發送到您的電子郵件地址。"
|
||||||
|
,"Male": "男性"
|
||||||
|
,"Female": "女性"
|
||||||
|
,"Other": "中性"
|
||||||
|
,"teams.create-team-form":"resources/views/teams/create-team-form.blade.php"
|
||||||
|
,"Team Details":"團隊詳細資料"
|
||||||
|
,"Create a new team to collaborate with others on projects.":"創建一個新團隊與其他人就專案進行協作。"
|
||||||
|
,"Team Owner":"團隊負責人"
|
||||||
|
,"Team Name":"隊名"
|
||||||
|
,"teams.create":"resources/views/teams/create.blade.php"
|
||||||
|
,"Create Team":"創建團隊"
|
||||||
|
,"teams.delete-team-form":"resources/views/teams/delete-team-form.blade.php"
|
||||||
|
,"Delete Team":"刪除團隊"
|
||||||
|
,"Permanently delete this team.":"永久刪除該團隊。"
|
||||||
|
,"Once a team is deleted, all of its resources and data will be permanently deleted. Before deleting this team, please download any data or information regarding this team that you wish to retain.":"團隊一旦被刪除,其所有資源和資料都將被永久刪除。刪除該團隊之前,請下載您希望保留的有關該團隊的任何資料或資訊。"
|
||||||
|
,"Are you sure you want to delete this team? Once a team is deleted, all of its resources and data will be permanently deleted.":"您確定要刪除該團隊嗎?一旦刪除團隊,團隊的所有資源和資料都將永久刪除。"
|
||||||
|
,"teams.show":"resources/views/teams/show.blade.php"
|
||||||
|
,"Team Settings":"團隊設定"
|
||||||
|
,"teams.team-member-manager":"resources/views/teams/team-member-manager.blade.php"
|
||||||
|
,"Add Team Member":"新增團隊成員"
|
||||||
|
,"Add a new team member to your team, allowing them to collaborate with you.":"為您的團隊增加新的團隊成員,讓他們能夠與您協作。"
|
||||||
|
,"Please provide the email address of the person you would like to add to this team.":"請提供您想要新增至此團隊的人員的電子郵件地址。"
|
||||||
|
,"Role":"角色"
|
||||||
|
,"Added.":"添加。"
|
||||||
|
,"Add":"添加"
|
||||||
|
,"Pending Team Invitations":"待處理的團隊邀請"
|
||||||
|
,"These people have been invited to your team and have been sent an invitation email. They may join the team by accepting the email invitation.":"這些人已被邀請加入您的團隊,並已收到邀請電子郵件。他們可以透過接受電子郵件邀請加入團隊。"
|
||||||
|
,"Team Members":"團隊成員"
|
||||||
|
,"All of the people that are part of this team.":"這個團隊的所有成員。"
|
||||||
|
,"Leave":"離開"
|
||||||
|
,"Remove":"消除"
|
||||||
|
,"Manage Role":"管理角色"
|
||||||
|
,"Leave Team":"離開隊伍"
|
||||||
|
,"Are you sure you would like to leave this team?":"您確定要離開這個團隊嗎?"
|
||||||
|
,"Remove Team Member":"刪除團隊成員"
|
||||||
|
,"Are you sure you would like to remove this person from the team?":"您確定要將此人從團隊中刪除嗎?"
|
||||||
|
,"teams.update-team-name-form":"resources/views/teams/update-team-name-form.blade.php"
|
||||||
|
,"The team's name and owner information.":"團隊名稱和所有者資訊。"
|
||||||
|
,"dashboard":"resources/views/dashboard.blade.php"
|
||||||
|
,"Dashboard":"主頁"
|
||||||
|
,"navigation-menu":"resources/views/navigation-menu.blade.php"
|
||||||
|
,"Manage Team":"管理團隊"
|
||||||
|
,"Create New Team":"創建新團隊"
|
||||||
|
,"Switch Teams":"切換團隊"
|
||||||
|
,"welcome":"resources/views/welcome.blade.php"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
,"Back Home": "回首頁"
|
||||||
|
,"Phone":"手機門號"
|
||||||
|
,"Address":"地址"
|
||||||
|
,"Email or Phone":"電子郵件 / 手機門號"
|
||||||
|
,"Terms of Service":"服務條款"
|
||||||
|
,"Privacy Policy":"隱私權政策"
|
||||||
|
,"Manage Account":"管理帳號"
|
||||||
|
|
||||||
|
}
|
5
resources/lang/zh-tw/activity-log.php
Normal file
5
resources/lang/zh-tw/activity-log.php
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
'list' => '操作記錄'
|
||||||
|
];
|
20
resources/lang/zh-tw/auth.php
Normal file
20
resources/lang/zh-tw/auth.php
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Authentication Language Lines
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| The following language lines are used during authentication for various
|
||||||
|
| messages that we need to display to the user. You are free to modify
|
||||||
|
| these language lines according to your application's requirements.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'failed' => '這些憑證與我們的記錄不符。',
|
||||||
|
'password' => '提供的密碼不正確。',
|
||||||
|
'throttle' => '登入嘗試次數過多。 請在 :seconds 秒後重試。',
|
||||||
|
|
||||||
|
];
|
11
resources/lang/zh-tw/enums.php
Normal file
11
resources/lang/zh-tw/enums.php
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
'user.gender.Male' =>'男',
|
||||||
|
'user.gender.Female' =>'女',
|
||||||
|
'user.gender.Other' =>'其他',
|
||||||
|
'user.gender.Unset' =>'未定義',
|
||||||
|
'user.status.Active' => '正常',
|
||||||
|
'user.status.Suspended' => '停權',
|
||||||
|
'user.status.Deleting' => '刪除中',
|
||||||
|
];
|
19
resources/lang/zh-tw/pagination.php
Normal file
19
resources/lang/zh-tw/pagination.php
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Pagination Language Lines
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| The following language lines are used by the paginator library to build
|
||||||
|
| the simple pagination links. You are free to change them to anything
|
||||||
|
| you want to customize your views to better match your application.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'previous' => '« 以前的',
|
||||||
|
'next' => '下一個 »',
|
||||||
|
|
||||||
|
];
|
22
resources/lang/zh-tw/passwords.php
Normal file
22
resources/lang/zh-tw/passwords.php
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Password Reset Language Lines
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| The following language lines are the default lines which match reasons
|
||||||
|
| that are given by the password broker for a password update attempt
|
||||||
|
| has failed, such as for an invalid token or invalid new password.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'reset' => '您的密碼已重設。',
|
||||||
|
'sent' => '我們已透過電子郵件發送您的密碼重設連結。',
|
||||||
|
'throttled' => '請稍候再重試。',
|
||||||
|
'token' => '此密碼重設令牌無效。',
|
||||||
|
'user' => "我們找不到具有該電子郵件地址的使用者。",
|
||||||
|
|
||||||
|
];
|
22
resources/lang/zh-tw/roles.php
Normal file
22
resources/lang/zh-tw/roles.php
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
'list' => '角色列表',
|
||||||
|
'CreateNew' => '新增角色',
|
||||||
|
'EditRole' => '編輯角色',
|
||||||
|
'edit' => '編輯',
|
||||||
|
'delete' => '刪除',
|
||||||
|
|
||||||
|
'no' => '編號',
|
||||||
|
'name' => '名稱',
|
||||||
|
'permissions' => '權限',
|
||||||
|
|
||||||
|
'role_name' =>'角色名稱',
|
||||||
|
'select_permissions'=>'選擇權限',
|
||||||
|
|
||||||
|
'create' => '新增',
|
||||||
|
'action' => '操作',
|
||||||
|
'view' => '查看',
|
||||||
|
'submit' => '提交',
|
||||||
|
'cancel' => '取消',
|
||||||
|
];
|
28
resources/lang/zh-tw/users.php
Normal file
28
resources/lang/zh-tw/users.php
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
'list' => '使用者列表',
|
||||||
|
'CreateNew' => '新增使用者',
|
||||||
|
'EditUser' => '編輯使用者',
|
||||||
|
'ImportData' => '滙入使用者',
|
||||||
|
'edit' => '編輯',
|
||||||
|
'delete' => '刪除',
|
||||||
|
|
||||||
|
'no' => '編號',
|
||||||
|
'name' => '名稱',
|
||||||
|
'phone' => '手機門號',
|
||||||
|
'gender' => '性別',
|
||||||
|
'birthday' => '生日',
|
||||||
|
'status' => '狀態',
|
||||||
|
'role' =>'角色',
|
||||||
|
|
||||||
|
'select_gender'=>'選擇性別',
|
||||||
|
'select_status'=>'選擇狀態',
|
||||||
|
'select_role'=>'選擇角色',
|
||||||
|
|
||||||
|
'create' => '新增',
|
||||||
|
'action' => '操作',
|
||||||
|
'view' => '查看',
|
||||||
|
'submit' => '提交',
|
||||||
|
'cancel' => '取消',
|
||||||
|
];
|
191
resources/lang/zh-tw/validation.php
Normal file
191
resources/lang/zh-tw/validation.php
Normal file
@ -0,0 +1,191 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Validation Language Lines
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| The following language lines contain the default error messages used by
|
||||||
|
| the validator class. Some of these rules have multiple versions such
|
||||||
|
| as the size rules. Feel free to tweak each of these messages here.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'accepted' => ':attribute 欄位必須被接受。',
|
||||||
|
'accepted_if' => '當 :other 是 :value 時,:attribute 欄位必須被接受。',
|
||||||
|
'active_url' => ':attribute 欄位必須是有效的網址。',
|
||||||
|
'after' => ':attribute 欄位必須是 :date 之後的日期。',
|
||||||
|
'after_or_equal' => ':attribute 欄位必須是日期 :date 或之後。',
|
||||||
|
'alpha' => ':attribute 欄位只能包含字母。',
|
||||||
|
'alpha_dash' => ':attribute 欄位只能包含字母、數字、破折號和底線。',
|
||||||
|
'alpha_num' => ':attribute 欄位只能包含字母和數字。',
|
||||||
|
'array' => ':attribute 欄位必須是陣列。',
|
||||||
|
'ascii' => ':attribute 欄位必須只包含單字節的字母數字字符和符號。',
|
||||||
|
'before' => ':attribute 欄位必須是 :date 之前的日期。',
|
||||||
|
'before_or_equal' => ':attribute 欄位必須是日期 :date 或之前。',
|
||||||
|
'between' => [
|
||||||
|
'array' => ':attribute 欄位必須包含 :min 到 :max 個項目。',
|
||||||
|
'file' => ':attribute 欄位必須在 :min 到 :max KB 之間。',
|
||||||
|
'numeric' => ':attribute 欄位必須在 :min 到 :max 之間。',
|
||||||
|
'string' => ':attribute 欄位必須在 :min 到 :max 個字元之間。',
|
||||||
|
],
|
||||||
|
'boolean' => ':attribute 欄位必須是 true 或 false。',
|
||||||
|
'can' => ':attribute 欄位包含未授權的值。',
|
||||||
|
'confirmed' => ':attribute 欄位確認不匹配。',
|
||||||
|
'current_password' => '密碼不正確。',
|
||||||
|
'date' => ':attribute 欄位必須是有效的日期。',
|
||||||
|
'date_equals' => ':attribute 欄位必須是日期 :date。',
|
||||||
|
'date_format' => ':attribute 欄位必須符合格式 :format。',
|
||||||
|
'decimal' => ':attribute 欄位必須有 :decimal 位小數。',
|
||||||
|
'declined' => ':attribute 欄位必須被拒絕。',
|
||||||
|
'declined_if' => '當 :other 為 :value 時,:attribute 欄位必須被拒絕。',
|
||||||
|
'different' => ':attribute 欄位和 :other 必須不同。',
|
||||||
|
'digits' => ':attribute 欄位必須是 :digits 位數字。',
|
||||||
|
'digits_between' => ':attribute 欄位必須在 :min 到 :max 位數字之間。',
|
||||||
|
'dimensions' => ':attribute 欄位的圖片尺寸無效。',
|
||||||
|
'distinct' => ':attribute 欄位具有重複值。',
|
||||||
|
'doesnt_end_with' => ':attribute 欄位不能以以下任何一個結尾: :values。',
|
||||||
|
'doesnt_start_with' => ':attribute 欄位不能以以下任何一個開頭: :values。',
|
||||||
|
'email' => ':attribute 欄位必須是有效的電子郵件地址。',
|
||||||
|
'ends_with' => ':attribute 欄位必須以以下之一結尾: :values。',
|
||||||
|
'enum' => '選擇的 :attribute 無效。',
|
||||||
|
'exists' => '所選的 :attribute 無效。',
|
||||||
|
'extensions' => ':attribute 欄位必須具有以下擴展名之一: :values。',
|
||||||
|
'file' => ':attribute 欄位必須是文件。',
|
||||||
|
'filled' => ':attribute 欄位必須有值。',
|
||||||
|
'gt' => [
|
||||||
|
'array' => ':attribute 欄位必須包含多於 :value 個項目。',
|
||||||
|
'file' => ':attribute 欄位必須大於 :value KB。',
|
||||||
|
'numeric' => ':attribute 欄位必須大於 :value。',
|
||||||
|
'string' => ':attribute 欄位必須多於 :value 個字符。',
|
||||||
|
],
|
||||||
|
'gte' => [
|
||||||
|
'array' => ':attribute 欄位必須包含 :value 個項目或更多。',
|
||||||
|
'file' => ':attribute 欄位必須大於或等於 :value KB。',
|
||||||
|
'numeric' => ':attribute 欄位必須大於或等於 :value。',
|
||||||
|
'string' => ':attribute 欄位必須大於或等於 :value 個字符。',
|
||||||
|
],
|
||||||
|
'hex_color' => ':attribute 欄位必須是有效的十六進制顏色。',
|
||||||
|
'image' => ':attribute 欄位必須是圖片。',
|
||||||
|
'in' => '所選的 :attribute 無效。',
|
||||||
|
'in_array' => ':attribute 欄位必須存在於 :other 中。',
|
||||||
|
'integer' => ':attribute 欄位必須是整數。',
|
||||||
|
'ip' => ':attribute 欄位必須是有效的 IP 地址。',
|
||||||
|
'ipv4' => ':attribute 欄位必須是有效的 IPv4 地址。',
|
||||||
|
'ipv6' => ':attribute 欄位必須是有效的 IPv6 地址。',
|
||||||
|
'json' => ':attribute 欄位必須是有效的 JSON 字串。',
|
||||||
|
'lowercase' => ':attribute 欄位必須是小寫。',
|
||||||
|
'lt' => [
|
||||||
|
'array' => ':attribute 欄位必須包含少於 :value 個項目。',
|
||||||
|
'file' => ':attribute 欄位必須小於 :value KB。',
|
||||||
|
'numeric' => ':attribute 欄位必須小於 :value。',
|
||||||
|
'string' => ':attribute 欄位必須少於 :value 個字符。',
|
||||||
|
],
|
||||||
|
'lte' => [
|
||||||
|
'array' => ':attribute 欄位不能包含多於 :value 個項目。',
|
||||||
|
'file' => ':attribute 欄位必須小於或等於 :value KB。',
|
||||||
|
'numeric' => ':attribute 欄位必須小於或等於 :value。',
|
||||||
|
'string' => ':attribute 欄位必須小於或等於 :value 個字符。',
|
||||||
|
],
|
||||||
|
'mac_address' => ':attribute 欄位必須是有效的 MAC 地址。',
|
||||||
|
'max' => [
|
||||||
|
'array' => ':attribute 欄位不能超過 :max 個項目。',
|
||||||
|
'file' => ':attribute 欄位不能大於 :max KB。',
|
||||||
|
'numeric' => ':attribute 欄位不能大於 :max。',
|
||||||
|
'string' => ':attribute 欄位不能多於 :max 個字元。',
|
||||||
|
],
|
||||||
|
'max_digits' => ':attribute 欄位不能超過 :max 位數字。',
|
||||||
|
'mimes' => ':attribute 欄位必須是以下類型的文件: :values。',
|
||||||
|
'mimetypes' => ':attribute 欄位必須是以下類型的文件: :values。',
|
||||||
|
'min' => [
|
||||||
|
'array' => ':attribute 欄位至少要有 :min 個項目。',
|
||||||
|
'file' => ':attribute 欄位至少要有 :min KB。',
|
||||||
|
'numeric' => ':attribute 欄位至少要有 :min。',
|
||||||
|
'string' => ':attribute 欄位至少要有 :min 個字元。',
|
||||||
|
],
|
||||||
|
'min_digits' => ':attribute 欄位必須至少有 :min 位數字。',
|
||||||
|
'missing' => ':attribute 欄位必須缺失。',
|
||||||
|
'missing_if' => '當 :other 是 :value 時,:attribute 欄位必須缺失。',
|
||||||
|
'missing_unless' => '除非 :other 是 :value,否則 :attribute 欄位必須缺失。',
|
||||||
|
'missing_with' => '當 :values 存在時,:attribute 欄位必須缺失。',
|
||||||
|
'missing_with_all' => '當 :values 存在時,:attribute 欄位必須缺失。',
|
||||||
|
'multiple_of' => ':attribute 欄位必須是 :value 的倍數。',
|
||||||
|
'not_in' => '所選的 :attribute 無效。',
|
||||||
|
'not_regex' => ':attribute 欄位格式無效。',
|
||||||
|
'numeric' => ':attribute 欄位必須是數字。',
|
||||||
|
'password' => [
|
||||||
|
'letters' => ':attribute 欄位必須包含至少一個字母。',
|
||||||
|
'mixed' => ':attribute 欄位必須包含至少一個大寫字母和一個小寫字母。',
|
||||||
|
'numbers' => ':attribute 欄位必須包含至少一個數字。',
|
||||||
|
'symbols' => ':attribute 欄位必須包含至少一個符號。',
|
||||||
|
'uncompromised' => '給定的 :attribute 已出現在數據洩露中。請選擇一個不同的 :attribute。',
|
||||||
|
],
|
||||||
|
'present' => ':attribute 欄位必須存在。',
|
||||||
|
'present_if' => '當 :other 是 :value 時,:attribute 欄位必須存在。',
|
||||||
|
'present_unless' => '除非 :other 是 :value,否則 :attribute 欄位必須存在。',
|
||||||
|
'present_with' => '當 :values 存在時,:attribute 欄位必須存在。',
|
||||||
|
'present_with_all' => '當 :values 存在時,:attribute 欄位必須存在。',
|
||||||
|
'prohibited' => ':attribute 欄位被禁止。',
|
||||||
|
'prohibited_if' => '當 :other 是 :value 時,:attribute 欄位被禁止。',
|
||||||
|
'prohibited_unless' => '除非 :other 在 :values 中,否則 :attribute 欄位被禁止。',
|
||||||
|
'prohibits' => ':attribute 欄位禁止 :other 存在。',
|
||||||
|
'regex' => ':attribute 欄位格式無效。',
|
||||||
|
'required' => ':attribute 欄位是必填的。',
|
||||||
|
'required_array_keys' => ':attribute 欄位必須包含以下鍵的條目: :values。',
|
||||||
|
'required_if' => '當 :other 是 :value 時,:attribute 欄位是必填的。',
|
||||||
|
'required_if_accepted' => '當 :other 被接受時,:attribute 欄位是必需的。',
|
||||||
|
'required_unless' => '除非 :other 在 :values 中,否則 :attribute 欄位是必填的。',
|
||||||
|
'required_with' => '當 :values 存在時,:attribute 欄位是必填的。',
|
||||||
|
'required_with_all' => '當 :values 存在時,:attribute 欄位是必填的。',
|
||||||
|
'required_without' => '當 :values 不存在時,:attribute 欄位是必填的。',
|
||||||
|
'required_without_all' => '當 :values 都不存在時,:attribute 欄位是必填的。',
|
||||||
|
'same' => ':attribute 欄位必須與 :other 相匹配。',
|
||||||
|
'size' => [
|
||||||
|
'array' => ':attribute 欄位必須包含 :size 個項目。',
|
||||||
|
'file' => ':attribute 欄位必須是 :size KB。',
|
||||||
|
'numeric' => ':attribute 欄位必須是 :size。',
|
||||||
|
'string' => ':attribute 欄位必須是 :size 個字元。',
|
||||||
|
],
|
||||||
|
'starts_with' => ':attribute 欄位必須以以下任何一個開頭: :values。',
|
||||||
|
'string' => ':attribute 欄位必須是字串。',
|
||||||
|
'timezone' => ':attribute 欄位必須是有效的時區。',
|
||||||
|
'unique' => ':attribute 已經被使用。',
|
||||||
|
'uploaded' => ':attribute 上傳失敗。',
|
||||||
|
'uppercase' => ':attribute 欄位必須是大寫。',
|
||||||
|
'url' => ':attribute 欄位必須是有效的網址。',
|
||||||
|
'ulid' => ':attribute 欄位必須是有效的 ULID。',
|
||||||
|
'uuid' => ':attribute 欄位必須是有效的 UUID。',
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Custom Validation Language Lines
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Here you may specify custom validation messages for attributes using the
|
||||||
|
| convention "attribute.rule" to name the lines. This makes it quick to
|
||||||
|
| specify a specific custom language line for a given attribute rule.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'custom' => [
|
||||||
|
'attribute-name' => [
|
||||||
|
'rule-name' => 'custom-message',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Custom Validation Attributes
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| The following language lines are used to swap our attribute placeholder
|
||||||
|
| with something more reader friendly such as "E-Mail Address" instead
|
||||||
|
| of "email". This simply helps us make our message more expressive.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'attributes' => [],
|
||||||
|
|
||||||
|
];
|
10
resources/views/components/action-message.blade.php
Normal file
10
resources/views/components/action-message.blade.php
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
@props(['on'])
|
||||||
|
|
||||||
|
<div x-data="{ shown: false, timeout: null }"
|
||||||
|
x-init="@this.on('{{ $on }}', () => { clearTimeout(timeout); shown = true; timeout = setTimeout(() => { shown = false }, 2000); })"
|
||||||
|
x-show.transition.out.opacity.duration.1500ms="shown"
|
||||||
|
x-transition:leave.opacity.duration.1500ms
|
||||||
|
style="display: none;"
|
||||||
|
{{ $attributes->merge(['class' => 'text-sm text-gray-600']) }}>
|
||||||
|
{{ $slot->isEmpty() ? __('Saved.') : $slot }}
|
||||||
|
</div>
|
13
resources/views/components/admin/section-header.blade.php
Normal file
13
resources/views/components/admin/section-header.blade.php
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<div class="bg-white px-4 py-3 shadow-sm border rounded-md mb-4">
|
||||||
|
<div class="flex items-center justify-between">
|
||||||
|
{{-- 左邊標題 --}}
|
||||||
|
<h2 class="text-lg font-semibold text-gray-800">
|
||||||
|
{{ $title }}
|
||||||
|
</h2>
|
||||||
|
|
||||||
|
{{-- 右邊 slot 注入按鈕群 --}}
|
||||||
|
<div class="flex gap-3">
|
||||||
|
{{ $slot }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
3
resources/views/components/application-logo.blade.php
Normal file
3
resources/views/components/application-logo.blade.php
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
<svg viewBox="0 0 316 316" xmlns="http://www.w3.org/2000/svg" {{ $attributes }}>
|
||||||
|
<path d="M305.8 81.125C305.77 80.995 305.69 80.885 305.65 80.755C305.56 80.525 305.49 80.285 305.37 80.075C305.29 79.935 305.17 79.815 305.07 79.685C304.94 79.515 304.83 79.325 304.68 79.175C304.55 79.045 304.39 78.955 304.25 78.845C304.09 78.715 303.95 78.575 303.77 78.475L251.32 48.275C249.97 47.495 248.31 47.495 246.96 48.275L194.51 78.475C194.33 78.575 194.19 78.725 194.03 78.845C193.89 78.955 193.73 79.045 193.6 79.175C193.45 79.325 193.34 79.515 193.21 79.685C193.11 79.815 192.99 79.935 192.91 80.075C192.79 80.285 192.71 80.525 192.63 80.755C192.58 80.875 192.51 80.995 192.48 81.125C192.38 81.495 192.33 81.875 192.33 82.265V139.625L148.62 164.795V52.575C148.62 52.185 148.57 51.805 148.47 51.435C148.44 51.305 148.36 51.195 148.32 51.065C148.23 50.835 148.16 50.595 148.04 50.385C147.96 50.245 147.84 50.125 147.74 49.995C147.61 49.825 147.5 49.635 147.35 49.485C147.22 49.355 147.06 49.265 146.92 49.155C146.76 49.025 146.62 48.885 146.44 48.785L93.99 18.585C92.64 17.805 90.98 17.805 89.63 18.585L37.18 48.785C37 48.885 36.86 49.035 36.7 49.155C36.56 49.265 36.4 49.355 36.27 49.485C36.12 49.635 36.01 49.825 35.88 49.995C35.78 50.125 35.66 50.245 35.58 50.385C35.46 50.595 35.38 50.835 35.3 51.065C35.25 51.185 35.18 51.305 35.15 51.435C35.05 51.805 35 52.185 35 52.575V232.235C35 233.795 35.84 235.245 37.19 236.025L142.1 296.425C142.33 296.555 142.58 296.635 142.82 296.725C142.93 296.765 143.04 296.835 143.16 296.865C143.53 296.965 143.9 297.015 144.28 297.015C144.66 297.015 145.03 296.965 145.4 296.865C145.5 296.835 145.59 296.775 145.69 296.745C145.95 296.655 146.21 296.565 146.45 296.435L251.36 236.035C252.72 235.255 253.55 233.815 253.55 232.245V174.885L303.81 145.945C305.17 145.165 306 143.725 306 142.155V82.265C305.95 81.875 305.89 81.495 305.8 81.125ZM144.2 227.205L100.57 202.515L146.39 176.135L196.66 147.195L240.33 172.335L208.29 190.625L144.2 227.205ZM244.75 114.995V164.795L226.39 154.225L201.03 139.625V89.825L219.39 100.395L244.75 114.995ZM249.12 57.105L292.81 82.265L249.12 107.425L205.43 82.265L249.12 57.105ZM114.49 184.425L96.13 194.995V85.305L121.49 70.705L139.85 60.135V169.815L114.49 184.425ZM91.76 27.425L135.45 52.585L91.76 77.745L48.07 52.585L91.76 27.425ZM43.67 60.135L62.03 70.705L87.39 85.305V202.545V202.555V202.565C87.39 202.735 87.44 202.895 87.46 203.055C87.49 203.265 87.49 203.485 87.55 203.695V203.705C87.6 203.875 87.69 204.035 87.76 204.195C87.84 204.375 87.89 204.575 87.99 204.745C87.99 204.745 87.99 204.755 88 204.755C88.09 204.905 88.22 205.035 88.33 205.175C88.45 205.335 88.55 205.495 88.69 205.635L88.7 205.645C88.82 205.765 88.98 205.855 89.12 205.965C89.28 206.085 89.42 206.225 89.59 206.325C89.6 206.325 89.6 206.325 89.61 206.335C89.62 206.335 89.62 206.345 89.63 206.345L139.87 234.775V285.065L43.67 229.705V60.135ZM244.75 229.705L148.58 285.075V234.775L219.8 194.115L244.75 179.875V229.705ZM297.2 139.625L253.49 164.795V114.995L278.85 100.395L297.21 89.825V139.625H297.2Z"/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 3.0 KiB |
7
resources/views/components/auth-session-status.blade.php
Normal file
7
resources/views/components/auth-session-status.blade.php
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
@props(['status'])
|
||||||
|
|
||||||
|
@if ($status)
|
||||||
|
<div {{ $attributes->merge(['class' => 'font-medium text-sm text-green-600']) }}>
|
||||||
|
{{ $status }}
|
||||||
|
</div>
|
||||||
|
@endif
|
3
resources/views/components/danger-button.blade.php
Normal file
3
resources/views/components/danger-button.blade.php
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
<button {{ $attributes->merge(['type' => 'submit', 'class' => 'inline-flex items-center px-4 py-2 bg-red-600 border border-transparent rounded-md font-semibold text-xs text-white uppercase tracking-widest hover:bg-red-500 active:bg-red-700 focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2 transition ease-in-out duration-150']) }}>
|
||||||
|
{{ $slot }}
|
||||||
|
</button>
|
1
resources/views/components/dropdown-link.blade.php
Normal file
1
resources/views/components/dropdown-link.blade.php
Normal file
@ -0,0 +1 @@
|
|||||||
|
<a {{ $attributes->merge(['class' => 'block w-full px-4 py-2 text-start text-sm leading-5 text-gray-700 hover:bg-gray-100 focus:outline-none focus:bg-gray-100 transition duration-150 ease-in-out']) }}>{{ $slot }}</a>
|
35
resources/views/components/dropdown.blade.php
Normal file
35
resources/views/components/dropdown.blade.php
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
@props(['align' => 'right', 'width' => '48', 'contentClasses' => 'py-1 bg-white'])
|
||||||
|
|
||||||
|
@php
|
||||||
|
$alignmentClasses = match ($align) {
|
||||||
|
'left' => 'ltr:origin-top-left rtl:origin-top-right start-0',
|
||||||
|
'top' => 'origin-top',
|
||||||
|
default => 'ltr:origin-top-right rtl:origin-top-left end-0',
|
||||||
|
};
|
||||||
|
|
||||||
|
$width = match ($width) {
|
||||||
|
'48' => 'w-48',
|
||||||
|
default => $width,
|
||||||
|
};
|
||||||
|
@endphp
|
||||||
|
|
||||||
|
<div class="relative" x-data="{ open: false }" @click.outside="open = false" @close.stop="open = false">
|
||||||
|
<div @click="open = ! open">
|
||||||
|
{{ $trigger }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div x-show="open"
|
||||||
|
x-transition:enter="transition ease-out duration-200"
|
||||||
|
x-transition:enter-start="opacity-0 scale-95"
|
||||||
|
x-transition:enter-end="opacity-100 scale-100"
|
||||||
|
x-transition:leave="transition ease-in duration-75"
|
||||||
|
x-transition:leave-start="opacity-100 scale-100"
|
||||||
|
x-transition:leave-end="opacity-0 scale-95"
|
||||||
|
class="absolute z-50 mt-2 {{ $width }} rounded-md shadow-lg {{ $alignmentClasses }}"
|
||||||
|
style="display: none;"
|
||||||
|
@click="open = false">
|
||||||
|
<div class="rounded-md ring-1 ring-black ring-opacity-5 {{ $contentClasses }}">
|
||||||
|
{{ $content }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
9
resources/views/components/input-error.blade.php
Normal file
9
resources/views/components/input-error.blade.php
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
@props(['messages'])
|
||||||
|
|
||||||
|
@if ($messages)
|
||||||
|
<ul {{ $attributes->merge(['class' => 'text-sm text-red-600 space-y-1']) }}>
|
||||||
|
@foreach ((array) $messages as $message)
|
||||||
|
<li>{{ $message }}</li>
|
||||||
|
@endforeach
|
||||||
|
</ul>
|
||||||
|
@endif
|
5
resources/views/components/input-label.blade.php
Normal file
5
resources/views/components/input-label.blade.php
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
@props(['value'])
|
||||||
|
|
||||||
|
<label {{ $attributes->merge(['class' => 'block font-medium text-sm text-gray-700']) }}>
|
||||||
|
{{ $value ?? $slot }}
|
||||||
|
</label>
|
48
resources/views/components/layouts/admin.blade.php
Normal file
48
resources/views/components/layouts/admin.blade.php
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||||
|
|
||||||
|
<title>{{ config('app.name', 'Laravel Admin') }}</title>
|
||||||
|
|
||||||
|
<!-- Fonts -->
|
||||||
|
<link rel="preconnect" href="https://fonts.bunny.net">
|
||||||
|
<link href="https://fonts.bunny.net/css?family=figtree:400,500,600&display=swap" rel="stylesheet" />
|
||||||
|
|
||||||
|
<!-- Scripts -->
|
||||||
|
@vite(['resources/css/app.css', 'resources/js/app.js'])
|
||||||
|
@livewireStyles
|
||||||
|
@wireUiScripts
|
||||||
|
</head>
|
||||||
|
<body class="font-sans antialiased">
|
||||||
|
<div class="min-h-screen bg-gray-100 flex">
|
||||||
|
|
||||||
|
{{-- Sidebar --}}
|
||||||
|
<livewire:layout.admin.sidebar />
|
||||||
|
|
||||||
|
<div class="flex-1 flex flex-col">
|
||||||
|
|
||||||
|
{{-- Page Heading --}}
|
||||||
|
@if (isset($header))
|
||||||
|
<header class="bg-white shadow">
|
||||||
|
<div class="max-w-7xl mx-auto py-6 px-4 sm:px-6 lg:px-8">
|
||||||
|
{{ $header }}
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
{{-- Page Content --}}
|
||||||
|
<main>
|
||||||
|
{{ $slot }}
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@livewireScripts
|
||||||
|
@livewire('wire-elements-modal')
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
9
resources/views/components/layouts/app.blade.php
Normal file
9
resources/views/components/layouts/app.blade.php
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
@if(auth()->user()->hasRole('Admin'))
|
||||||
|
<x-layouts.admin>
|
||||||
|
{{ $slot }}
|
||||||
|
</x-layouts.admin>
|
||||||
|
@else
|
||||||
|
<x-layouts.user>
|
||||||
|
{{ $slot }}
|
||||||
|
</x-layouts.user>
|
||||||
|
@endif
|
40
resources/views/components/layouts/user.blade.php
Normal file
40
resources/views/components/layouts/user.blade.php
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||||
|
|
||||||
|
<title>{{ config('app.name', 'Laravel') }}</title>
|
||||||
|
|
||||||
|
<!-- Fonts -->
|
||||||
|
<link rel="preconnect" href="https://fonts.bunny.net">
|
||||||
|
<link href="https://fonts.bunny.net/css?family=figtree:400,500,600&display=swap" rel="stylesheet" />
|
||||||
|
|
||||||
|
<!-- Scripts -->
|
||||||
|
@vite(['resources/css/app.css', 'resources/js/app.js'])
|
||||||
|
@livewireStyles
|
||||||
|
@wireUiScripts
|
||||||
|
</head>
|
||||||
|
<body class="font-sans antialiased">
|
||||||
|
<div class="min-h-screen bg-gray-100">
|
||||||
|
<livewire:layout.app.navigation />
|
||||||
|
|
||||||
|
<!-- Page Heading -->
|
||||||
|
@if (isset($header))
|
||||||
|
<header class="bg-white shadow">
|
||||||
|
<div class="max-w-7xl mx-auto py-6 px-4 sm:px-6 lg:px-8">
|
||||||
|
{{ $header }}
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
<!-- Page Content -->
|
||||||
|
<main>
|
||||||
|
{{ $slot }}
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
@livewireScripts
|
||||||
|
@livewire('wire-elements-modal')
|
||||||
|
</body>
|
||||||
|
</html>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user