|
@@ -2,11 +2,6 @@
|
|
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
|
|
-use Illuminate\Contracts\View\Factory;
|
|
|
-use Illuminate\Contracts\View\View;
|
|
|
-use Illuminate\Http\Request;
|
|
|
-use Illuminate\Http\Response;
|
|
|
-use Illuminate\Notifications\Notification;
|
|
|
use Illuminate\Support\Facades\Auth;
|
|
|
|
|
|
class NotificationController extends Controller
|
|
@@ -15,7 +10,6 @@ class NotificationController extends Controller
|
|
|
public function index()
|
|
|
{
|
|
|
$notifications = Auth::user()->notifications()->paginate();
|
|
|
-
|
|
|
return view('notifications.index')->with([
|
|
|
'notifications' => $notifications
|
|
|
]);
|
|
@@ -31,4 +25,13 @@ class NotificationController extends Controller
|
|
|
'notification' => $notification
|
|
|
]);
|
|
|
}
|
|
|
+
|
|
|
+ public function readAll(){
|
|
|
+ $notifications = Auth::user()->notifications()->get();
|
|
|
+ foreach($notifications as $notification){
|
|
|
+ $notification->markAsRead();
|
|
|
+ }
|
|
|
+ return $this->index();
|
|
|
+
|
|
|
+ }
|
|
|
}
|