コード例 #1
0
 /**
  * show all the classifieds (no search function)
  *
  * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
  */
 public function showList()
 {
     $categories = ClassifiedCategory::orderBy('id')->get();
     $sub_categories = ClassifiedSubcategory::orderBy('name')->get();
     $provinces = DB::table('provinces')->orderBy('name')->get();
     $cities = DB::table('cities')->orderBy('name')->get();
     $list = Classified::all()->sortBy(['category_id', 'created_at']);
     return view('classifieds.classified_list', compact('list', 'categories', 'sub_categories', 'provinces', 'cities'));
 }
コード例 #2
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     //
     $classifieds = Classified::all();
     return view('index', compact('classifieds'));
 }