public function __construct(Truck $truck, Driver $driver, State $state) { $this->truck = $truck->where('company_id', Auth::user()->company_id)->where('account_year_id', session('account')); $this->driver = $driver->where('company_id', Auth::user()->company_id)->where('account_year_id', session('account')); $this->state = $state->where('company_id', Auth::user()->company_id)->where('account_year_id', session('account')); }
public function __construct(Driver $driver) { $this->driver = $driver->where('company_id', Auth::user()->company_id)->where('account_year_id', session('account')); }
public function search($input) { $item = Driver::where('fio', 'like', '%' . $input . '%')->orWhere('passport_number', 'like', '%' . $input . '%')->orderBy('fio', 'asc')->select('id', 'fio', 'birthday')->paginate(15); return $item; }