Adding a column with constant value to existing collection: $existing_col->map(function ($col) { $col[‘url’] = ‘http://your.url/here’; return $col; }); To add
Category: Laravel
Laravel Migration
Note: when creating a table with automatically increasing id, for example: $table->increments(‘id’); The type created in a Mysql table is
Laravel Test HTTP Client Calls
Get a test url from https://webhook.site/ Make sure Laravel and Guzzle are installed Go to a directory where Laravel is
Laravel Add a Column to a Table
php artisan make:migration add_colName_to_tableName –table=tableName This will create migration file under the database/migration directory Update in the generated file the
Laravel and Netbeans
Use Netbeans with a Laravel project on Windows Install Laravel follow instructions here or if you already have composer installed
Laravel Add An Unique Index To A Table
Execute the following command to create a migration file under the database directory in a Lavarel project: php artisan make:migration
Laravel Query Builder
A good article on DB::RAW Some general examples Racing condition: Breaking Laravel’s firstOrCreate using race conditions To solve this problem
Laravel Cronjobs
Reference: https://laravel.com/docs/5.8/scheduling#introduction Laravel task schedule is defined in the app/Console/Kernel.php file’s schedule method. Create a new Laravel project laravel new (project name)