You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
541 B
22 lines
541 B
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Support\Facades\Auth;
|
|
|
|
class NotificationController extends Controller
|
|
{
|
|
public function index($business)
|
|
{
|
|
return Auth::user()->notifications()->where('business_id', $business)->get();
|
|
}
|
|
|
|
public function markAsRead($business, $notification)
|
|
{
|
|
return Auth::user()->unreadNotifications()
|
|
->where('business_id', $business)
|
|
->findOrFail($notification)
|
|
->markAsRead();
|
|
}
|
|
}
|