public function index() { // show all $records = Company::with($this->related)->get(); return $records; }
public function lists() { return Company::with('user')->get(); }
public function emails($id = null) { if (!$id) { $company = []; } else { $company = Company::with($this->related)->where('id', $id)->first(); } return view('companies.emails', compact('company')); }
public function show($id) { //show single $record = Company::with($this->related)->findOrFail($id); return $record; }