1 2 |
// run this command * * * * * php /path/to/artisan schedule:run >> /dev/null 2>&1 |
Category Laravel
laravel-cors package that allows you to send Cross-Origin Resource Sharing headers with Laravel middleware configuration.
1 |
composer require barryvdh/laravel-cors |
Add These Two line
1 2 |
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); |
in Laravel open vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php
and change this
1 2 |
$conf[CURLOPT_SSL_VERIFYHOST] = 2; $conf[CURLOPT_SSL_VERIFYPEER] = true; |
to
1 2 |
$conf[CURLOPT_SSL_VERIFYHOST] = 0; $conf[CURLOPT_SSL_VERIFYPE... |
1. Add a new folder inside the app folder on the Laravel project folder that we created. For example, I created a folder named CustomClass
2. Add a new file in the CustomClass folder with the name record_log.php
3. Fill in the following class code in the record_log.php file
1. New package directory
Create a directory with a name of the package. I will call it laravel-log-enhancer
.
1 |
mkdir laravel-log-enhancer && cd laravel-log-enhancer |
2. composer.json
Every package starts with a composer.json
file. Let’s create it. The easiest way to create it is to fire the init
command.
1 |
composer init |
Or you can just copy it from this stub and make changes accordingly.
Step 1
Go to config/database.php and update like this
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
'mysql_2' => [ 'driver' => 'mysql', 'host' => env('DB_HOST', '127.0.0.1'), 'port... |
Step 1
Go to config/database.php and update like this
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
'mysql_2' => [ 'driver' => 'mysql', 'host' => env('DB_HOST_2', '127.0.0.1'), ... |

1 step: Create Laravel 5 Project
1 |
composer create-project laravel/laravel l5swagger |
2 step: Install Swagger Package
1 |
composer require darkaonline/l5-swagger |
Or you can install specific verion
1 |
composer require "darkaonline/l5-swagger:5.8.*" |
For use of @SWG annotation we are going to install the following package
1 |
Directly run in sql
1 2 3 4 5 6 7 |
CREATE FUNCTION grade (grade_point INT) RETURNS VARCHAR(15) RETURN CASE WHEN grade_point >= 90 THEN "EXCELLENT" WHEN grade_point >= 80 THEN "GOOD" END |
Then use like
1 |
select grade (79) |