Download app/Http/Controllers/Dashboard/NotificationController.php from pnacorp/magicai: direct link, hf CLI and curl.
- Browser
- Download file 786 Bytes
-
https://huggingface.co/pnacorp/magicai/resolve/main/app/Http/Controllers/Dashboard/NotificationController.php
- Command line
-
hf download hf://pnacorp/magicai/app/Http/Controllers/Dashboard/NotificationController.php
-
curl -L -o NotificationController.php https://huggingface.co/pnacorp/magicai/resolve/main/app/Http/Controllers/Dashboard/NotificationController.php
786 Bytes
| namespace App\Http\Controllers\Dashboard; | |
| use App\Helpers\Classes\Helper; | |
| use App\Http\Controllers\Controller; | |
| use Illuminate\Http\Request; | |
| class NotificationController extends Controller | |
| { | |
| public function markAsRead(Request $request) | |
| { | |
| if (Helper::appIsNotDemo()) { | |
| if ($request->has('id')) { | |
| $notification = $request->user()->notifications()->where('id', $request->id)->first(); | |
| if ($notification) { | |
| $notification->markAsRead(); | |
| } | |
| return response()->json(['success' => true]); | |
| } else { | |
| $request->user()->unreadNotifications->markAsRead(); | |
| return response()->json(['success' => true]); | |
| } | |
| } | |
| } | |
| } | |