- Add Task model with subtasks, priorities, status transitions, dates, hours - Add Comment polymorphic model for tasks/issues/projects - Livewire components: TaskManager (list+filters), TaskForm (modal), TaskDetail, TaskKanban (drag&drop), TaskCalendar (FullCalendar) - TaskPolicy with permissions (view/create/edit/delete/assign/manage all) - Notifications: assigned, status change, overdue, comment added - Daily overdue notification job scheduled - Dashboard widget unifies IssueTask + Task - i18n: en/es/fr/ru (393 keys each) - Routes, navigation, offline sync support - 101 tests passing, Pint compliant on new files
40 lines
980 B
PHP
40 lines
980 B
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use App\Models\Task;
|
|
use App\Policies\TaskPolicy;
|
|
use Illuminate\Support\Facades\Gate;
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
class AppServiceProvider extends ServiceProvider
|
|
{
|
|
/**
|
|
* Register any application services.
|
|
*/
|
|
public function register(): void
|
|
{
|
|
//
|
|
}
|
|
|
|
/**
|
|
* Bootstrap any application services.
|
|
*/
|
|
public function boot(): void
|
|
{
|
|
// Register policies
|
|
Gate::policy(Task::class, TaskPolicy::class);
|
|
|
|
// Super-admin bypass: anyone with the "manage all" permission
|
|
// (the Admin role has it) passes every authorization check.
|
|
// Return true to allow, or null to let normal checks run — never false.
|
|
Gate::before(function ($user, $ability) {
|
|
try {
|
|
return $user->hasPermissionTo('manage all') ? true : null;
|
|
} catch (\Throwable $e) {
|
|
return null;
|
|
}
|
|
});
|
|
}
|
|
}
|