M
M
marq2021-11-22 15:49:38
Laravel
marq, 2021-11-22 15:49:38

How to call a controller method from a view without creating a route in Laravel?

How can you pass their views to the desired method without creating a route on laravel?

Link:

<td><a  href="/admin_panel/users_card/{{$user->id}}" class="btn btn-primary">Просмотр</a></td>

Route:
Route::get('/verified/{id}',[\App\Http\Controllers\Admin\HomeController::class, 'verified',]);

Controller
public function verified($id){
  //$users=Admin::verified($id);
    // return redirect()->to(route('users'));
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question