PHP deprecation fixes, assigning null arguments in methods
This commit is contained in:
@@ -1,21 +1,21 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Add a ScopeAuthorised to an Eloquent Model
|
||||
* This will help limit the scope of accounts that a user can see.
|
||||
*/
|
||||
namespace App\Traits;
|
||||
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
use App\Models\User;
|
||||
|
||||
/**
|
||||
* Add a ScopeAuthorised to an Eloquent Model
|
||||
* This will help limit the scope of accounts that a user can see.
|
||||
*/
|
||||
trait ScopeAccountUserAuthorised
|
||||
{
|
||||
/**
|
||||
* Only query records that the user is authorised to see
|
||||
*/
|
||||
public function scopeAccountUserAuthorised($query,string $table=NULL,User $uo=NULL)
|
||||
public function scopeAccountUserAuthorised($query,?string $table=NULL,?User $uo=NULL)
|
||||
{
|
||||
if (! $uo)
|
||||
$uo = Auth::user();
|
||||
|
Reference in New Issue
Block a user