public function __construct(FreightPrice $freightprice, Truck $truck, Party $party, Station $station) { $this->truck = $truck->where('company_id', Auth::user()->company_id)->where('account_year_id', session('account')); $this->party = $party->where('company_id', Auth::user()->company_id)->where('account_year_id', session('account')); $this->station = $station->where('company_id', Auth::user()->company_id)->where('account_year_id', session('account')); $this->freightprice = $freightprice->where('company_id', Auth::user()->company_id)->where('account_year_id', session('account')); }
/** * Display a listing of the resource. * * @return Response */ public function index() { $currentUser = Auth::user(); $stations = Station::where('email', $currentUser->getEmail())->get(); return Response::json(array('stations' => $stations)); }
public function __construct(Station $station, State $state, District $district) { $this->station = $station->where('company_id', Auth::user()->company_id)->where('account_year_id', session('account')); $this->district = $district->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')); }