Laravel 8 tutorial in Hindi - What is middleware
HTML-код
- Опубликовано: 12 сен 2020
- in this laravel 8 hindi video tutorial, how to apply validation on HTML form and show error message Laravel 8ther version. This video is made by anil Sidhu in the Hindi language
steps of video
What is Middleware
Middleware Type
Make Middleware
Apply Middleware
Interview Question
Laravel 9 tutorial in Hindi
I think you forgot to include this video into your laravel playlist
Thanx for sharing your knowledge 🙂
Its great Sir.
sir whenever I visit your channel I search laravel 8 tutorial in hindi playlist on your channel playlist but every time not found this
So, I have to search it on youtube's search bar, Please sir add this list to channel playlist so more and more student visit directly through you channel and access the series.
Yes, we use middleware in controller
Step 1: in controller you create constructor like and apply middleware :-
public function __construct()
{
// Assign to ALL methods in this Controller
$this->middleware('auth');
// Assign only to ONE method in this Controller
$this->middleware('auth')->only('create');
// Assign only to specific methods in this Controller
$this->middleware('auth')->only(['create', 'store']);
// Assign to all EXCEPT specific methods in this Controller
$this->middleware('auth')->except('index');
}
its not working
A CSRF token is a secure random token (e.g., synchronizer token or challenge token) that is used to prevent CSRF attacks. The token needs to be unique per user session and should be of large random value to make it difficult to guess. A CSRF secure application assigns a unique CSRF token for every user session.
middleware kyu use kare sir ya restriction wale kam tho ham controller par bhi kar sakta hai na?
You forgot to add this video to playlist of laravel
Very good
Route pe middleware ko use korke hum controller ke upor apply kor sakte hai.
Sir kindly make a video on reset password
sir iska javab aphi batade...
ya to iske uper bhi ek video banadijiye
how to use middleware in controller
Sir react me middleware ki video he kya muje mil nhi rhi
China after watching this: mujhe kyu toda 🤣
How is your code not going into infinite loop?
As we added the checkAge middleware globally it should also check age for /noaccess route since there is no age passed to /noaccess router redirect in the middle it goes into a infinite loop in my code.
What's the solution to it and how your code works perfectly?
Thank you.
Ok, I missed out on checking if the $request object has the age property or not on this line
$request->age && $request->age < 18
I was only checking if age is lesser than 18.
if age is =18 or > 18 then how to redirect it to desired page for example i want to move user on form page ?
you can just write else part and put the file name in redirect
When check age Zero and blank. Welcome page show any solution???
you will have to handle the data using redirect or view method when age is 0 . since in video he specified only one condition of < 18
the question you have ask please give the answer
agar hum sirf
$request->age$request->age && $request->age
because you are not declaring request variable first
I think vo infinity loop me chala ja raha hai, Vo noaccess page par bhi condition check kar raha hai.
I think you made mistake here
if($request->age && $request->age < 18 ){
return redirect('noacccess');
}
return $next($request);
If it's not working for you, you need to write this way ?age=10