Skip to content

Tag: laravel

Laravel 5.1 – Checking a Database Connection

I am trying to check if a database is connected in Laravel. I’ve looked around the documentation and can’t find anything. The closest thing I’ve found is this, but this doesn’t solve my problem. I have three instances of MySQL that are set up on different machines. Below is a simplifie…

Laravel `array_pluck` on any key

Is possible use something like array_pluck($array, ‘users.*.id’)? Imagine that I have: And I want get [1, 2, 3]. I tried something like: users.*.id, users.id and users..id, but nothing worked. Answer From Laravel 5.7, you may use the Arr::pluck() helper. Use array_pluck($array[‘users’]…

Laravel 5 Send Errors to Email

I am trying to figure out how I can send errors to my email in Laravel 5. I haven’t had much luck finding any good resources. There used to be good packages like: https://github.com/TheMonkeys/laravel-error-emailer That did this for you in Laravel 4. They have yet to release a Laravel5 update because of…