Categories
PHP / MySQL

PHP 7.4 – Null coalescing assignment operator

The null coalescing assignment operator is a shorthand for null coalescing operations. Let’s take a example code So, instead of writing the previous code, we could write the following: If the value of the left-hand parameter is null, then the value of the right-hand parameter is used.

Categories
PHP / MySQL

PHP 7.4 – Arrow functions

Arrow functions also called “short closures”. We can always access the parent scope, there’s no need for the use keyword. Here is a simple example with an arrow function. Above code we can write as show below without arrow function

Categories
Laravel

Eloquent – A better way to increment or decrements an int

Laravel has in-built increment() and decrement() functions to increase or decrease a value of the column, by 1 or with the given number. Below are the examples: That’s it – it will actually run update column + 1 under the hood. You can specify a second parameter to this function, the amount of incrementing. The […]

Categories
PHP / MySQL

PHP 7.4 – Numeric Literal Separator

PHP 7.4 allows for underscores to be used to visually separate numeric values. It looks like this: The underscores are simply ignored by the engine. i.e both are equal.

Categories
Laravel

How to Upload, download, remove Files to Amazon S3 Using Laravel

Create a controller called UploadController.php with following code. Create a view file Create a file called upload.blade.php in the resources/views directory and place below inside it. Define Routes Open your routes/web.php directory and add following route definitions to it.

Categories
Laravel

How to use Datatables in Laravel 5.8

In this tutorial, I will show you how to use the Datatables in the Laravel based project withyajra/laravel-datatables-oracle package. For this tutorial, we gonna use Laravel 5.8 version but the Datatable package usage steps will be pretty simpler with other versions of Laravel framework. As a first step lets setup a brand new Laravel project […]

Categories
PHP / MySQL

How to connect to Azure SQL Server with PHP

This article demonstrates how to use PHP to connect to an Azure SQL database. To connect to an Azure SQL or Any SQL server using PHP, you should install the required drivers based on your operating system. i.e you have to install the ODBC driver, then install the PHP Driver for SQL Server. In this post, I […]

Categories
CodeIgniter

CodeIgniter 3 – Login

In this tutorial, I will show you creating a login system using CodeIgniter. To generate decent login form design we gonna use Twitter Bootstrap styles. We need a database and a table with user details so let’s import below sample SQL into the database or you can adjust the code according to your database, table, and […]

Categories
Laravel

How to create RESTful API in Laravel 5.7

In this tutorial, I will show you creating RESTful apis using Laravel 5.7 php framework. We gonna use the Laravel’s API resources to build RESTful APIs. Laravel’s API Resource class is a way to transform data from one format to another. For example, if you have a comment model and you want to manipulate the […]

Categories
Slim Framework

How to deploy slim framework on CPanel

In this post, I would like to show you deploying your slim framework project to CPanel (without SSH access). In general, for CPanel, the web root directory will be  public_html directory.  Slim3 Framework Authorization with JWT (JSON Web Tokens)  So now move all the files from your slim project public directory to the public_html directory. […]

Categories
Laravel

Laravel Eloquent Increments and Decrements value

In this post, I would like to show you the hidden and useful functions of Laravel’s Eloquent ORM to Increment and Decrement value of the fields in the database column. In my recent project, I used increment() and decrement() methods to increase and decrease the numbers respectively. How to use increment() and decrement()

Categories
Laravel

Laravel 5.6 Socialite Bitbucket Login

In this tutorial, we’re going to explain how to integrate Bitbucket login in Laravel based application using Socialite. The Socialite is Laravel’s official package, which is making is easy to authenticate with external services with OAuth providers. Create Project Create a brand new Laravel 5.6 project with Composer create-project command: Database connection settings After creating […]

Categories
Laravel

Laravel 5.6 Socialite GitHub Login

In this tutorial, we’re going to explain how to integrate GitHub login in Laravel based application using Socialite. The Socialite is Laravel’s official package, which is making is easy to authenticate with external services with OAuth providers. Create Project Create a brand new Laravel 5.6 project with Composer create-project command: Database connection settings After creating […]

Categories
Laravel

Laravel 5.6 Socialite LinkedIn Login

In this tutorial, we’re going to explain how to integrate LinkedIn login in Laravel based application using Socialite. The Socialite is Laravel’s official package, which is making is easy to authenticate with external services with OAuth providers. Create Project Create a brand new Laravel 5.6 project with Composer create-project command: Database connection settings After creating […]

Categories
Laravel

Laravel 5.6 Socialite Google Login

In this tutorial, we’re going to explain how to integrate Google login in Laravel based application using Socialite. The Socialite is Laravel’s official package, which is making is easy to authenticate with external services with OAuth providers. Create Project Create a brand new Laravel 5.6 project with Composer create-project command: Database connection settings After creating […]