$results = Capsule::select(‘select * from table’); var_dump($results); Capsule::connection()->enableQueryLog(); $results = Capsule::select(‘SELECT * FROM test’); $query = Capsule::getQueryLog(); print_r($query); $results = Capsule::select(‘select * from table’); var_dump($results); Capsule::connection()->enableQueryLog(); $results = Capsule::select(‘SELECT * FROM test’); $query = Capsule::getQueryLog(); print_r($query);
Category: Laravel
Composer: proc_open(): fork failed errors
If composer shows proc_open() fork failed on some commands: PHP Fatal error: Uncaught exception ‘ErrorException’ with message ‘proc_open(): fork failed – Cannot allocate memory’ in phar This could be happening because the VPS runs out of memory and has no Swap space enabled. free -m total used free shared buffers cached Mem: 2048 357
Continue reading Composer: proc_open(): fork failed errors
Laravel 5: tinker arrow keys problem
There could be a problem using ‘php artisan tinker’ on a linux machine. In the tinker/psy shell, pressing any of the arrow keys is printing character literals to the screen rather than performing the intended behaviour (move character for left and right, cycle recent commands for up and down). The cause is that PHP REPL
Continue reading Laravel 5: tinker arrow keys problem
Basics
Applications in Laravel are namespaced. By default, this is just App – Laravel’s great, but it still can’t guess the name of your application! To set it to something more appropriate, we can use the Artisan command: php artisan app:name Furbookphp artisan app:name Furbook