app/Policies/OrderDetailsPolicy.php
/**
     * Determine whether the user can view the model.
     *
     * @param  \App\Models\User  $user
     * @param  \App\Models\Frontend\OrderDetails  $orderDetails
     * @return mixed
     */
Determine whether the user can view the model.
Determine whether the user can view the model .
public function view(User $user, OrderDetails $orderDetails)
    {
        $flag = false;
        if($user->id === $orderDetails->product->partner_id || Auth::user()->roles->where('id', 1)->first() != null){
            $flag = true;
        }
        return $flag;
    }
public function view ( User $ user , OrderDetails $ orderDetails ) { $ flag = false ; if ( $ user -> id === $ orderDetails -> product -> partner_id || Auth :: user ( ) -> roles -> where ( 'id' , 1 ) -> first ( ) != null ) { $ flag = true ; } return $ flag ; }
Determine whether the user can view the model.
Determine whether the user can view the model .