Explorar el Código

Update ProfileController

Daniel Supernault hace 7 años
padre
commit
184097893e
Se han modificado 1 ficheros con 7 adiciones y 1 borrados
  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'));
+    }
 }