Answer the question
In order to leave comments, you need to log in
Undefined variable: user_id, what's the problem?
@if(Auth::user()->id == $user_id)
<form method="POST" action="">
<button class="btn btn-danger">Delete</button>
@csrf
@method('DELETE')
</form>
@endif
public function showUserAd($user)
{
$user = User::where('username', $user)->first();
if(empty($user)){
abort(404);
}
return redirect()->route('adShow', [$oneAd]);
}
Route::get('/{id}', '[email protected]');
Schema::create('users', function (Blueprint $table) {
$table->increments('id');
$table->string('username')->unique();
$table->string('password');
$table->timestamps();
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question