generated from theradcoza/Laravel-Docker-Dev-Template
feat: add Shift Planning module with full CRUD, attendance, and reporting
- Add shifts, shift_staff, and shift_attendance migrations - Add Shift, ShiftStaff, ShiftAttendance Eloquent models with auditing - Add ShiftService with business logic (create, start, complete, assign staff, mark attendance, reports, timesheets) - Add ShiftResource with list, create, edit, and attendance management pages - Add staff and attendance relation managers - Add standalone pages: ActiveShifts, StaffManagement, ShiftReports, Timesheets - Add dashboard widgets: ShiftOverview stats, TodaysShifts table - Add ShiftPolicy for role-based authorization - Add 10 shift permissions and manager role to RolePermissionSeeder - Update User model with shift relationships - Fix audits table migration with required columns for owen-it/laravel-auditing - Update DatabaseSeeder to create admin user and call RolePermissionSeeder - Switch docker-compose to MariaDB 10.11 for Docker Desktop compatibility
This commit is contained in:
@@ -19,6 +19,17 @@ public function run(): void
|
||||
'users.edit',
|
||||
'users.delete',
|
||||
'settings.manage',
|
||||
// Shift Management
|
||||
'shifts.view',
|
||||
'shifts.create',
|
||||
'shifts.edit',
|
||||
'shifts.delete',
|
||||
'shifts.start',
|
||||
'shifts.complete',
|
||||
'shifts.manage_roster',
|
||||
'shifts.mark_attendance',
|
||||
'shifts.view_reports',
|
||||
'shifts.generate_timesheets',
|
||||
];
|
||||
|
||||
foreach ($permissions as $permission) {
|
||||
@@ -34,6 +45,21 @@ public function run(): void
|
||||
$viewerRole = Role::create(['name' => 'viewer']);
|
||||
$viewerRole->givePermissionTo(['users.view']);
|
||||
|
||||
$managerRole = Role::create(['name' => 'manager']);
|
||||
$managerRole->givePermissionTo([
|
||||
'users.view',
|
||||
'shifts.view',
|
||||
'shifts.create',
|
||||
'shifts.edit',
|
||||
'shifts.delete',
|
||||
'shifts.start',
|
||||
'shifts.complete',
|
||||
'shifts.manage_roster',
|
||||
'shifts.mark_attendance',
|
||||
'shifts.view_reports',
|
||||
'shifts.generate_timesheets',
|
||||
]);
|
||||
|
||||
$admin = User::where('email', 'admin@example.com')->first();
|
||||
if ($admin) {
|
||||
$admin->assignRole('admin');
|
||||
|
||||
Reference in New Issue
Block a user