コード例 #1
0
ファイル: PageController.php プロジェクト: yohanes1989/goprop
 public function home()
 {
     $packageCategories = PackageCategory::all();
     $serviceSection = Page::where('identifier', 'home-service')->first();
     $overviewSection = Page::where('identifier', 'home-overview')->first();
     $testimonials = Testimonial::orderBy(DB::raw('RAND()'))->take(5)->get();
     return view('frontend.page.home', ['packageCategories' => $packageCategories, 'serviceSection' => $serviceSection, 'overviewSection' => $overviewSection, 'testimonials' => $testimonials]);
 }
コード例 #2
0
 public function delete(Request $request, $id)
 {
     $testimonial = Testimonial::findOrFail($id);
     $testimonial->delete();
     return redirect()->route('admin.testimonial.index')->with('messages', ['Testimonial is successfully deleted.']);
 }