Month: December 2017

20 Dec

Install Laravel on Ubuntu with XAMPP

The steps to install Laravel on Ubuntu with XAMPP are.

Step 1:
Install composer using the below command.
sudo curl -s | /opt/lampp/bin/php

Step 2:
Create a soft link
sudo ln -s /opt/lampp/bin/php /usr/local/bin/php

Step 3:
Move the composer.phar to the bin folder by using the below command.
mv composer.phar /usr/local/bin/composer

Step 4:
Run the below command to install the Laravel.
composer global require "laravel/installer"

Step 5:
Create a Laravel project.
/home/username/.config/composer/vendor/bin/laravel new test_1

Step 6:
Go to the project folder
cd /home/username/test_1

Step 7:
Start the Laravel app.
/opt/lampp/bin/php artisan serve

You will get response as
Laravel development server started:

11 Dec

How to get WHMCS date format?

To know the date format is set in the WHMCS, we can use the below query.

$date_format =  Capsule::table('tblconfiguration')
              ->where('setting', '=', 'DateFormat')

Some of the example date formats are MM-DD-YYYY, MM/DD/YYYY, DD-MM-YYYY etc.

We can convert that to the classical d m Y format by using the below code.

            $date_format = str_replace("DD", "d", $date_format);
            $date_format = str_replace("MM", "m", $date_format);
            $date_format = str_replace("YYYY", "Y", $date_format);