adding a route to create posts
This commit is contained in:
parent
db32da3d92
commit
f3f839909e
@ -19,4 +19,9 @@ class PostController extends Controller implements HasMiddleware
|
||||
"user" => $user
|
||||
]);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
dd("Creating a post...");
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,20 @@
|
||||
|
||||
@auth
|
||||
<nav class="flex gap-2 items-center">
|
||||
<a href="{{ route('posts.create') }}"
|
||||
class="flex items-center gap-2 bg-white border p-2 text-gray-600 rounded text-sm uppercase font-bold cursor-pointer">
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
|
||||
stroke="currentColor" class="size-6">
|
||||
<path stroke-linecap="round" stroke-linejoin="round"
|
||||
d="M6.827 6.175A2.31 2.31 0 0 1 5.186 7.23c-.38.054-.757.112-1.134.175C2.999 7.58 2.25 8.507 2.25 9.574V18a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9.574c0-1.067-.75-1.994-1.802-2.169a47.865 47.865 0 0 0-1.134-.175 2.31 2.31 0 0 1-1.64-1.055l-.822-1.316a2.192 2.192 0 0 0-1.736-1.039 48.774 48.774 0 0 0-5.232 0 2.192 2.192 0 0 0-1.736 1.039l-.821 1.316Z" />
|
||||
<path stroke-linecap="round" stroke-linejoin="round"
|
||||
d="M16.5 12.75a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0ZM18.75 10.5h.008v.008h-.008V10.5Z" />
|
||||
</svg>
|
||||
|
||||
Crear
|
||||
</a>
|
||||
|
||||
<a class="font-bold text-gray-600 text-sm" href="#">
|
||||
Hello, <span class="font-normal">{{ auth()->user()->username }}</span>
|
||||
</a>
|
||||
|
@ -19,3 +19,4 @@ Route::post("/login", [LoginController::class, "store"]);
|
||||
Route::post("/logout", [LogoutController::class, "store"])->name("logout");
|
||||
|
||||
Route::get("/{user:username}", [PostController::class, "index"])->name("posts.index");
|
||||
Route::get("/posts/create", [PostController::class, "create"])->name("posts.create");
|
||||
|
Loading…
x
Reference in New Issue
Block a user