Supervisor start stop all button
This commit is contained in:
1 parent
66e064257a
commit
3e06aad008
2 files changed
+36
-1
No files matched your search
@@ -0,0 +1,27 @@
|
||||
<?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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user