A
A
Albert19912021-02-10 13:20:51
Laravel
Albert1991, 2021-02-10 13:20:51

Is it safe in Laravel to use a class in controller method arguments to automatically detect the model?

Route::get('speakers/{speaker}', '[email protected]');

public function info(Request $request, Speaker $speaker)
{
    ...
}


Is this code safe in terms of sql injection since we don't validate the $speaker variable?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin B., 2021-02-10
@Albert1991

In no case. The developers of the framework came up with this opportunity to hack sites and extort money.
PS. relax and work, study and understanding will come by itself. For understanding, look at this PDO thing called

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question