202508032157
調整路徑
This commit is contained in:
parent
e943fd8422
commit
dd9573edbe
@ -30,7 +30,7 @@ final class ActivityLogTable extends PowerGridComponent
|
||||
$header = PowerGrid::header()
|
||||
->withoutLoading()
|
||||
->showToggleColumns();
|
||||
$header->includeViewOnTop('livewire.header.admin.activity-log');
|
||||
$header->includeViewOnTop('livewire.headers.activity-log');
|
||||
|
||||
$actions[]=$header;
|
||||
$actions[]=PowerGrid::footer()->showPerPage()->showRecordCount();
|
||||
|
@ -41,7 +41,7 @@ final class MachineStatusTable extends PowerGridComponent
|
||||
->withoutLoading()
|
||||
->showToggleColumns();
|
||||
|
||||
$header->includeViewOnTop('livewire.header.admin.machine-status');
|
||||
$header->includeViewOnTop('livewire.headers.machine-status');
|
||||
|
||||
$actions[]=$header;
|
||||
$actions[]=PowerGrid::footer()->showPerPage()->showRecordCount();
|
||||
|
@ -28,7 +28,7 @@ final class RoomStatusLogTable extends PowerGridComponent
|
||||
$header = PowerGrid::header()
|
||||
->withoutLoading()
|
||||
->showToggleColumns();
|
||||
$header->includeViewOnTop('livewire.header.admin.room-status-log');
|
||||
$header->includeViewOnTop('livewire.headers.room-status-log');
|
||||
|
||||
$actions[]=$header;
|
||||
$actions[]=PowerGrid::footer()->showPerPage()->showRecordCount();
|
||||
|
@ -53,7 +53,7 @@ final class RoomTable extends PowerGridComponent
|
||||
->withoutLoading()
|
||||
->showToggleColumns();
|
||||
if($this->canCreate){
|
||||
$header->includeViewOnTop('livewire.header.admin.room');
|
||||
$header->includeViewOnTop('livewire.headers.room');
|
||||
}
|
||||
$actions[]=$header;
|
||||
$actions[]=PowerGrid::footer()->showPerPage()->showRecordCount();
|
||||
|
@ -36,7 +36,7 @@ final class SongLibraryCacheTable extends PowerGridComponent
|
||||
->withoutLoading()
|
||||
->showToggleColumns();
|
||||
|
||||
$header->includeViewOnTop('livewire.header.admin.song-library-cache');
|
||||
$header->includeViewOnTop('livewire.headers.song-library-cache');
|
||||
|
||||
$actions[]=$header;
|
||||
$actions[]=PowerGrid::footer()->showPerPage()->showRecordCount();
|
||||
|
@ -53,7 +53,7 @@ final class TextAdsTable extends PowerGridComponent
|
||||
}
|
||||
$header = PowerGrid::header()->showSoftDeletes()->showToggleColumns();
|
||||
if($this->canCreate){
|
||||
$header->includeViewOnTop('livewire.header.text-ad');
|
||||
$header->includeViewOnTop('livewire.headers.text-ad');
|
||||
}
|
||||
$actions[]=$header;
|
||||
$actions[]=PowerGrid::footer()->showPerPage()->showRecordCount();
|
||||
|
@ -30,7 +30,7 @@ final class UserTable extends PowerGridComponent
|
||||
$actions = [];
|
||||
$header = PowerGrid::header()
|
||||
->showToggleColumns();
|
||||
$header->includeViewOnTop('livewire.header.admin.user');
|
||||
$header->includeViewOnTop('livewire.headers.user');
|
||||
$actions[]=$header;
|
||||
$actions[]=PowerGrid::footer()->showPerPage()->showRecordCount();
|
||||
return $actions;
|
||||
|
@ -1,33 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
use App\Models\User;
|
||||
|
||||
class CreateAdminUserSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
$user = User::create([
|
||||
'name' => 'Allen Yan(admin)',
|
||||
'email' => 'admin@gmail.com',
|
||||
'phone' => '0900000000',
|
||||
'birthday' => now()->toDateString(),
|
||||
'password' => bcrypt('aa1234')
|
||||
]);
|
||||
$user->assignRole('Admin');
|
||||
$user = User::create([
|
||||
'name' => 'Allen Yan(User)',
|
||||
'email' => 'allen.yan@gmail.com',
|
||||
'phone' => '0900000001',
|
||||
'birthday' => now()->toDateString(),
|
||||
'password' => bcrypt('aa1234')
|
||||
]);
|
||||
$user->assignRole('User');
|
||||
}
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Carbon;
|
||||
|
||||
class FavoriteSongsSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
DB::table('FavoriteSongs')->insert([
|
||||
'songNumber' => 999996,
|
||||
'userPhone' => '0912345678',
|
||||
'created_at' => Carbon::now(),
|
||||
'updated_at' => Carbon::now(),
|
||||
]);
|
||||
}
|
||||
}
|
@ -1,38 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
use Spatie\Permission\Models\Role;
|
||||
use Spatie\Permission\Models\Permission;
|
||||
|
||||
class PermissionTableSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
$permissions = [
|
||||
'role-list',
|
||||
'role-create',
|
||||
'role-edit',
|
||||
'role-delete',
|
||||
'user-list',
|
||||
'user-create',
|
||||
'user-edit',
|
||||
'user-delete',
|
||||
];
|
||||
|
||||
foreach ($permissions as $permission) {
|
||||
Permission::create(['name' => $permission]);
|
||||
}
|
||||
// 建立 Admin 角色,給所有權限
|
||||
$adminRole = Role::firstOrCreate(['name' => 'Admin']);
|
||||
$adminRole->syncPermissions(Permission::all());
|
||||
|
||||
// 建立 User 角色,不給任何權限
|
||||
Role::firstOrCreate(['name' => 'User']);
|
||||
}
|
||||
}
|
@ -1,33 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Spatie\Permission\Models\Permission;
|
||||
use Spatie\Permission\Models\Role;
|
||||
|
||||
class TextAdPermissionSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
$permissions = [
|
||||
'text-ad-list',
|
||||
'text-ad-create',
|
||||
'text-ad-edit',
|
||||
'text-ad-delete',
|
||||
];
|
||||
|
||||
foreach ($permissions as $permission) {
|
||||
Permission::firstOrCreate(['name' => $permission]);
|
||||
}
|
||||
|
||||
// 把權限加給 Admin 角色
|
||||
$adminRole = Role::where('name', 'Admin')->first();
|
||||
if ($adminRole) {
|
||||
$adminRole->givePermissionTo($permissions);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,51 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use App\Models\TextAd;
|
||||
use App\Enums\TextAdColors;
|
||||
|
||||
class TextAdSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
$ads = [
|
||||
[
|
||||
'content' => '本公司消費方式:包廂費(原價 * 時數 * 折數)+ 清潔費(一次)+ 總金額10%服務費(一次)。',
|
||||
'color' => TextAdColors::Red,
|
||||
],
|
||||
[
|
||||
'content' => '一般專案為包廂計費,免收低消及人頭費;如各族群優惠專案為包廂計費、不限人數K歌一口價。',
|
||||
'color' => TextAdColors::Red,
|
||||
],
|
||||
[
|
||||
'content' => '工商專案 上班族趕快來報到 不限人數 包廂計費 歡唱K歌一口價★星期一至星期日 上午08:00 ~ 下午17:00 ★歡唱3小時 小包廂 666元 中包廂 999元 大包廂(臺中公園店為中大包廂) 1299元',
|
||||
'color' => TextAdColors::Green,
|
||||
],
|
||||
[
|
||||
'content' => '趁年輕 一定要大膽瘋狂不限人數 包廂計費 歡唱K歌一口價★星期一至星期五 上午08:00 ~ 下午17:00 ★歡唱3小時(員林中山店為4小時) 小包廂 333元 中包廂 666元 大包廂(臺中公園店為中大包廂) 999元',
|
||||
'color' => TextAdColors::Blue,
|
||||
],
|
||||
[
|
||||
'content' => '重拾當年意氣風發的活力 不輸少年人啦不限人數 包廂計費 歡唱K歌一口價 ★星期一至星期五 上午08:00 ~ 下午17:00 ★歡唱4小時 小包廂 333元 中包廂 666元 大包廂 999元',
|
||||
'color' => TextAdColors::Blue,
|
||||
],
|
||||
[
|
||||
'content' => '各分店皆適用 生日快樂!吹個蠟燭 許個心願吧 壽星們 生日開趴的通通站出來 ★當日壽星限定(須出示相關證件供服務人員確認).享有好禮雙重送 ★好禮一:生日紅酒一瓶🍷.超級巨星6吋特製蛋糕.什錦水果一盤.義式冰淇淋.莓果調酒(五選一) ★好禮二:餐飲券600元(可當日折抵使用)',
|
||||
'color' => TextAdColors::White,
|
||||
],
|
||||
];
|
||||
foreach ($ads as $ad) {
|
||||
TextAd::create([
|
||||
'content' => $ad['content'],
|
||||
'color' => $ad['color'],
|
||||
'duration' => 1,
|
||||
'is_active' => true,
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user