update
This commit is contained in:
@@ -31,6 +31,23 @@ class AlertController extends Controller
|
||||
return response()->json($this->format($alerts));
|
||||
}
|
||||
|
||||
/**
|
||||
* All alerts
|
||||
*/
|
||||
public function all(): JsonResponse
|
||||
{
|
||||
/** @var \App\Models\User */
|
||||
$user = auth()->user();
|
||||
|
||||
/** @var \Illuminate\Database\Eloquent\Builder<Alert> */
|
||||
$alerstQuery = $user->alerts();
|
||||
|
||||
/** @var Collection<array-key, Alert> */
|
||||
$alerts = $alerstQuery->get();
|
||||
|
||||
return response()->json($this->format($alerts));
|
||||
}
|
||||
|
||||
/**
|
||||
* Format
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user