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.
 
 

23 lines
560 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('data->business_id', $business)->get();
}
public function markAsRead($business, $notification)
{
return Auth::user()->unreadNotifications()
->where('business_id', $business)
->findOrFail($notification)
->markAsRead();
}
}