When encounter access problem to an object’s property, you can Transfer object to array $obj_arr=$obj->toArray(); Access the member $Status =
Tag: PHP
Javascript Equivalent…
PHP preg_replace let phone=”+17778889999″; let p=phone.replace(/^\+1/,”); PHP isset if (typeof variable !== ‘undefined’) PHP array_pop path_arr.splice(-1,1); //note does not work
Laravel Migration
Note: when creating a table with automatically increasing id, for example: $table->increments(‘id’); The type created in a Mysql table is
MYSQLI on PHPStorm Build In Web Server
PHPStorm has a build-in web server running at default port 63342. It works fine in general browser files such as
PHP Anonymous Function
$functions = [ ‘function1’ => function ($echo) { echo $echo; } ]; or function do_echo($echo) { echo $echo; } $functions
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
Useful Laravel Tutorials
Laravel API Tutorial: How to Build and Test a RESTful API Sample code: Laravel 5.8 from scratch click here
Laravel and Netbeans
Use Netbeans with a Laravel project on Windows Install Laravel follow instructions here or if you already have composer installed
Good REST Tutorials
Step by Step Guide Creating a REST API in PHP Rest Resouce Naming Guide