Query builder in laravel 8
Laravel query builder use PDO parameter bindings but PDO does not support binding column name. Retrieve all results form a table: $users=DB::table('users')->get(); return $users; Retrieve all result of specific column…
Http Session tutorial in laravel 8
Session :We can set the session data with two ways. i. Golbal Session helper : global ii. Via Request Instance : $request->session()->put(‘key’,’value’) Also we can get the session data using…
Http request In Laravel and the form data
All request of our new Laravel application will be handled by Laravel’s Illuminate\Http\Request class also we can retrieve the cookie, file, input that were submitted with the request. When user…
Cross-site request forgeries
When unauthorized commands performs on the behalf of authorized user is called Cross-site request forgeries. Lets test it We have a form where we are accepting a email from authenticated…
Middleware in Laravel
A means for inspecting and filtering HTTP requests coming into our application is provided by middleware. Creating a new middleware Php artisan make:middleware TestMiddleware Middleware is classified into three categories.…
Laravel Controllers
Every controller class extends Laravel’s Base Controller class. Basic Controller We can code all functional elements, as well as communicate with the model in the controller and provide data to…
How to use route in laravel 8
Except for a URI and closure, a basic Laravel route is empty. Route::get(‘/route’,function(){ Return “Something”; }) Routes for the web interface are defined in web.php And API routes are defined…
Create and Use Custom Facades in Laravel
Lets create a class called Test class Test{ public function testfunction(){ return 'testfunctioning'; } public function test2() { return 'testing2'; } } And bind the class . app()->bind('Test',function (){ return…
Laravel Facades
Getting non static function statically is called Facades. Lets set the cache like below in our web route cache()->set('name',"navid"); and get it using dd() dd(cache()->get('name')); Result : “navid” As we…
Laravel Service Providers
All services are added to service container using Service Provider. Every service of your application is provided using service provider. Lets open to bootstrap/app.php.We will see below code. $app =…