/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $networks = Network::where('user_id', Auth::user()->id)->get(); $user = Auth::user(); $traps = Traps::where('user_id', $user->id)->where('status', 1)->get(); $networks->push(['name' => 'Default', 'id' => 0]); $notifications = Notifications::latest()->get(); return view('network.index')->with('traps', $traps)->with('notifications', $notifications)->with('networks', $networks); }
public function publicShow($id) { $trap = Traps::findOrFail($id); $images = Images::where('trap_id', $id)->get(); return view('home.show_trap')->with('trap', $trap)->with('images', $images); }