Ledger Nano X - The secure hardware wallet
SHARE
TWEET

Untitled

a guest Mar 28th, 2020 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. namespace App\Http\Controllers;
  4.  
  5. use Illuminate\Http\Request;
  6. use App\Http\Requests;
  7. use App\User;
  8. use App\Post;
  9. use App\Category;
  10. use Mail;
  11. use Session;
  12.  
  13. class PostsController extends Controller {
  14.  
  15.     public function getIndex() {
  16.     $posts = Post::orderBy('created_at', 'desc')->paginate(5);
  17.         return view('front.posts.index')->withPosts($posts);
  18.     }
  19.    
  20.     /**
  21.      * Display the specified resource.
  22.      *
  23.      * @param  int  $id
  24.      * @return \Illuminate\Http\Response
  25.      */
  26.     public function show($id, $slug = '')
  27.     {
  28.         $post = Post::findOrFail($id);
  29.  
  30.         if ($slug !== $post->slug) {
  31.             return redirect()->to($post->slug, 301);
  32.         }
  33.  
  34.         return view('front.posts.show')->withPost($post);
  35.     }
  36.  
  37. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top