28 lines
600 B
PHP
28 lines
600 B
PHP
<?php
|
|
|
|
namespace App\Actions;
|
|
|
|
use App\Models\Supervisor;
|
|
use Filament\Notifications\Notification;
|
|
|
|
class SupervisorStatus
|
|
{
|
|
public static function set($status = 0)
|
|
{
|
|
Supervisor::query()->update(['is_active' => $status]);
|
|
|
|
if ($status) {
|
|
|
|
Notification::make()
|
|
->title('All supervisors started successfully')
|
|
->success()
|
|
->send();
|
|
} else {
|
|
Notification::make()
|
|
->title('All supervisors stopped successfully')
|
|
->success()
|
|
->send();
|
|
}
|
|
}
|
|
}
|