Raw SQL Queries

Raw SQL Queries: Laravel interact with databases by the variety of database back-ends with raw SQL, the fluent query builder, and the Eloquent ORM. Laravel supports four types of databases: MySQLPostgreSQLSQLiteSQL Server Configuration The database configuration of...

Laravel Validation

Laravel provides a different way to validate the applications incoming data. Laravel base controller class uses a ValidatesRequests that provides an easy method to validate incoming HTTP request with many powerful validation rules. Defining the Routes The following...

Laravel Authentication

Authentication is a process of identifying user credentials. Laravel makes implementing authentication very simple. The authentication configuration file is located at config/auth.php that contains various documented options for adjusting the behavior of the...

Laravel Uploading Files

Retrieving Uploaded Files We can access files from an Illuminate\Http\Request. By using the file method or using the dynamic properties. The file method returns an instance of the Illuminate\Http\UploadedFile class that extends the PHP SplFileInfo class. It provides a...

Database Migrations

Database Migrations in Laravel Introduction Migrations are version control for our database. It allows our team to modify and share the applications database. Migrations are paired with schema builder to build an applications database schema quickly. The Laravel...

Laravel Forms

CSRF Field For defining an HTML form in our application, we should include a hidden CSRF token field in the form, so that the CSRF protection middleware can validate the request. We use the @csrf Blade directive to generate the token field: <form method= "POST"...

Laravel Displaying Data

Display data that is passed to our Blade views by enclosing the variable in curly braces. The following route is given below: Route::get('greeting', function () { return view('welcome', ['name' => 'rafia']); }); 12345  Route::get('greeting', function ()...

Laravel Control Statements

Blade also provides convenient shortcuts for common control structure in PHP, such as conditional statements and loops. These shortcuts provide a very clean working with PHP structures, while also remain familiar to its PHP counterparts. If Statements         We...

Pin It on Pinterest