Browse Source

Update ProfileController

Daniel Supernault 7 years ago
parent
commit
184097893e
1 changed files with 7 additions and 1 deletions
  1. 7 1
      app/Http/Controllers/ProfileController.php

+ 7 - 1
app/Http/Controllers/ProfileController.php

@@ -3,8 +3,14 @@
 namespace App\Http\Controllers;
 
 use Illuminate\Http\Request;
+use App\{Profile};
 
 class ProfileController extends Controller
 {
-    //
+    public function show(Request $request, $username)
+    {
+      $user = Profile::whereUsername($username)->firstOrFail();
+      $timeline = $user->statuses()->orderBy('id','desc')->paginate(10);
+      return view('profile.show', compact('user', 'timeline'));
+    }
 }