πŸ”ͺ

Blade Template

Blade is a template engine for laravel which uses simple method to write php functions and code in the page without using the <?php ?> tags.
For rendering the param you can use like
<h1> Hi ,{{$name}}</h1> // Conditional statements @if($i==0) <h1>The value is {{$i}}</h1> @endif // for loop @for($i=0;$i<6;$i++) <h1>{{$i+1}} iterations</h1> @endfor //foreach loop @foreach($result as $row) <h1>These are the row value :{{$row}}</h1> @endforeach
Β 

PHP code inside js

notion image
we can simply use the variable name inside @json(variable_name_php) and it will be read in js.
Β 

Get and Post ( CSRF)

so to making a form in laravel doesn’t take much time as just we need to create a view and a controller part for the form.
View is for the front-end part and controller is to receive and process the data
notion image
so in the above image we are using two type of request on diffrent protcols . First one is a controller for post protocol and second one is the normal view page
In the front-end if you are creating a form make sure to include the CSRF token to that otherwise it will five 419 page expiry error
notion image