第一版建置 20250425
This commit is contained in:
parent
13a5f404e6
commit
382a8b4efb
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
|
66
.env.example
Normal file
66
.env.example
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
APP_NAME=Laravel
|
||||||
|
APP_ENV=local
|
||||||
|
APP_KEY=
|
||||||
|
APP_DEBUG=true
|
||||||
|
APP_TIMEZONE=Asia/Taipei
|
||||||
|
APP_URL=https://KTV.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=mariadb
|
||||||
|
DB_HOST=192.168.22.170
|
||||||
|
DB_PORT=3306
|
||||||
|
DB_DATABASE=Karaoke-Kingpin
|
||||||
|
DB_USERNAME=Karaoke-Kingpin
|
||||||
|
DB_PASSWORD=ESM7yTPMnavFmbBH
|
||||||
|
|
||||||
|
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
|
23
.gitignore
vendored
Normal file
23
.gitignore
vendored
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
/.phpunit.cache
|
||||||
|
/node_modules
|
||||||
|
/public/build
|
||||||
|
/public/hot
|
||||||
|
/public/storage
|
||||||
|
/storage/*.key
|
||||||
|
/storage/pail
|
||||||
|
/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
|
191
app/Helpers/ChineseNameConverter.php
Normal file
191
app/Helpers/ChineseNameConverter.php
Normal file
@ -0,0 +1,191 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Helpers;
|
||||||
|
|
||||||
|
use Overtrue\PHPOpenCC\OpenCC;
|
||||||
|
use Overtrue\Pinyin\Pinyin;
|
||||||
|
|
||||||
|
class ChineseNameConverter
|
||||||
|
{
|
||||||
|
public static array $pinyinToZhuyinMap = [
|
||||||
|
'a' => 'ㄚ' ,'o' => 'ㄛ' ,'e' => 'ㄜ' ,'er' => 'ㄦ','ai' => 'ㄞ' ,'ei' => 'ㄟ' ,'ao' => 'ㄠ' ,'ou' => 'ㄡ' ,'an' => 'ㄢ' ,'en' => 'ㄣ'
|
||||||
|
,'ang' => 'ㄤ' ,'eng' => 'ㄥ' ,'yi' => 'ㄧ' ,'ya' => 'ㄧㄚ' ,'yo' => 'ㄧㄛ' ,'ye' => 'ㄧㄝ' ,'yai' => 'ㄧㄞ' ,'yao' => 'ㄧㄠ'
|
||||||
|
,'you' => 'ㄧㄡ' ,'yan' => 'ㄧㄢ' ,'yin' => 'ㄧㄣ' ,'yang' => 'ㄧㄤ' ,'ying' => 'ㄧㄥ' ,'wu' => 'ㄨ' ,'wa' => 'ㄨㄚ' ,'wo' => 'ㄨㄛ'
|
||||||
|
,'wai' => 'ㄨㄞ' ,'wei' => 'ㄨㄟ' ,'wan' => 'ㄨㄢ' ,'wen' => 'ㄨㄣ' ,'wang' => 'ㄨㄤ' ,'weng' => 'ㄨㄥ' ,'yu' => 'ㄩ' ,'yue' => 'ㄩㄝ'
|
||||||
|
,'yuan' => 'ㄩㄢ' ,'yun' => 'ㄩㄣ', 'yong' =>'ㄩㄥ','ba' => 'ㄅㄚ' ,'bo' => 'ㄅㄛ' ,'bai' => 'ㄅㄞ' ,'bei' => 'ㄅㄟ' ,'bao' => 'ㄅㄠ' ,'ban' => 'ㄅㄢ'
|
||||||
|
,'ben' => 'ㄅㄣ' ,'bang' => 'ㄅㄤ' ,'beng' => 'ㄅㄥ' ,'bi' => 'ㄅㄧ' ,'bie' => 'ㄅㄧㄝ' ,'biao' => 'ㄅㄧㄠ' ,'bian' => 'ㄅㄧㄢ'
|
||||||
|
,'bin' => 'ㄅㄧㄣ' ,'bing' => 'ㄅㄧㄥ' ,'bu' => 'ㄅㄨ' ,'pa' => 'ㄆㄚ' ,'po' => 'ㄆㄛ' ,'pai' => 'ㄆㄞ' ,'pei' => 'ㄆㄟ' ,'pao' => 'ㄆㄠ'
|
||||||
|
,'pou' => 'ㄆㄡ' ,'pan' => 'ㄆㄢ' ,'pen' => 'ㄆㄣ' ,'pang' => 'ㄆㄤ' ,'peng' => 'ㄆㄥ' ,'pi' => 'ㄆㄧ' ,'pie' => 'ㄆㄧㄝ' ,'piao' => 'ㄆㄧㄠ'
|
||||||
|
,'pian' => 'ㄆㄧㄢ' ,'pin' => 'ㄆㄧㄣ' ,'ping' => 'ㄆㄧㄥ' ,'pu' => 'ㄆㄨ' ,'ma' => 'ㄇㄚ' ,'mo' => 'ㄇㄛ' ,'me' => 'ㄇㄜ' ,'mai' => 'ㄇㄞ'
|
||||||
|
,'mei' => 'ㄇㄟ' ,'mao' => 'ㄇㄠ' ,'mou' => 'ㄇㄡ' ,'man' => 'ㄇㄢ' ,'men' => 'ㄇㄣ' ,'mang' => 'ㄇㄤ' ,'meng' => 'ㄇㄥ' ,'mi' => 'ㄇㄧ'
|
||||||
|
,'mie' => 'ㄇㄧㄝ' ,'miao' => 'ㄇㄧㄠ' ,'mian' => 'ㄇㄧㄢ' ,'min' => 'ㄇㄧㄣ' ,'ming' => 'ㄇㄧㄥ' ,'mu' => 'ㄇㄨ' ,'fa' => 'ㄈㄚ'
|
||||||
|
,'fo' => 'ㄈㄛ' ,'fei' => 'ㄈㄟ' ,'fou' => 'ㄈㄡ' ,'fan' => 'ㄈㄢ' ,'fen' => 'ㄈㄣ' ,'fang' => 'ㄈㄤ' ,'feng' => 'ㄈㄥ' ,'fu' => 'ㄈㄨ'
|
||||||
|
,'da' => 'ㄉㄚ' ,'de' => 'ㄉㄜ' ,'dai' => 'ㄉㄞ' ,'dei' => 'ㄉㄟ' ,'dao' => 'ㄉㄠ' ,'dou' => 'ㄉㄡ' ,'dan' => 'ㄉㄢ' ,'den' => 'ㄉㄣ'
|
||||||
|
,'dang' => 'ㄉㄤ' ,'deng' => 'ㄉㄥ' ,'di' => 'ㄉㄧ' ,'die' => 'ㄉㄧㄝ' ,'diao' => 'ㄉㄧㄠ' ,'diu' => 'ㄉㄧㄡ' ,'dian' => 'ㄉㄧㄢ'
|
||||||
|
,'ding' => 'ㄉㄧㄥ' ,'du' => 'ㄉㄨ' ,'duo' => 'ㄉㄨㄛ' ,'dui' => 'ㄉㄨㄟ' ,'duan' => 'ㄉㄨㄢ' ,'dun' => 'ㄉㄨㄣ' ,'dong' => 'ㄉㄨㄥ'
|
||||||
|
,'ta' => 'ㄊㄚ' ,'te' => 'ㄊㄜ' ,'tai' => 'ㄊㄞ' ,'tao' => 'ㄊㄠ' ,'tou' => 'ㄊㄡ' ,'tan' => 'ㄊㄢ' ,'tang' => 'ㄊㄤ' ,'teng' => 'ㄊㄥ'
|
||||||
|
,'ti' => 'ㄊㄧ' ,'tie' => 'ㄊㄧㄝ' ,'tiao' => 'ㄊㄧㄠ' ,'tian' => 'ㄊㄧㄢ' ,'ting' => 'ㄊㄧㄥ' ,'tu' => 'ㄊㄨ' ,'tuo' => 'ㄊㄨㄛ'
|
||||||
|
,'tui' => 'ㄊㄨㄟ' ,'tuan' => 'ㄊㄨㄢ' ,'tun' => 'ㄊㄨㄣ' ,'tong' => 'ㄊㄨㄥ' ,'na' => 'ㄋㄚ' ,'ne' => 'ㄋㄜ' ,'nai' => 'ㄋㄞ'
|
||||||
|
,'nei' => 'ㄋㄟ' ,'nao' => 'ㄋㄠ' ,'nou' => 'ㄋㄡ' ,'nan' => 'ㄋㄢ' ,'nen' => 'ㄋㄣ' ,'nang' => 'ㄋㄤ' ,'neng' => 'ㄋㄥ' ,'ni' => 'ㄋㄧ'
|
||||||
|
,'nie' => 'ㄋㄧㄝ' ,'niao' => 'ㄋㄧㄠ' ,'niu' => 'ㄋㄧㄡ' ,'nian' => 'ㄋㄧㄢ' ,'nin' => 'ㄋㄧㄣ' ,'niang' => 'ㄋㄧㄤ' ,'ning' => 'ㄋㄧㄥ'
|
||||||
|
,'nu' => 'ㄋㄨ' ,'nuo' => 'ㄋㄨㄛ' ,'nuan' => 'ㄋㄨㄢ' ,'nun' => 'ㄋㄨㄣ' ,'nong' => 'ㄋㄨㄥ' ,'nv' => 'ㄋㄩ' ,'nue' => 'ㄋㄩㄝ' ,'la' => 'ㄌㄚ'
|
||||||
|
,'le' => 'ㄌㄜ' ,'lai' => 'ㄌㄞ' ,'lei' => 'ㄌㄟ' ,'lao' => 'ㄌㄠ' ,'lou' => 'ㄌㄡ' ,'lan' => 'ㄌㄢ' ,'lang' => 'ㄌㄤ' ,'leng' => 'ㄌㄥ'
|
||||||
|
,'li' => 'ㄌㄧ' ,'lia' => 'ㄌㄧㄚ' ,'lie' => 'ㄌㄧㄝ' ,'liao' => 'ㄌㄧㄠ' ,'liu' => 'ㄌㄧㄡ' ,'lian' => 'ㄌㄧㄢ' ,'lin' => 'ㄌㄧㄣ'
|
||||||
|
,'liang' => 'ㄌㄧㄤ' ,'ling' => 'ㄌㄧㄥ' ,'lu' => 'ㄌㄨ' ,'luo' => 'ㄌㄨㄛ' ,'luan' => 'ㄌㄨㄢ' ,'lun' => 'ㄌㄨㄣ' ,'long' => 'ㄌㄨㄥ'
|
||||||
|
,'lv' => 'ㄌㄩ' ,'lve' => 'ㄌㄩㄝ' ,'ga' => 'ㄍㄚ' ,'ge' => 'ㄍㄜ' ,'gai' => 'ㄍㄞ' ,'gei' => 'ㄍㄟ' ,'gao' => 'ㄍㄠ' ,'gou' => 'ㄍㄡ'
|
||||||
|
,'gan' => 'ㄍㄢ' ,'gen' => 'ㄍㄣ' ,'gang' => 'ㄍㄤ' ,'geng' => 'ㄍㄥ' ,'gu' => 'ㄍㄨ' ,'gua' => 'ㄍㄨㄚ' ,'guo' => 'ㄍㄨㄛ' ,'guai' => 'ㄍㄨㄞ'
|
||||||
|
,'gui' => 'ㄍㄨㄟ' ,'guan' => 'ㄍㄨㄢ' ,'gun' => 'ㄍㄨㄣ' ,'guang' => 'ㄍㄨㄤ' ,'gong' => 'ㄍㄨㄥ' ,'ka' => 'ㄎㄚ' ,'ke' => 'ㄎㄜ'
|
||||||
|
,'kai' => 'ㄎㄞ' ,'kei' => 'ㄎㄟ' ,'kao' => 'ㄎㄠ' ,'kou' => 'ㄎㄡ' ,'kan' => 'ㄎㄢ' ,'ken' => 'ㄎㄣ' ,'kang' => 'ㄎㄤ' ,'keng' => 'ㄎㄥ'
|
||||||
|
,'ku' => 'ㄎㄨ' ,'kua' => 'ㄎㄨㄚ' ,'kuo' => 'ㄎㄨㄛ' ,'kuai' => 'ㄎㄨㄞ' ,'kui' => 'ㄎㄨㄟ' ,'kuan' => 'ㄎㄨㄢ' ,'kun' => 'ㄎㄨㄣ'
|
||||||
|
,'kuang' => 'ㄎㄨㄤ' ,'kong' => 'ㄎㄨㄥ' ,'ha' => 'ㄏㄚ' ,'he' => 'ㄏㄜ' ,'hai' => 'ㄏㄞ' ,'hei' => 'ㄏㄟ' ,'hao' => 'ㄏㄠ' ,'hou' => 'ㄏㄡ'
|
||||||
|
,'han' => 'ㄏㄢ' ,'hen' => 'ㄏㄣ' ,'hang' => 'ㄏㄤ' ,'heng' => 'ㄏㄥ' ,'hu' => 'ㄏㄨ' ,'hua' => 'ㄏㄨㄚ' ,'huo' => 'ㄏㄨㄛ' ,'huai' => 'ㄏㄨㄞ'
|
||||||
|
,'hui' => 'ㄏㄨㄟ' ,'huan' => 'ㄏㄨㄢ' ,'hun' => 'ㄏㄨㄣ' ,'huang' => 'ㄏㄨㄤ' ,'hong' => 'ㄏㄨㄥ' ,'ji' => 'ㄐ一' ,'jia' => 'ㄐㄧㄚ'
|
||||||
|
,'jie' => 'ㄐㄧㄝ' ,'jiao' => 'ㄐㄧㄠ' ,'jiu' => 'ㄐ一ㄡ' ,'jian' => 'ㄐ一ㄢ' ,'jin' => 'ㄐ一ㄣ' ,'jiang' => 'ㄐ一ㄤ' ,'jing' => 'ㄐ一ㄥ'
|
||||||
|
,'ju' => 'ㄐㄩ' ,'jue' => 'ㄐㄩㄝ' ,'juan' => 'ㄐㄩㄢ' ,'jun' => 'ㄐㄩㄣ' ,'jiong' => 'ㄐㄩㄥ' ,'qi' => 'ㄑ一' ,'qia' => 'ㄑㄧㄚ'
|
||||||
|
,'qie' => 'ㄑㄧㄝ' ,'qiao' => 'ㄑㄧㄠ' ,'qiu' => 'ㄑ一ㄡ' ,'qian' => 'ㄑ一ㄢ' ,'qin' => 'ㄑ一ㄣ' ,'qiang' => 'ㄑ一ㄤ' ,'qing' => 'ㄑ一ㄥ'
|
||||||
|
,'qu' => 'ㄑㄩ' ,'que' => 'ㄑㄩㄝ' ,'quan' => 'ㄑㄩㄢ' ,'qun' => 'ㄑㄩㄣ' ,'qiong' => 'ㄑㄩㄥ' ,'xi' => 'ㄒ一' ,'xia' => 'ㄒㄧㄚ'
|
||||||
|
,'xie' => 'ㄒㄧㄝ' ,'xiao' => 'ㄒㄧㄠ' ,'xiu' => 'ㄒ一ㄡ' ,'xian' => 'ㄒ一ㄢ' ,'xin' => 'ㄒ一ㄣ' ,'xiang' => 'ㄒ一ㄤ' ,'xing' => 'ㄒ一ㄥ'
|
||||||
|
,'xu' => 'ㄒㄩ' ,'xue' => 'ㄒㄩㄝ' ,'xuan' => 'ㄒㄩㄢ' ,'xun' => 'ㄒㄩㄣ' ,'xiong' => 'ㄒㄩㄥ' ,'zha' => 'ㄓㄚ' ,'zhe' => 'ㄓㄜ'
|
||||||
|
,'zhai' => 'ㄓㄞ' ,'zhei' => 'ㄓㄟ' ,'zhao' => 'ㄓㄠ' ,'zhou' => 'ㄓㄡ' ,'zhan' => 'ㄓㄢ' ,'zhen' => 'ㄓㄣ' ,'zhang' => 'ㄓㄤ'
|
||||||
|
,'zheng' => 'ㄓㄥ' ,'zhu' => 'ㄓㄨ' ,'zhua' => 'ㄓㄨㄚ' ,'zhuo' => 'ㄓㄨㄛ' ,'zhuai' => 'ㄓㄨㄞ' ,'zhui' => 'ㄓㄨㄟ' ,'zhuan' => 'ㄓㄨㄢ'
|
||||||
|
,'zhun' => 'ㄓㄨㄣ' ,'zhuang' => 'ㄓㄨㄤ' ,'zhong' => 'ㄓㄨㄥ' ,'cha' => 'ㄔㄚ' ,'che' => 'ㄔㄜ' ,'chai' => 'ㄔㄞ' ,'chao' => 'ㄔㄠ'
|
||||||
|
,'chou' => 'ㄔㄡ' ,'chan' => 'ㄔㄢ' ,'chen' => 'ㄔㄣ' ,'chang' => 'ㄔㄤ' ,'cheng' => 'ㄔㄥ' ,'chu' => 'ㄔㄨ' ,'chua' => 'ㄔㄨㄚ'
|
||||||
|
,'chuo' => 'ㄔㄨㄛ' ,'chuai' => 'ㄔㄨㄞ' ,'chui' => 'ㄔㄨㄟ' ,'chuan' => 'ㄔㄨㄢ' ,'chun' => 'ㄔㄨㄣ' ,'chuang' => 'ㄔㄨㄤ' ,'chong' => 'ㄔㄨㄥ'
|
||||||
|
,'sha' => 'ㄕㄚ' ,'she' => 'ㄕㄜ' ,'shai' => 'ㄕㄞ' ,'shao' => 'ㄕㄠ' ,'shou' => 'ㄕㄡ' ,'shan' => 'ㄕㄢ' ,'shen' => 'ㄕㄣ' ,'shang' => 'ㄕㄤ'
|
||||||
|
,'sheng' => 'ㄕㄥ' ,'shu' => 'ㄕㄨ' ,'shua' => 'ㄕㄨㄚ' ,'shuo' => 'ㄕㄨㄛ' ,'shuai' => 'ㄕㄨㄞ' ,'shui' => 'ㄕㄨㄟ' ,'shuan' => 'ㄕㄨㄢ'
|
||||||
|
,'shun' => 'ㄕㄨㄣ' ,'shuang' => 'ㄕㄨㄤ' ,'shong' => 'ㄕㄨㄥ' ,'re' => 'ㄖㄜ' ,'rai' => 'ㄖㄞ' ,'rao' => 'ㄖㄠ' ,'rou' => 'ㄖㄡ' ,'ran' => 'ㄖㄢ'
|
||||||
|
,'ren' => 'ㄖㄣ' ,'rang' => 'ㄖㄤ' ,'reng' => 'ㄖㄥ' ,'ru' => 'ㄖㄨ' ,'ruo' => 'ㄖㄨㄛ' ,'rui' => 'ㄖㄨㄟ' ,'ruan' => 'ㄖㄨㄢ' ,'run' => 'ㄖㄨㄣ'
|
||||||
|
,'rong' => 'ㄖㄨㄥ' ,'za' => 'ㄗㄚ' ,'ze' => 'ㄗㄜ' ,'zai' => 'ㄗㄞ' ,'zei' => 'ㄗㄟ' ,'zao' => 'ㄗㄠ' ,'zou' => 'ㄗㄡ' ,'zan' => 'ㄗㄢ'
|
||||||
|
,'zen' => 'ㄗㄣ' ,'zang' => 'ㄗㄤ' ,'zeng' => 'ㄗㄥ' ,'zu' => 'ㄗㄨ' ,'zuo' => 'ㄗㄨㄛ' ,'zuan' => 'ㄗㄨㄢ' ,'zun' => 'ㄗㄨㄣ' ,'zong' => 'ㄗㄨㄥ'
|
||||||
|
,'zui' => 'ㄗㄨㄟ' ,'ca' => 'ㄘㄚ' ,'ce' => 'ㄘㄜ' ,'cai' => 'ㄘㄞ' ,'cao' => 'ㄘㄠ' ,'cou' => 'ㄘㄡ' ,'can' => 'ㄘㄢ' ,'cen' => 'ㄘㄣ' ,'cang' => 'ㄘㄤ'
|
||||||
|
,'ceng' => 'ㄘㄥ' ,'cu' => 'ㄘㄨ' ,'cuo' => 'ㄘㄨㄛ' ,'cuan' => 'ㄘㄨㄢ' ,'cun' => 'ㄘㄨㄣ' ,'cong' => 'ㄘㄨㄥ' ,'cui' => 'ㄘㄨㄟ' ,'sa' => 'ㄙㄚ'
|
||||||
|
,'se' => 'ㄙㄜ' ,'sai' => 'ㄙㄞ' ,'sao' => 'ㄙㄠ' ,'sou' => 'ㄙㄡ' ,'san' => 'ㄙㄢ' ,'sen' => 'ㄙㄣ' ,'sang' => 'ㄙㄤ' ,'seng' => 'ㄙㄥ' ,'su' => 'ㄙㄨ'
|
||||||
|
,'suo' => 'ㄙㄨㄛ' ,'suan' => 'ㄙㄨㄢ' ,'sun' => 'ㄙㄨㄣ' ,'song' => 'ㄙㄨㄥ' ,'sui' => 'ㄙㄨㄟ' ,'zi' => 'ㄗ' ,'ci' => 'ㄘ' ,'si' => 'ㄙ'
|
||||||
|
,'zhi' => 'ㄓ' ,'chi' => 'ㄔ' ,'shi' => 'ㄕ' ,'ri' => 'ㄖ'
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove tone marks from Pinyin
|
||||||
|
*
|
||||||
|
* @param string $pinyin
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public static function normalizePinyin(string $pinyin): string {
|
||||||
|
$map = [
|
||||||
|
'ā'=>'a', 'á'=>'a', 'ǎ'=>'a', 'à'=>'a',
|
||||||
|
'ē'=>'e', 'é'=>'e', 'ě'=>'e', 'è'=>'e',
|
||||||
|
'ī'=>'i', 'í'=>'i', 'ǐ'=>'i', 'ì'=>'i',
|
||||||
|
'ō'=>'o', 'ó'=>'o', 'ǒ'=>'o', 'ò'=>'o',
|
||||||
|
'ū'=>'u', 'ú'=>'u', 'ǔ'=>'u', 'ù'=>'u',
|
||||||
|
//'ǖ'=>'ü','ǘ'=>'ü','ǚ'=>'ü','ǜ'=>'ü',
|
||||||
|
'ǖ'=>'u','ǘ'=>'u','ǚ'=>'u','ǜ'=>'u',
|
||||||
|
|
||||||
|
];
|
||||||
|
return strtr($pinyin, $map);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert Traditional Chinese characters to Simplified Chinese characters
|
||||||
|
*
|
||||||
|
* @param string $traditional
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public static function convertToSimplified(string $traditional): string
|
||||||
|
{
|
||||||
|
return OpenCC::convert($traditional, 'TW2S');
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Convert Chinese characters to Pinyin initials
|
||||||
|
*
|
||||||
|
* @param string $text
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public static function getPinyinAbbr(string $text): string
|
||||||
|
{
|
||||||
|
return strtoupper(Pinyin::abbr($text)->join(''));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Convert Chinese characters to full Pinyin
|
||||||
|
*
|
||||||
|
* @param string $text
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public static function getPinyinSentence(string $text): string
|
||||||
|
{
|
||||||
|
return Pinyin::sentence($text);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getZhuyinAbbr(string $text): string
|
||||||
|
{
|
||||||
|
|
||||||
|
$segments = explode(' ', self::convertPinyinToZhuyin($text));
|
||||||
|
$zhuyinAbbr = '';
|
||||||
|
foreach ($segments as $z) {
|
||||||
|
$firstChar = mb_substr($z, 0, 1, 'UTF-8');
|
||||||
|
$zhuyinAbbr .= self::isZhuyin($firstChar) ? $firstChar : strtoupper($z);
|
||||||
|
}
|
||||||
|
return $zhuyinAbbr;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert Pinyin to Zhuyin
|
||||||
|
*
|
||||||
|
* @param string $pinyin
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public static function convertPinyinToZhuyin(string $pinyin): string
|
||||||
|
{
|
||||||
|
$zhuyin = [];
|
||||||
|
$words = explode(' ', $pinyin);
|
||||||
|
|
||||||
|
foreach ($words as $word) {
|
||||||
|
$key = self::normalizePinyin(strtolower($word));
|
||||||
|
$zhuyin[] = self::$pinyinToZhuyinMap[$key] ?? $word;
|
||||||
|
}
|
||||||
|
return implode(' ', $zhuyin);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function isZhuyin(string $char): bool
|
||||||
|
{
|
||||||
|
if (empty($char)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
$code = mb_ord($char, 'UTF-8');
|
||||||
|
return $code >= 0x3105 && $code <= 0x3129;
|
||||||
|
}
|
||||||
|
public static function getKTVPinyinAbbr(string $text): string
|
||||||
|
{
|
||||||
|
$pinyin = '';
|
||||||
|
$chars = mb_str_split($text);
|
||||||
|
foreach ($chars as $char) {
|
||||||
|
if (preg_match("/\p{Han}/u", $char)) {
|
||||||
|
$pinyin .= self::getPinyinAbbr($char);
|
||||||
|
} else {
|
||||||
|
$pinyin .= $char;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $pinyin;
|
||||||
|
}
|
||||||
|
public static function getKTVZhuyinAbbr(string $text): string
|
||||||
|
{
|
||||||
|
$zhuyin = '';
|
||||||
|
$chars = mb_str_split($text);
|
||||||
|
foreach ($chars as $char) {
|
||||||
|
if (preg_match("/\p{Han}/u", $char)) {
|
||||||
|
$zhuyin .= self::getZhuyinAbbr(Pinyin::sentence($char));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $zhuyin;
|
||||||
|
}
|
||||||
|
public static function convertAll(string $text): array
|
||||||
|
{
|
||||||
|
$simplified =self::convertToSimplified($text);
|
||||||
|
$pinyin = self::getPinyinSentence($simplified);
|
||||||
|
return [
|
||||||
|
'simplified' => $simplified,
|
||||||
|
'pinyin_abbr' => self::getKTVPinyinAbbr($simplified),
|
||||||
|
'pinyin_full' => $pinyin,
|
||||||
|
'zhuyin' => self::getKTVZhuyinAbbr($simplified),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
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');
|
||||||
|
}
|
||||||
|
}
|
8
app/Http/Controllers/Controller.php
Normal file
8
app/Http/Controllers/Controller.php
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
abstract class Controller
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
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();
|
||||||
|
}
|
||||||
|
}
|
13
app/Livewire/Admin/ArtistForm.php
Normal file
13
app/Livewire/Admin/ArtistForm.php
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Livewire\Admin;
|
||||||
|
|
||||||
|
use Livewire\Component;
|
||||||
|
|
||||||
|
class ArtistForm extends Component
|
||||||
|
{
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
return view('livewire.admin.artist-form');
|
||||||
|
}
|
||||||
|
}
|
155
app/Livewire/Admin/ArtistTable.php
Normal file
155
app/Livewire/Admin/ArtistTable.php
Normal file
@ -0,0 +1,155 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Livewire\Admin;
|
||||||
|
|
||||||
|
use App\Models\Artist;
|
||||||
|
use Illuminate\Support\Carbon;
|
||||||
|
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;
|
||||||
|
|
||||||
|
final class ArtistTable extends PowerGridComponent
|
||||||
|
{
|
||||||
|
public string $tableName = 'artist-table';
|
||||||
|
|
||||||
|
public bool $showFilters = false;
|
||||||
|
|
||||||
|
public function boot(): void
|
||||||
|
{
|
||||||
|
config(['livewire-powergrid.filter' => 'outside']);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setUp(): array
|
||||||
|
{
|
||||||
|
$this->showCheckBox();
|
||||||
|
|
||||||
|
return [
|
||||||
|
PowerGrid::exportable(fileName: 'artist-file')
|
||||||
|
->type(Exportable::TYPE_XLS, Exportable::TYPE_CSV),
|
||||||
|
PowerGrid::header()
|
||||||
|
->showSoftDeletes()
|
||||||
|
->showToggleColumns()
|
||||||
|
->showSearchInput(),
|
||||||
|
PowerGrid::footer()
|
||||||
|
->showPerPage()
|
||||||
|
->showRecordCount(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
public function header(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
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, []),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function datasource(): Builder
|
||||||
|
{
|
||||||
|
return Artist::query();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function relationSearch(): array
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function fields(): PowerGridFields
|
||||||
|
{
|
||||||
|
return PowerGrid::fields()
|
||||||
|
->add('id')
|
||||||
|
->add('category_id')
|
||||||
|
->add('name')
|
||||||
|
->add('simplified')
|
||||||
|
->add('phonetic_abbr')
|
||||||
|
->add('pinyin_abbr')
|
||||||
|
->add('created_at_formatted', fn (Artist $model) => Carbon::parse($model->created_at)->format('d/m/Y H:i:s'));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function columns(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Column::make(__('artists.no'), 'id'),
|
||||||
|
Column::make(__('artists.category'), 'category_id'),
|
||||||
|
Column::make(__('artists.name'), 'name')
|
||||||
|
->sortable()
|
||||||
|
->searchable(),
|
||||||
|
|
||||||
|
Column::make(__('artists.name.simplified'), 'simplified')
|
||||||
|
->sortable()
|
||||||
|
->searchable(),
|
||||||
|
|
||||||
|
Column::make(__('artists.name.phinetic'), 'phonetic_abbr')
|
||||||
|
->sortable()
|
||||||
|
->searchable(),
|
||||||
|
|
||||||
|
Column::make(__('artists.name.pinyin'), 'pinyin_abbr')
|
||||||
|
->sortable()
|
||||||
|
->searchable(),
|
||||||
|
|
||||||
|
Column::make('Created at', 'created_at_formatted', 'created_at')
|
||||||
|
->sortable(),
|
||||||
|
|
||||||
|
Column::action(__('artists.actions'))
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function filters(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Filter::inputText('name')->placeholder(__('artists.name')),
|
||||||
|
Filter::inputText('phonetic_abbr')->placeholder(__('artists.name.phinetic')),
|
||||||
|
Filter::inputText('pinyin_abbr')->placeholder(__('artists.name.pinyin')),
|
||||||
|
Filter::datetimepicker('created_at'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
#[On('bulkDelete.{tableName}')]
|
||||||
|
public function bulkDelete(): void
|
||||||
|
{
|
||||||
|
$this->js('alert(window.pgBulkActions.get(\'' . $this->tableName . '\'))');
|
||||||
|
if($this->checkboxValues){
|
||||||
|
Artist::destroy($this->checkboxValues);
|
||||||
|
$this->js('window.pgBulkActions.clearAll()'); // clear the count on the interface.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function actions(Artist $row): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
|
||||||
|
Button::add('edit')
|
||||||
|
->slot(__('artists.edit'))
|
||||||
|
->icon('solid-pencil-square')
|
||||||
|
->class('inline-flex items-center gap-1 px-3 py-1 rounded ')
|
||||||
|
->dispatchTo('admin.artist-form', 'openEditArtistModal', ['id' => $row->id]),
|
||||||
|
Button::add('delete')
|
||||||
|
->slot(__('artists.delete'))
|
||||||
|
->icon('solid-trash')
|
||||||
|
->class('inline-flex items-center gap-1 px-3 py-1 rounded ')
|
||||||
|
->dispatchTo('admin.artist-form', 'deleteArtist', ['id' => $row->id]),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
public function actionRules($row): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
// Hide button edit for ID 1
|
||||||
|
Rule::button('edit')
|
||||||
|
->when(fn($row) => $row->id === 1)
|
||||||
|
->hide(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
}
|
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'));
|
||||||
|
}
|
||||||
|
}
|
81
app/Livewire/Admin/RoleForm.php
Normal file
81
app/Livewire/Admin/RoleForm.php
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Livewire\Admin;
|
||||||
|
|
||||||
|
use Livewire\Component;
|
||||||
|
|
||||||
|
use Spatie\Permission\Models\Role;
|
||||||
|
use Spatie\Permission\Models\Permission;
|
||||||
|
|
||||||
|
class RoleForm extends Component
|
||||||
|
{
|
||||||
|
protected $listeners = ['openCreateRoleModal','openEditRoleModal', 'deleteRole'];
|
||||||
|
|
||||||
|
public $showCreateModal=false;
|
||||||
|
public ?int $roleId = null;
|
||||||
|
public $name = '';
|
||||||
|
public $permissions = []; // 所有權限清單
|
||||||
|
public $selectedPermissions = []; // 表單中選到的權限
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public function mount()
|
||||||
|
{
|
||||||
|
$this->permissions = Permission::all();
|
||||||
|
}
|
||||||
|
|
||||||
|
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) {
|
||||||
|
$role = Role::findOrFail($this->roleId);
|
||||||
|
$role->update(['name' => $this->name]);
|
||||||
|
$role->syncPermissions($this->selectedPermissions);
|
||||||
|
session()->flash('message', '角色已更新');
|
||||||
|
} else {
|
||||||
|
$role = Role::create(['name' => $this->name]);
|
||||||
|
$role->syncPermissions($this->selectedPermissions);
|
||||||
|
session()->flash('message', '角色已新增');
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->resetFields();
|
||||||
|
$this->showCreateModal = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function deleteRole($id)
|
||||||
|
{
|
||||||
|
Role::findOrFail($id)->delete();
|
||||||
|
session()->flash('message', '角色已刪除');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function resetFields()
|
||||||
|
{
|
||||||
|
$this->name = '';
|
||||||
|
$this->selectedPermissions = [];
|
||||||
|
$this->roleId = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
return view('livewire.admin.role-form');
|
||||||
|
}
|
||||||
|
}
|
104
app/Livewire/Admin/RoleTable.php
Normal file
104
app/Livewire/Admin/RoleTable.php
Normal file
@ -0,0 +1,104 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Livewire\Admin;
|
||||||
|
|
||||||
|
use Spatie\Permission\Models\Role;
|
||||||
|
use Illuminate\Support\Carbon;
|
||||||
|
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;
|
||||||
|
|
||||||
|
final class RoleTable extends PowerGridComponent
|
||||||
|
{
|
||||||
|
public string $tableName = 'role-table';
|
||||||
|
|
||||||
|
public function boot(): void
|
||||||
|
{
|
||||||
|
config(['livewire-powergrid.filter' => 'outside']);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setUp(): array
|
||||||
|
{
|
||||||
|
//$this->showCheckBox();
|
||||||
|
|
||||||
|
return [
|
||||||
|
//PowerGrid::header()
|
||||||
|
// ->showSearchInput(),
|
||||||
|
//PowerGrid::footer()
|
||||||
|
// ->showPerPage()
|
||||||
|
// ->showRecordCount(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function datasource(): Builder
|
||||||
|
{
|
||||||
|
//dd(Role::with('permissions'));
|
||||||
|
return Role::with('permissions');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function relationSearch(): array
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function fields(): PowerGridFields
|
||||||
|
{
|
||||||
|
return PowerGrid::fields()
|
||||||
|
->add('id')
|
||||||
|
->add('name')
|
||||||
|
->add('created_at_formatted', fn (Role $model) => Carbon::parse($model->created_at)->format('d/m/Y H:i:s'));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function columns(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Column::make('ID', 'id')->sortable()->searchable(),
|
||||||
|
Column::make('名稱', 'name')->sortable()->searchable(),
|
||||||
|
//Column::make('權限', 'permissions_list', function ($role) {
|
||||||
|
// return $role->permissions->pluck('name')->implode(', ');
|
||||||
|
//}),
|
||||||
|
Column::make('Created at', 'created_at_formatted', 'created_at')->sortable(),
|
||||||
|
Column::action('Action')
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function filters(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Filter::datetimepicker('created_at'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function actions(Role $row): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Button::add('edit')
|
||||||
|
->slot('編輯')
|
||||||
|
->icon('solid-pencil-square')
|
||||||
|
->class('inline-flex items-center gap-1 px-3 py-1 rounded ')
|
||||||
|
->dispatchTo('admin.role-form', 'openEditRoleModal', ['id' => $row->id]),
|
||||||
|
Button::add('delete')
|
||||||
|
->slot('刪除')
|
||||||
|
->icon('solid-trash')
|
||||||
|
->class('inline-flex items-center gap-1 px-3 py-1 rounded ')
|
||||||
|
->dispatchTo('admin.role-form', 'deleteRole', ['id' => $row->id]),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
public function actionRules($row): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
// Hide button edit for ID 1
|
||||||
|
Rule::button('edit')
|
||||||
|
->when(fn($row) => $row->id === 1)
|
||||||
|
->hide(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
}
|
104
app/Livewire/Admin/Roles.php
Normal file
104
app/Livewire/Admin/Roles.php
Normal file
@ -0,0 +1,104 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Livewire\Admin;
|
||||||
|
|
||||||
|
use Livewire\Component;
|
||||||
|
use Livewire\WithPagination;
|
||||||
|
use Spatie\Permission\Models\Role;
|
||||||
|
use Spatie\Permission\Models\Permission;
|
||||||
|
|
||||||
|
class Roles extends Component
|
||||||
|
{
|
||||||
|
use WithPagination;
|
||||||
|
|
||||||
|
public $users ;
|
||||||
|
public $search = '';
|
||||||
|
public $name = '';
|
||||||
|
public bool $showCreateModal = false;
|
||||||
|
public ?int $editingRoleId = null;
|
||||||
|
public string $sortField = 'id';
|
||||||
|
public string $sortDirection = 'asc';
|
||||||
|
public $permissions = []; // 所有權限清單
|
||||||
|
public $selectedPermissions = []; // 表單中選到的權限
|
||||||
|
|
||||||
|
protected $rules = [
|
||||||
|
'name' => 'required|string|max:255',
|
||||||
|
];
|
||||||
|
|
||||||
|
protected $paginationTheme = 'tailwind';
|
||||||
|
|
||||||
|
public function getRolesProperty()
|
||||||
|
{
|
||||||
|
return Role::where('name', 'like', "%{$this->search}%")
|
||||||
|
->orderBy($this->sortField, $this->sortDirection)
|
||||||
|
->paginate(10);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function sortBy($field)
|
||||||
|
{
|
||||||
|
if ($this->sortField === $field) {
|
||||||
|
$this->sortDirection = $this->sortDirection === 'asc' ? 'desc' : 'asc';
|
||||||
|
} else {
|
||||||
|
$this->sortField = $field;
|
||||||
|
$this->sortDirection = 'asc';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public function mount()
|
||||||
|
{
|
||||||
|
$this->permissions = Permission::all();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function openCreateModal()
|
||||||
|
{
|
||||||
|
$this->resetFields();
|
||||||
|
$this->showCreateModal = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function openEditModal($id)
|
||||||
|
{
|
||||||
|
$role = Role::findOrFail($id);
|
||||||
|
$this->editingRoleId = $role->id;
|
||||||
|
$this->name = $role->name;
|
||||||
|
$this->selectedPermissions = $role->permissions()->pluck('id')->toArray();
|
||||||
|
$this->showCreateModal = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function save()
|
||||||
|
{
|
||||||
|
$this->validate();
|
||||||
|
|
||||||
|
if ($this->editingRoleId) {
|
||||||
|
$role = Role::findOrFail($this->editingRoleId);
|
||||||
|
$role->update(['name' => $this->name]);
|
||||||
|
$role->syncPermissions($this->selectedPermissions);
|
||||||
|
session()->flash('message', '角色已更新');
|
||||||
|
} else {
|
||||||
|
$role = Role::create(['name' => $this->name]);
|
||||||
|
$role->syncPermissions($this->selectedPermissions);
|
||||||
|
session()->flash('message', '角色已新增');
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->resetFields();
|
||||||
|
$this->showCreateModal = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function delete($id)
|
||||||
|
{
|
||||||
|
Role::findOrFail($id)->delete();
|
||||||
|
session()->flash('message', '角色已刪除');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function resetFields()
|
||||||
|
{
|
||||||
|
$this->name = '';
|
||||||
|
$this->selectedPermissions = [];
|
||||||
|
$this->editingRoleId = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
return view('livewire.admin.roles', [
|
||||||
|
'roles' => $this->roles,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
13
app/Livewire/Admin/SongForm.php
Normal file
13
app/Livewire/Admin/SongForm.php
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Livewire\Admin;
|
||||||
|
|
||||||
|
use Livewire\Component;
|
||||||
|
|
||||||
|
class SongForm extends Component
|
||||||
|
{
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
return view('livewire.admin.song-form');
|
||||||
|
}
|
||||||
|
}
|
209
app/Livewire/Admin/SongTable.php
Normal file
209
app/Livewire/Admin/SongTable.php
Normal file
@ -0,0 +1,209 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Livewire\Admin;
|
||||||
|
|
||||||
|
use App\Models\Song;
|
||||||
|
use Illuminate\Support\Carbon;
|
||||||
|
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;
|
||||||
|
|
||||||
|
final class SongTable extends PowerGridComponent
|
||||||
|
{
|
||||||
|
public string $tableName = 'song-table';
|
||||||
|
|
||||||
|
public bool $showFilters = false;
|
||||||
|
|
||||||
|
public function boot(): void
|
||||||
|
{
|
||||||
|
config(['livewire-powergrid.filter' => 'outside']);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setUp(): array
|
||||||
|
{
|
||||||
|
$this->showCheckBox();
|
||||||
|
|
||||||
|
return [
|
||||||
|
PowerGrid::exportable(fileName: 'song-file')
|
||||||
|
->type(Exportable::TYPE_XLS, Exportable::TYPE_CSV),
|
||||||
|
PowerGrid::header()
|
||||||
|
->showSoftDeletes()
|
||||||
|
->showToggleColumns()
|
||||||
|
->showSearchInput(),
|
||||||
|
PowerGrid::footer()
|
||||||
|
->showPerPage()
|
||||||
|
->showRecordCount(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function header(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
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, []),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function datasource(): Builder
|
||||||
|
{
|
||||||
|
return Song::query();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function relationSearch(): array
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function fields(): PowerGridFields
|
||||||
|
{
|
||||||
|
return PowerGrid::fields()
|
||||||
|
->add('id')
|
||||||
|
->add('name')
|
||||||
|
->add('adddate_formatted', fn (Song $model) => Carbon::parse($model->adddate)->format('d/m/Y'))
|
||||||
|
->add('filename')
|
||||||
|
->add('language_type')
|
||||||
|
->add('db_change')
|
||||||
|
->add('vocal')
|
||||||
|
->add('situation')
|
||||||
|
->add('copyright01')
|
||||||
|
->add('copyright02')
|
||||||
|
->add('note01')
|
||||||
|
->add('note02')
|
||||||
|
->add('note03')
|
||||||
|
->add('note04')
|
||||||
|
->add('enable')
|
||||||
|
->add('unnamed_21')
|
||||||
|
->add('simplified')
|
||||||
|
->add('phonetic_abbr')
|
||||||
|
->add('pinyin_abbr')
|
||||||
|
->add('created_at_formatted', fn (Song $model) => Carbon::parse($model->created_at)->format('d/m/Y H:i:s'));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function columns(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Column::make(__('songs.id'), 'id'),
|
||||||
|
Column::make(__('songs.name'), 'name')
|
||||||
|
->sortable()
|
||||||
|
->searchable(),
|
||||||
|
|
||||||
|
Column::make(__('songs.adddate'), 'adddate_formatted', 'adddate')
|
||||||
|
->sortable(),
|
||||||
|
|
||||||
|
Column::make(__('songs.filename'), 'filename')
|
||||||
|
->sortable()
|
||||||
|
->searchable(),
|
||||||
|
|
||||||
|
Column::make(__('songs.language_type'), 'language_type'),
|
||||||
|
Column::make('Db change', 'db_change'),
|
||||||
|
Column::make(__('songs.vocal'), 'vocal'),
|
||||||
|
Column::make(__('songs.situation'), 'situation')
|
||||||
|
->sortable()
|
||||||
|
->searchable(),
|
||||||
|
|
||||||
|
Column::make(__('songs.copyright01'), 'copyright01')
|
||||||
|
->sortable()
|
||||||
|
->searchable(),
|
||||||
|
|
||||||
|
Column::make(__('songs.copyright02'), 'copyright02')
|
||||||
|
->sortable()
|
||||||
|
->searchable(),
|
||||||
|
|
||||||
|
Column::make(__('songs.note01'), 'note01')
|
||||||
|
->sortable()
|
||||||
|
->searchable(),
|
||||||
|
|
||||||
|
Column::make(__('songs.note02'), 'note02')
|
||||||
|
->sortable()
|
||||||
|
->searchable(),
|
||||||
|
|
||||||
|
Column::make(__('songs.note03'), 'note03')
|
||||||
|
->sortable()
|
||||||
|
->searchable(),
|
||||||
|
|
||||||
|
Column::make(__('songs.note04'), 'note04')
|
||||||
|
->sortable()
|
||||||
|
->searchable(),
|
||||||
|
|
||||||
|
Column::make(__('songs.enable'), 'enable'),
|
||||||
|
Column::make('Unnamed 21', 'unnamed_21')
|
||||||
|
->sortable()
|
||||||
|
->searchable(),
|
||||||
|
|
||||||
|
Column::make(__('songs.simplified'), 'simplified')
|
||||||
|
->sortable()
|
||||||
|
->searchable(),
|
||||||
|
|
||||||
|
Column::make(__('songs.name.phinetic'), 'phonetic_abbr')
|
||||||
|
->sortable()
|
||||||
|
->searchable(),
|
||||||
|
|
||||||
|
Column::make(__('songs.name.pinyin'), 'pinyin_abbr')
|
||||||
|
->sortable()
|
||||||
|
->searchable(),
|
||||||
|
|
||||||
|
Column::make('Created at', 'created_at_formatted', 'created_at')
|
||||||
|
->sortable(),
|
||||||
|
|
||||||
|
Column::action(__('songs.actions'))
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function filters(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Filter::datepicker('adddate'),
|
||||||
|
Filter::datetimepicker('created_at'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
#[On('bulkDelete.{tableName}')]
|
||||||
|
public function bulkDelete(): void
|
||||||
|
{
|
||||||
|
$this->js('alert(window.pgBulkActions.get(\'' . $this->tableName . '\'))');
|
||||||
|
if($this->checkboxValues){
|
||||||
|
Artist::destroy($this->checkboxValues);
|
||||||
|
$this->js('window.pgBulkActions.clearAll()'); // clear the count on the interface.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function actions(Song $row): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
|
||||||
|
Button::add('edit')
|
||||||
|
->slot(__('songs.edit'))
|
||||||
|
->icon('solid-pencil-square')
|
||||||
|
->class('inline-flex items-center gap-1 px-3 py-1 rounded ')
|
||||||
|
->dispatchTo('admin.song-form', 'openEditSongModal', ['id' => $row->id]),
|
||||||
|
Button::add('delete')
|
||||||
|
->slot(__('songs.delete'))
|
||||||
|
->icon('solid-trash')
|
||||||
|
->class('inline-flex items-center gap-1 px-3 py-1 rounded ')
|
||||||
|
->dispatchTo('admin.song-form', 'deleteSong', ['id' => $row->id]),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
public function actionRules($row): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
// Hide button edit for ID 1
|
||||||
|
Rule::button('edit')
|
||||||
|
->when(fn($row) => $row->id === 1)
|
||||||
|
->hide(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
}
|
90
app/Livewire/Admin/UserForm.php
Normal file
90
app/Livewire/Admin/UserForm.php
Normal file
@ -0,0 +1,90 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Livewire\Admin;
|
||||||
|
|
||||||
|
use Livewire\Component;
|
||||||
|
|
||||||
|
use App\Models\User;
|
||||||
|
use Spatie\Permission\Models\Role;
|
||||||
|
|
||||||
|
class UserForm extends Component
|
||||||
|
{
|
||||||
|
protected $listeners = ['openCreateUserModal','openEditUserModal', 'deleteUser','bulkDeleteUser'];
|
||||||
|
|
||||||
|
public bool $showCreateModal = false;
|
||||||
|
public ?int $userId = null;
|
||||||
|
public $name;
|
||||||
|
public $email;
|
||||||
|
public $roles = []; // 所有角色清單
|
||||||
|
public $selectedRoles = []; // 表單中選到的權限
|
||||||
|
|
||||||
|
protected $rules = [
|
||||||
|
'name' => 'required|string|max:255',
|
||||||
|
'email' => 'required|string|max:255',
|
||||||
|
];
|
||||||
|
|
||||||
|
public function mount()
|
||||||
|
{
|
||||||
|
$this->roles = Role::all();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function openCreateUserModal()
|
||||||
|
{
|
||||||
|
$this->resetFields();
|
||||||
|
$this->showCreateModal = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function openEditUserModal($id)
|
||||||
|
{
|
||||||
|
$user = User::findOrFail($id);
|
||||||
|
$this->userId = $user->id;
|
||||||
|
$this->name = $user->name;
|
||||||
|
$this->email =$user->email;
|
||||||
|
$this->selectedRoles = $user->roles()->pluck('id')->toArray();
|
||||||
|
$this->showCreateModal = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function save()
|
||||||
|
{
|
||||||
|
$this->validate();
|
||||||
|
|
||||||
|
if ($this->userId) {
|
||||||
|
$role = User::findOrFail($this->userId);
|
||||||
|
$role->update([
|
||||||
|
'name' => $this->name,
|
||||||
|
'email' => $this->email,
|
||||||
|
]);
|
||||||
|
$role->syncRolses($this->selectedRoles);
|
||||||
|
session()->flash('message', '使用者已更新');
|
||||||
|
} else {
|
||||||
|
$role = User::create([
|
||||||
|
'name' => $this->name,
|
||||||
|
'email' => $this->email,
|
||||||
|
]);
|
||||||
|
$role->syncRolses($this->selectedRoles);
|
||||||
|
session()->flash('message', '使用者已新增');
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->resetFields();
|
||||||
|
$this->showCreateModal = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function deleteUser($id)
|
||||||
|
{
|
||||||
|
User::findOrFail($id)->delete();
|
||||||
|
session()->flash('message', '使用者已刪除');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function resetFields()
|
||||||
|
{
|
||||||
|
$this->name = '';
|
||||||
|
$this->email = '';
|
||||||
|
$this->selectedRoles = [];
|
||||||
|
$this->userId = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
return view('livewire.admin.user-form');
|
||||||
|
}
|
||||||
|
}
|
134
app/Livewire/Admin/UserTable.php
Normal file
134
app/Livewire/Admin/UserTable.php
Normal file
@ -0,0 +1,134 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Livewire\Admin;
|
||||||
|
|
||||||
|
use App\Models\User;
|
||||||
|
use Illuminate\Support\Carbon;
|
||||||
|
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;
|
||||||
|
|
||||||
|
final class UserTable extends PowerGridComponent
|
||||||
|
{
|
||||||
|
use WithExport;
|
||||||
|
|
||||||
|
public string $tableName = 'user-table';
|
||||||
|
|
||||||
|
public bool $showFilters = false;
|
||||||
|
|
||||||
|
public function boot(): void
|
||||||
|
{
|
||||||
|
config(['livewire-powergrid.filter' => 'outside']);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function setUp(): array
|
||||||
|
{
|
||||||
|
$this->showCheckBox();
|
||||||
|
|
||||||
|
return [
|
||||||
|
PowerGrid::exportable(fileName: 'my-export-file')
|
||||||
|
->type(Exportable::TYPE_XLS, Exportable::TYPE_CSV),
|
||||||
|
PowerGrid::header()
|
||||||
|
//->showSoftDeletes()
|
||||||
|
->showToggleColumns()
|
||||||
|
->showSearchInput(),
|
||||||
|
PowerGrid::footer()->showPerPage()->showRecordCount(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
public function header(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
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, []),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
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('created_at_formatted', fn (User $model) => Carbon::parse($model->created_at)->format('d/m/Y H:i:s'));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function columns(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Column::make('ID', 'id'),
|
||||||
|
Column::make('名稱', 'name')->sortable()->searchable(),
|
||||||
|
Column::make('Email', 'email')->sortable()->searchable(),
|
||||||
|
Column::make('建立時間', 'created_at_formatted', 'created_at')->sortable(),
|
||||||
|
Column::action('操作')
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function filters(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Filter::inputText('name')->placeholder('Dish Name'),
|
||||||
|
Filter::inputText('email')->placeholder('Dish Email'),
|
||||||
|
Filter::datetimepicker('created_at'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function actions(User $row): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
|
||||||
|
Button::add('edit')
|
||||||
|
->slot('編輯')
|
||||||
|
->icon('solid-pencil-square')
|
||||||
|
->class('inline-flex items-center gap-1 px-3 py-1 rounded ')
|
||||||
|
->dispatchTo('admin.user-form', 'openEditUserModal', ['id' => $row->id]),
|
||||||
|
Button::add('delete')
|
||||||
|
->slot('刪除')
|
||||||
|
->icon('solid-trash')
|
||||||
|
->class('inline-flex items-center gap-1 px-3 py-1 rounded ')
|
||||||
|
->dispatchTo('admin.user-form', 'deleteUser', ['id' => $row->id]),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
#[On('bulkDelete.{tableName}')]
|
||||||
|
public function bulkDelete(): void
|
||||||
|
{
|
||||||
|
$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.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* 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());
|
||||||
|
}
|
||||||
|
}
|
43
app/Models/Artist.php
Normal file
43
app/Models/Artist.php
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use App\Helpers\ChineseNameConverter;
|
||||||
|
|
||||||
|
|
||||||
|
class Artist extends Model
|
||||||
|
{
|
||||||
|
/** @use HasFactory<\Database\Factories\ArtistFactory> */
|
||||||
|
use HasFactory;
|
||||||
|
|
||||||
|
protected $fillable = [
|
||||||
|
'category_id',
|
||||||
|
'name',
|
||||||
|
'simplified',
|
||||||
|
'phonetic_abbr',
|
||||||
|
'pinyin_abbr',
|
||||||
|
];
|
||||||
|
|
||||||
|
public function category()
|
||||||
|
{
|
||||||
|
return $this->belongsTo(ArtistCategory::class, 'category_id', 'id');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function songs() {
|
||||||
|
return $this->belongsToMany(Song::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected static function booted()
|
||||||
|
{
|
||||||
|
// 無論是 creating 或 updating,都執行這段共用的邏輯
|
||||||
|
static::saving(function ($artist) {
|
||||||
|
$simplified=ChineseNameConverter::convertToSimplified($artist->name);// 繁體轉簡體
|
||||||
|
$artist->simplified = $simplified;
|
||||||
|
$artist->phonetic_abbr = ChineseNameConverter::getKTVZhuyinAbbr($simplified);// 注音符號
|
||||||
|
$artist->pinyin_abbr=ChineseNameConverter::getKTVPinyinAbbr($simplified);// 拼音首字母
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
16
app/Models/ArtistCategory.php
Normal file
16
app/Models/ArtistCategory.php
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class ArtistCategory extends Model
|
||||||
|
{
|
||||||
|
/** @use HasFactory<\Database\Factories\ArtistCategoryFactory> */
|
||||||
|
use HasFactory;
|
||||||
|
|
||||||
|
protected $fillable = [
|
||||||
|
'name',
|
||||||
|
];
|
||||||
|
}
|
57
app/Models/Song.php
Normal file
57
app/Models/Song.php
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use App\Helpers\ChineseNameConverter;
|
||||||
|
|
||||||
|
class Song extends Model
|
||||||
|
{
|
||||||
|
/** @use HasFactory<\Database\Factories\SongFactory> */
|
||||||
|
use HasFactory;
|
||||||
|
|
||||||
|
protected $fillable = [
|
||||||
|
'name',
|
||||||
|
'adddate',
|
||||||
|
'filename',
|
||||||
|
'language_type',
|
||||||
|
'db_change',
|
||||||
|
'vocal',
|
||||||
|
'situation',
|
||||||
|
'copyright01',
|
||||||
|
'copyright02',
|
||||||
|
'note01',
|
||||||
|
'note02',
|
||||||
|
'note03',
|
||||||
|
'note04',
|
||||||
|
'enable',
|
||||||
|
'unnamed_21',
|
||||||
|
'simplified',
|
||||||
|
'phonetic_abbr',
|
||||||
|
'pinyin_abbr',
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
public function artists(){
|
||||||
|
return $this->belongsToMany(Artist::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function categories(){
|
||||||
|
return $this->belongsToMany(SongCategory::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function language(){
|
||||||
|
return $this->belongsTo(SongLanguage::class, 'languageType', 'id');
|
||||||
|
}
|
||||||
|
protected static function booted()
|
||||||
|
{
|
||||||
|
// 無論是 creating 或 updating,都執行這段共用的邏輯
|
||||||
|
static::saving(function ($song) {
|
||||||
|
$simplified=ChineseNameConverter::convertToSimplified($song->name);// 繁體轉簡體
|
||||||
|
$song->simplified = $simplified;
|
||||||
|
$song->phonetic_abbr = ChineseNameConverter::getKTVZhuyinAbbr($simplified);// 注音符號
|
||||||
|
$song->pinyin_abbr=ChineseNameConverter::getKTVPinyinAbbr($simplified);// 拼音首字母
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
21
app/Models/SongCategory.php
Normal file
21
app/Models/SongCategory.php
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class SongCategory extends Model
|
||||||
|
{
|
||||||
|
/** @use HasFactory<\Database\Factories\SongCategoryFactory> */
|
||||||
|
use HasFactory;
|
||||||
|
|
||||||
|
protected $fillable = [
|
||||||
|
'code',
|
||||||
|
'name',
|
||||||
|
];
|
||||||
|
|
||||||
|
public function songs() {
|
||||||
|
return $this->belongsToMany(Song::class);
|
||||||
|
}
|
||||||
|
}
|
16
app/Models/SongLanguage.php
Normal file
16
app/Models/SongLanguage.php
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class SongLanguage extends Model
|
||||||
|
{
|
||||||
|
/** @use HasFactory<\Database\Factories\SongLanguageFactory> */
|
||||||
|
use HasFactory;
|
||||||
|
|
||||||
|
protected $fillable = [
|
||||||
|
'name',
|
||||||
|
];
|
||||||
|
}
|
36
app/Models/SongLibrary.php
Normal file
36
app/Models/SongLibrary.php
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class SongLibrary extends Model
|
||||||
|
{ /** @use HasFactory<\Database\Factories\SongLanguageFactory> */
|
||||||
|
use HasFactory;
|
||||||
|
|
||||||
|
// 指定使用的資料庫連線(SQLite)
|
||||||
|
protected $connection = 'KTVsqlite';
|
||||||
|
|
||||||
|
// 指定表格名稱(如果不符合 Laravel 預設的複數形式,可手動指定)
|
||||||
|
protected $table = 'SongLibrary';
|
||||||
|
|
||||||
|
// 設定主鍵欄位(如果不是 'id',例如這裡是 '歌曲編號')
|
||||||
|
protected $primaryKey = '歌曲編號';
|
||||||
|
|
||||||
|
// 如果你的主鍵不是整數型別(如 `BIGINT`),需要指定
|
||||||
|
public $incrementing = false; // 因為 '歌曲編號' 不是自動遞增的
|
||||||
|
|
||||||
|
// 如果你不需要用預設的時間戳記 (created_at, updated_at),可以設定如下:
|
||||||
|
public $timestamps = false;
|
||||||
|
|
||||||
|
// 你可以指定哪些欄位是可以批量賦值的(防止批量賦值漏洞)
|
||||||
|
protected $fillable = [
|
||||||
|
'歌曲編號', '歌曲名稱', '歌星 A', '歌星 B', '路徑 1', '路徑 2', '歌曲檔名', '新增日期', '分類', '歌曲注音',
|
||||||
|
'歌曲拼音', '語別', '點播次數', '版權01', '版權02', '版權03', '版權04', '版權05', '版權06', '狀態',
|
||||||
|
'DB加減', 'Unnamed: 21', '歌名字數', '人聲', '狀態2', '情境', '歌星A注音', '歌星B注音', '歌星A分類',
|
||||||
|
'歌星B分類', '歌星A簡體', '歌星B簡體', '歌名簡體', '歌星A拼音', '歌星B拼音'
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
}
|
49
app/Models/User.php
Normal file
49
app/Models/User.php
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
<?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;
|
||||||
|
|
||||||
|
class User extends Authenticatable
|
||||||
|
{
|
||||||
|
/** @use HasFactory<\Database\Factories\UserFactory> */
|
||||||
|
use HasFactory, Notifiable, HasRoles;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The attributes that are mass assignable.
|
||||||
|
*
|
||||||
|
* @var list<string>
|
||||||
|
*/
|
||||||
|
protected $fillable = [
|
||||||
|
'name',
|
||||||
|
'email',
|
||||||
|
'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',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
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'),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
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');
|
||||||
|
}
|
||||||
|
}
|
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,
|
||||||
|
];
|
85
composer.json
Normal file
85
composer.json
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
{
|
||||||
|
"$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",
|
||||||
|
"laravel/framework": "^12.0",
|
||||||
|
"laravel/tinker": "^2.10.1",
|
||||||
|
"livewire/livewire": "^3.4",
|
||||||
|
"livewire/volt": "^1.7.0",
|
||||||
|
"openspout/openspout": "^4.0",
|
||||||
|
"overtrue/php-opencc": "^1.2",
|
||||||
|
"overtrue/pinyin": "^5.3",
|
||||||
|
"power-components/livewire-powergrid": "^6.3",
|
||||||
|
"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
|
||||||
|
}
|
8942
composer.lock
generated
Normal file
8942
composer.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
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' => '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_'),
|
||||||
|
|
||||||
|
];
|
185
config/database.php
Normal file
185
config/database.php
Normal file
@ -0,0 +1,185 @@
|
|||||||
|
<?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,
|
||||||
|
],
|
||||||
|
|
||||||
|
'KTVsqlite' => [
|
||||||
|
'driver' => 'sqlite',
|
||||||
|
'url' => env('DB_URL'),
|
||||||
|
'database' => env('SQLITE_DB', database_path('KSongDatabase.db')),
|
||||||
|
'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'),
|
||||||
|
],
|
||||||
|
|
||||||
|
],
|
||||||
|
|
||||||
|
];
|
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'),
|
||||||
|
],
|
||||||
|
|
||||||
|
];
|
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',
|
||||||
|
],
|
||||||
|
|
||||||
|
];
|
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*
|
BIN
database/KSongDatabase.db
Normal file
BIN
database/KSongDatabase.db
Normal file
Binary file not shown.
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,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
49
database/migrations/0001_01_01_000000_create_users_table.php
Normal file
49
database/migrations/0001_01_01_000000_create_users_table.php
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::create('users', function (Blueprint $table) {
|
||||||
|
$table->id();
|
||||||
|
$table->string('name');
|
||||||
|
$table->string('email')->unique();
|
||||||
|
$table->timestamp('email_verified_at')->nullable();
|
||||||
|
$table->string('password');
|
||||||
|
$table->rememberToken();
|
||||||
|
$table->timestamps();
|
||||||
|
});
|
||||||
|
|
||||||
|
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,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,29 @@
|
|||||||
|
<?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('song_categories', function (Blueprint $table) {
|
||||||
|
$table->id();
|
||||||
|
$table->string('code')->unique();
|
||||||
|
$table->string('name')->unique();
|
||||||
|
$table->timestamps();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('song_categories');
|
||||||
|
}
|
||||||
|
};
|
@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::create('song_languages', function (Blueprint $table) {
|
||||||
|
$table->id();
|
||||||
|
$table->string('name')->unique();
|
||||||
|
$table->timestamps();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('song_languages');
|
||||||
|
}
|
||||||
|
};
|
@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::create('artist_categories', function (Blueprint $table) {
|
||||||
|
$table->id();
|
||||||
|
$table->string('name')->unique();
|
||||||
|
$table->timestamps();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('artist_categories');
|
||||||
|
}
|
||||||
|
};
|
@ -0,0 +1,34 @@
|
|||||||
|
<?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('artists', function (Blueprint $table) {
|
||||||
|
$table->bigIncrements('id');
|
||||||
|
$table->unsignedBigInteger('category_id')->default(1)->comment('關聯 artist_category.id');//預設為 1(未定義))
|
||||||
|
$table->string('name')->comment('歌星名稱');
|
||||||
|
$table->string('simplified')->comment('歌星簡體');
|
||||||
|
$table->string('phonetic_abbr')->comment('歌星注音');
|
||||||
|
$table->string('pinyin_abbr')->comment('歌星拼音');
|
||||||
|
$table->timestamps();
|
||||||
|
// 外鍵(如需要)
|
||||||
|
$table->foreign('category_id')->references('id')->on('artist_categories')->restrictOnDelete()->restrictOnUpdate();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('artists');
|
||||||
|
}
|
||||||
|
};
|
49
database/migrations/2025_04_23_031630_create_songs_table.php
Normal file
49
database/migrations/2025_04_23_031630_create_songs_table.php
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
<?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('songs', function (Blueprint $table) {
|
||||||
|
$table->bigIncrements('id')->comment('歌曲編號');
|
||||||
|
$table->text('name')->nullable()->comment('歌曲檔名');
|
||||||
|
$table->string('filename')->comment('歌曲檔名');
|
||||||
|
$table->date('adddate')->comment('新增日期');
|
||||||
|
$table->unsignedBigInteger('language_type')->comment('語別'); // 關聯 song_languages.id
|
||||||
|
$table->integer('db_change')->default(0)->comment('DB加減');
|
||||||
|
$table->tinyInteger('vocal')->comment('人聲'); // 0,1
|
||||||
|
$table->string('situation')->comment('情境');
|
||||||
|
$table->string('copyright01')->nullable()->comment('版權01');
|
||||||
|
$table->string('copyright02')->nullable()->comment('版權02');
|
||||||
|
$table->string('note01')->nullable()->comment('備註01');
|
||||||
|
$table->string('note02')->nullable()->comment('備註02');
|
||||||
|
$table->string('note03')->nullable()->comment('備註03');
|
||||||
|
$table->string('note04')->nullable()->comment('備註04');
|
||||||
|
$table->tinyInteger('enable')->default(1)->comment('狀態'); // 1,可看,0,不可看
|
||||||
|
$table->float('unnamed_21')->nullable()->comment('Unnamed_21');
|
||||||
|
$table->string('simplified')->comment('歌名簡體');
|
||||||
|
$table->string('phonetic_abbr')->comment('歌曲注音');
|
||||||
|
$table->string('pinyin_abbr')->comment('歌曲拼音');
|
||||||
|
$table->timestamps();
|
||||||
|
|
||||||
|
// 外鍵關聯(如有需要)
|
||||||
|
$table->foreign('language_type')->references('id')->on('song_languages')->restrictOnDelete()->restrictOnUpdate();
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('songs');
|
||||||
|
}
|
||||||
|
};
|
@ -0,0 +1,31 @@
|
|||||||
|
<?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('song_song_category', function (Blueprint $table) {
|
||||||
|
$table->unsignedBigInteger('song_id');
|
||||||
|
$table->unsignedBigInteger('song_category_id');
|
||||||
|
|
||||||
|
$table->foreign('song_id')->references('id')->on('songs')->restrictOnDelete()->restrictOnUpdate();
|
||||||
|
$table->foreign('song_category_id')->references('id')->on('song_categories')->restrictOnDelete()->restrictOnUpdate();
|
||||||
|
$table->primary(['song_id', 'song_category_id']);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('song_song_category');
|
||||||
|
}
|
||||||
|
};
|
@ -0,0 +1,31 @@
|
|||||||
|
<?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('artist_song', function (Blueprint $table) {
|
||||||
|
$table->unsignedBigInteger('song_id');
|
||||||
|
$table->unsignedBigInteger('artist_id');
|
||||||
|
|
||||||
|
$table->foreign('song_id')->references('id')->on('songs')->restrictOnDelete()->restrictOnUpdate();
|
||||||
|
$table->foreign('artist_id')->references('id')->on('artists')->restrictOnDelete()->restrictOnUpdate();
|
||||||
|
$table->primary(['song_id', 'artist_id']);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('artist_song');
|
||||||
|
}
|
||||||
|
};
|
22
database/seeders/ArtistCategorySeeder.php
Normal file
22
database/seeders/ArtistCategorySeeder.php
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Database\Seeders;
|
||||||
|
|
||||||
|
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||||
|
use Illuminate\Database\Seeder;
|
||||||
|
use App\Models\ArtistCategory;
|
||||||
|
|
||||||
|
class ArtistCategorySeeder extends Seeder
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the database seeds.
|
||||||
|
*/
|
||||||
|
public function run(): void
|
||||||
|
{
|
||||||
|
$artistCategoryLists = ['未定義','男', '團', '女', '外'];
|
||||||
|
|
||||||
|
foreach ($artistCategoryLists as $category) {
|
||||||
|
ArtistCategory::create(['name' => $category]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
18
database/seeders/ChineseNameConverterSeeder.php
Normal file
18
database/seeders/ChineseNameConverterSeeder.php
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Database\Seeders;
|
||||||
|
|
||||||
|
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||||
|
use Illuminate\Database\Seeder;
|
||||||
|
use App\Helpers\ChineseNameConverter;
|
||||||
|
|
||||||
|
class ChineseNameConverterSeeder extends Seeder
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the database seeds.
|
||||||
|
*/
|
||||||
|
public function run(): void
|
||||||
|
{
|
||||||
|
dd(ChineseNameConverter::convertAll('比愛更愛'));
|
||||||
|
}
|
||||||
|
}
|
29
database/seeders/CreateAdminUserSeeder.php
Normal file
29
database/seeders/CreateAdminUserSeeder.php
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
<?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',
|
||||||
|
'password' => bcrypt('aa1234')
|
||||||
|
]);
|
||||||
|
$user->assignRole('Admin');
|
||||||
|
$user = User::create([
|
||||||
|
'name' => 'Allen Yan(User)',
|
||||||
|
'email' => 'allen.yan@gmail.com',
|
||||||
|
'password' => bcrypt('aa1234')
|
||||||
|
]);
|
||||||
|
$user->assignRole('User');
|
||||||
|
}
|
||||||
|
}
|
24
database/seeders/DatabaseSeeder.php
Normal file
24
database/seeders/DatabaseSeeder.php
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
<?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,
|
||||||
|
SongCategorySeeder::class,
|
||||||
|
SongLanguageSeeder::class,
|
||||||
|
ArtistCategorySeeder::class,
|
||||||
|
CreateAdminUserSeeder::class,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
46
database/seeders/PermissionTableSeeder.php
Normal file
46
database/seeders/PermissionTableSeeder.php
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
<?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 = [
|
||||||
|
'song-list',
|
||||||
|
'song-create',
|
||||||
|
'song-edit',
|
||||||
|
'song-delete',
|
||||||
|
'room-list',
|
||||||
|
'room-create',
|
||||||
|
'room-edit',
|
||||||
|
'room-delete',
|
||||||
|
'user-list',
|
||||||
|
'user-create',
|
||||||
|
'user-edit',
|
||||||
|
'user-delete',
|
||||||
|
'role-list',
|
||||||
|
'role-create',
|
||||||
|
'role-edit',
|
||||||
|
'role-delete'
|
||||||
|
];
|
||||||
|
|
||||||
|
foreach ($permissions as $permission) {
|
||||||
|
Permission::create(['name' => $permission]);
|
||||||
|
}
|
||||||
|
// 建立 Admin 角色,給所有權限
|
||||||
|
$adminRole = Role::firstOrCreate(['name' => 'Admin']);
|
||||||
|
$adminRole->syncPermissions(Permission::all());
|
||||||
|
|
||||||
|
// 建立 User 角色,不給任何權限
|
||||||
|
Role::firstOrCreate(['name' => 'User']);
|
||||||
|
}
|
||||||
|
}
|
32
database/seeders/SongCategorySeeder.php
Normal file
32
database/seeders/SongCategorySeeder.php
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Database\Seeders;
|
||||||
|
|
||||||
|
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||||
|
use Illuminate\Database\Seeder;
|
||||||
|
use App\Models\SongCategory;
|
||||||
|
|
||||||
|
class SongCategorySeeder extends Seeder
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the database seeds.
|
||||||
|
*/
|
||||||
|
public function run(): void
|
||||||
|
{
|
||||||
|
$categories = [
|
||||||
|
['code' => 'A1', 'name' => '情歌'],
|
||||||
|
['code' => 'B1', 'name' => '選秀'],
|
||||||
|
['code' => 'C1', 'name' => '串燒'],
|
||||||
|
['code' => 'D1', 'name' => '90年'],
|
||||||
|
['code' => 'E1', 'name' => '懷念'],
|
||||||
|
['code' => 'F1', 'name' => '大陸'],
|
||||||
|
];
|
||||||
|
|
||||||
|
foreach ($categories as $category) {
|
||||||
|
SongCategory::create([
|
||||||
|
'code' => $category['code'],
|
||||||
|
'name' => $category['name'],
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
22
database/seeders/SongLanguageSeeder.php
Normal file
22
database/seeders/SongLanguageSeeder.php
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Database\Seeders;
|
||||||
|
|
||||||
|
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||||
|
use Illuminate\Database\Seeder;
|
||||||
|
use App\Models\SongLanguage;
|
||||||
|
|
||||||
|
class SongLanguageSeeder extends Seeder
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the database seeds.
|
||||||
|
*/
|
||||||
|
public function run(): void
|
||||||
|
{
|
||||||
|
$languages = ['國語', '台語', '英語', '日語','粵語', '韓語', '越語', '客語', '其他'];
|
||||||
|
|
||||||
|
foreach ($languages as $lang) {
|
||||||
|
SongLanguage::create(['name' => $lang]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
126
database/seeders/SqliteToMysqlSeeder.php
Normal file
126
database/seeders/SqliteToMysqlSeeder.php
Normal file
@ -0,0 +1,126 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Database\Seeders;
|
||||||
|
|
||||||
|
use Illuminate\Database\Seeder;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use App\Models\SongLibrary;
|
||||||
|
use App\Models\Song;
|
||||||
|
use App\Models\Artist;
|
||||||
|
|
||||||
|
class SqliteToMysqlSeeder extends Seeder
|
||||||
|
{
|
||||||
|
public function run(): void
|
||||||
|
{
|
||||||
|
$ArtistCategoryMap = \App\Models\ArtistCategory::pluck('id', 'name')->toArray();
|
||||||
|
$SongCategoryMap = \App\Models\SongCategory::pluck('id', 'code')->toArray();
|
||||||
|
$SongLanguageMap = \App\Models\SongLanguage::pluck('id', 'name')->toArray();
|
||||||
|
|
||||||
|
$artistCache = [];
|
||||||
|
$chunkSize = 100;
|
||||||
|
$totalCount = 0;
|
||||||
|
SongLibrary::where('歌曲編號', '>', 51912)->chunk($chunkSize, function ($songs) use ($ArtistCategoryMap, $SongCategoryMap, $SongLanguageMap, &$artistCache, &$totalCount) {
|
||||||
|
$songsToInsert = [];
|
||||||
|
$pivotArtist = [];
|
||||||
|
$pivotCategory = [];
|
||||||
|
|
||||||
|
foreach ($songs as $data) {
|
||||||
|
$totalCount++; // 這裡計數
|
||||||
|
$songId = $data->{'歌曲編號'};
|
||||||
|
$artistAId = null;
|
||||||
|
$artistBId = null;
|
||||||
|
|
||||||
|
// 處理 Artist A
|
||||||
|
if (!empty($data->{'歌星 A'})) {
|
||||||
|
$key = $data->{'歌星 A'} . '|' . ($data->{'歌星A分類'} ?? '未定義');
|
||||||
|
if (!isset($artistCache[$key])) {
|
||||||
|
$artist = Artist::firstOrCreate([
|
||||||
|
'name' => $data->{'歌星 A'},
|
||||||
|
'category_id' => $ArtistCategoryMap[trim($data->{'歌星A分類'} ?? '')] ?? $ArtistCategoryMap['未定義'],
|
||||||
|
'simplified' => $data->{'歌星A簡體'} ?? '',
|
||||||
|
'phonetic_abbr' => $data->{'歌星A注音'} ?? '',
|
||||||
|
'pinyin_abbr' => $data->{'歌星A拼音'} ?? '',
|
||||||
|
]);
|
||||||
|
$artistCache[$key] = $artist->id;
|
||||||
|
}
|
||||||
|
$artistAId = $artistCache[$key];
|
||||||
|
}
|
||||||
|
|
||||||
|
// 處理 Artist B
|
||||||
|
if (!empty($data->{'歌星 B'})) {
|
||||||
|
$key = $data->{'歌星 B'} . '|' . ($data->{'歌星B分類'} ?? '未定義');
|
||||||
|
if (!isset($artistCache[$key])) {
|
||||||
|
$artist = Artist::firstOrCreate([
|
||||||
|
'name' => $data->{'歌星 B'},
|
||||||
|
'category_id' => $ArtistCategoryMap[trim($data->{'歌星B分類'} ?? '')] ?? $ArtistCategoryMap['未定義'],
|
||||||
|
'simplified' => $data->{'歌星B簡體'} ?? '',
|
||||||
|
'phonetic_abbr' => $data->{'歌星B注音'} ?? '',
|
||||||
|
'pinyin_abbr' => $data->{'歌星B拼音'} ?? '',
|
||||||
|
]);
|
||||||
|
$artistCache[$key] = $artist->id;
|
||||||
|
}
|
||||||
|
$artistBId = $artistCache[$key];
|
||||||
|
}
|
||||||
|
|
||||||
|
// 處理語別
|
||||||
|
$languageType = null;
|
||||||
|
if (!empty($data->{'語別'})) {
|
||||||
|
$languageType = $SongLanguageMap[trim($data->{'語別'} ?? '')] ?? $SongLanguageMap['其他'];
|
||||||
|
}
|
||||||
|
|
||||||
|
// 處理 Song 資料
|
||||||
|
$songsToInsert[] = [
|
||||||
|
'id' => $songId,
|
||||||
|
'name' => $data->{'歌曲名稱'},
|
||||||
|
'adddate' => $data->{'新增日期'},
|
||||||
|
'filename' => $data->{'歌曲檔名'},
|
||||||
|
'language_type' => $languageType,
|
||||||
|
'db_change' => $data->{'DB加減'} ?? 0,
|
||||||
|
'vocal' => $data->{'人聲'},
|
||||||
|
'situation' => $data->{'情境'},
|
||||||
|
'copyright01' => $data->{'版權01'},
|
||||||
|
'copyright02' => $data->{'版權02'},
|
||||||
|
'note01' => $data->{'版權03'},
|
||||||
|
'note02' => $data->{'版權04'},
|
||||||
|
'note03' => $data->{'版權05'},
|
||||||
|
'note04' => $data->{'版權06'},
|
||||||
|
'enable' => $data->{'狀態'},
|
||||||
|
'unnamed_21' => $data->{'Unnamed: 21'},
|
||||||
|
'simplified' => $data->{'歌名簡體'} ?? '',
|
||||||
|
'phonetic_abbr' => $data->{'歌曲注音'} ?? '',
|
||||||
|
'pinyin_abbr' => $data->{'歌曲拼音'} ?? '',
|
||||||
|
];
|
||||||
|
|
||||||
|
if ($artistAId) $pivotArtist[] = ['song_id' => $songId, 'artist_id' => $artistAId];
|
||||||
|
if ($artistBId) $pivotArtist[] = ['song_id' => $songId, 'artist_id' => $artistBId];
|
||||||
|
|
||||||
|
// 處理分類
|
||||||
|
|
||||||
|
if (!empty($data->{'分類'})) {
|
||||||
|
$categoryCodes = explode(',', $data->{'分類'});
|
||||||
|
$addedCategoryIds = [];
|
||||||
|
foreach ($categoryCodes as $code) {
|
||||||
|
$code = trim($code);
|
||||||
|
if (isset($SongCategoryMap[$code])) {
|
||||||
|
$categoryId = $SongCategoryMap[$code];
|
||||||
|
if (!in_array($categoryId, $addedCategoryIds)) {
|
||||||
|
$pivotCategory[] = [
|
||||||
|
'song_id' => $songId,
|
||||||
|
'song_category_id' => $SongCategoryMap[$code]
|
||||||
|
];
|
||||||
|
$addedCategoryIds[] = $categoryId;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Song::insert($songsToInsert);
|
||||||
|
DB::table('artist_song')->insert($pivotArtist);
|
||||||
|
DB::table('song_song_category')->insert($pivotCategory);
|
||||||
|
|
||||||
|
$this->command->info("目前累計處理 {$totalCount} 筆歌曲資料");
|
||||||
|
});
|
||||||
|
$this->command->info("全部完成,共處理 {$totalCount} 筆歌曲資料。");
|
||||||
|
}
|
||||||
|
}
|
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":"管理帳號"
|
||||||
|
|
||||||
|
}
|
22
resources/lang/zh-tw/artists.php
Normal file
22
resources/lang/zh-tw/artists.php
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
'management' => '歌手管理',
|
||||||
|
'list' => '歌手列表',
|
||||||
|
'CreateNewArtist' => '新增歌手',
|
||||||
|
'create_edit' => '新增 / 編輯',
|
||||||
|
'create' => '新增',
|
||||||
|
'edit' => '編輯',
|
||||||
|
'delete' => '刪除',
|
||||||
|
'no' => '編號',
|
||||||
|
'category' => '類別',
|
||||||
|
'name' => '名稱',
|
||||||
|
'name.simplified' => '簡體',
|
||||||
|
'name.phinetic' => '注音',
|
||||||
|
'name.pinyin' => '拼音',
|
||||||
|
|
||||||
|
'actions' => '操作',
|
||||||
|
'view' => '查看',
|
||||||
|
'submit' => '提交',
|
||||||
|
'cancel' => '取消',
|
||||||
|
];
|
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 秒後重試。',
|
||||||
|
|
||||||
|
];
|
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' => "我們找不到具有該電子郵件地址的使用者。",
|
||||||
|
|
||||||
|
];
|
17
resources/lang/zh-tw/roles.php
Normal file
17
resources/lang/zh-tw/roles.php
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
'list' => '角色列表',
|
||||||
|
'CreateNewRole' => '新增角色',
|
||||||
|
'edit' => '編輯',
|
||||||
|
'delete' => '刪除',
|
||||||
|
|
||||||
|
'no' => '編號',
|
||||||
|
'name' => '名稱',
|
||||||
|
|
||||||
|
'create' => '新增',
|
||||||
|
'action' => '操作',
|
||||||
|
'view' => '查看',
|
||||||
|
'submit' => '提交',
|
||||||
|
'cancel' => '取消',
|
||||||
|
];
|
37
resources/lang/zh-tw/songs.php
Normal file
37
resources/lang/zh-tw/songs.php
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
'management' => '歌曲管理',
|
||||||
|
'list' => '歌曲列表',
|
||||||
|
'CreateNewArtist' => '新增歌曲',
|
||||||
|
'create_edit' => '新增 / 編輯',
|
||||||
|
'create' => '新增',
|
||||||
|
'edit' => '編輯',
|
||||||
|
'delete' => '刪除',
|
||||||
|
|
||||||
|
'id' => '歌曲編號',
|
||||||
|
'name' => '歌曲名稱',
|
||||||
|
'artists' => '歌手',
|
||||||
|
'filename' => '歌曲檔名',
|
||||||
|
'adddate' => '新增日期',
|
||||||
|
'categorys' => '分類',
|
||||||
|
'name.phinetic' => '歌曲注音',
|
||||||
|
'name.pinyin' => '歌曲拼音',
|
||||||
|
'language_type' => '語別',
|
||||||
|
'copyright01' => '版權01',
|
||||||
|
'copyright02' => '版權02',
|
||||||
|
'note01' => '備註01',
|
||||||
|
'note02' => '備註02',
|
||||||
|
'note03' => '備註03',
|
||||||
|
'note04' => '備註04',
|
||||||
|
'enable' => '狀態',
|
||||||
|
'name_length' => '歌名字數',
|
||||||
|
'vocal' => '人聲',
|
||||||
|
'situation' => '情境',
|
||||||
|
'simplified' => '歌名簡體',
|
||||||
|
|
||||||
|
'actions' => '操作',
|
||||||
|
'view' => '查看',
|
||||||
|
'submit' => '提交',
|
||||||
|
'cancel' => '取消',
|
||||||
|
];
|
17
resources/lang/zh-tw/users.php
Normal file
17
resources/lang/zh-tw/users.php
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
'list' => '使用者列表',
|
||||||
|
'CreateNewRole' => '新增使用者',
|
||||||
|
'edit' => '編輯',
|
||||||
|
'delete' => '刪除',
|
||||||
|
|
||||||
|
'no' => '編號',
|
||||||
|
'name' => '名稱',
|
||||||
|
|
||||||
|
'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' => [],
|
||||||
|
|
||||||
|
];
|
BIN
resources/views/components/.DS_Store
vendored
Normal file
BIN
resources/views/components/.DS_Store
vendored
Normal file
Binary file not shown.
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>
|
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>
|
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