public function getMarkers() { $MarkerLocation = Marker_location::orderBy('id')->get(); $allUserPhotos = PhotoMapImageUploader::orderBy('photoMapId')->get(); $dataToSend = ['markers' => $MarkerLocation, 'images' => $allUserPhotos]; return Response::json($dataToSend); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $allLocations = Marker_location::all(); $allEvents = Events::orderBy('created_at', 'DESC')->get(); $allPost = Posts::orderBy('created_at', 'DESC')->get(); //getting all the post from post database table $allUserPhotos = PhotoMapImageUploader::orderBy('photoMapId')->get(); return view('admin.index', compact('allLocations', 'allEvents', 'allPost', 'allUserPhotos')); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $allPost = Posts::orderBy('created_at', 'DESC')->get(); //getting all the post from post database table $userInfo = \Auth::user(); $allEvents = Events::orderBy('created_at', 'DESC')->take(2)->get(); $allUserPhotos = PhotoMapImageUploader::orderBy('photoMapId', 'DESC')->take(6)->get(); // $postId = $allPost->id; // $TotalComments = Comments::where('on_post', '5')->count(); // dd($TotalComments); return view('home.index', compact('allPost', 'userInfo', 'allEvents', 'allUserPhotos')); }