I have the following criteria:
public function apply( $model , RepositoryInterface $repository )
{
if ( !Auth::user()->can( 'view_all_customers' ) ) {
$model->where( 'customer_id' , 'IN',Auth::user()->customersArr() );
}
return $model;
}
This is correct, why does it work when I pass the orgerBy parameter in the url. but when I do not pass, it simply ignores my criteria.
Does anyone know what can it be?
I have the following criteria: public function apply( $model , RepositoryInterface $repository ) { if ( !Auth::user()->can( 'view_all_customers' ) ) { $model->where( 'customer_id' , 'IN',Auth::user()->customersArr() ); }
This is correct, why does it work when I pass the orgerBy parameter in the url. but when I do not pass, it simply ignores my criteria. Does anyone know what can it be?