Database How to use Query builder with eloquent in laravel 8 February 4, 2022 Navid Anjum Building Query: Eloquent models are query builder as well .So we can do everything in eloquent which is possible with query builder. $house=house::where('id',1) ->orderBy('id') ->take(1) ->get(); dd($house); Collection: The Laravel…
Database Learning Eloquent with Laravel 8 January 29, 2022 Navid Anjum Eloquent is an ORM(object relational model) used to interact with database by providing a model for each database table. Creating model: php artisan make:model owner -mc php artisan make:model house…
Database Query builder in laravel 8 January 18, 2022 Navid Anjum 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…
General Topic Laravel Http Session tutorial in laravel 8 December 31, 2021 Navid Anjum 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…
General Topic Laravel Http request In Laravel and the form data December 16, 2021 Navid Anjum 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…
CSRF General Topic Laravel Cross-site request forgeries December 11, 2021 Navid Anjum 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…
General Topic Laravel Middleware Middleware in Laravel December 7, 2021 Navid Anjum 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.…
Controller General Topic Laravel Laravel Controllers December 3, 2021 Navid Anjum 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…
General Topic How to use route in laravel 8 December 2, 2021 Navid Anjum 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…
Laravel Our Own Facades Create and Use Custom Facades in Laravel November 30, 2021 Navid Anjum 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…