#4-public-user-profile
This commit is contained in:
21
app/Http/Controllers/AuthorController.php
Normal file
21
app/Http/Controllers/AuthorController.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class AuthorController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display the author's public profile.
|
||||
*/
|
||||
public function show(User $user): View
|
||||
{
|
||||
$user->load('roles:id,name');
|
||||
|
||||
return view('author.show', [
|
||||
'author' => $user,
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user