Categories
Fixing Stuff Laravel Samuel

laravel email error notes

troubleshooting a couple small laravel errors. First one = “belongs-to-many” database lookup error. It was from a view trying to show old data that was missing (IE we had a data set present, then half of it was deleted and the site did not gracefully degrade to still show the view). The fix for this was to just purge the rest of the data (it happened to be test data so that was fine). Now since a user can’t input incomplete data into the view the page should be good to go.

then we had a contact form timing out a “swiftmailer” error. We had the .env file on port 465 but needed 587, and then we noticed there were a couple things hard coded in config > mail.php that were from a previous project. We updated this mail file to the correct info, and also made the needed changes in the .env file so that in the future that file can quickly override the mail.php file for ease of updating.

BadMethodCallException] This cache store does not support tagging. Laravel file and database drivers doesn’t support tags.

to fix find the cache drive in .env file and update it to:
CACHE_DRIVER=array

Categories
Laravel Samuel

simple laravel form verification

This post is simply a note of an item I did today to fix a little issue on a select form in laravel:

The issue was form verification on a select drop down box, the default value was passing the verification test since it in fact has a “Value”, solution =


update the drop down to show default wording on the front end but leave a blank value in the form field:

{{ Form::select('sales_counselor', ['' => 'Select Counselor'] + $users,

add a check to make sure the sales counselor field has a value, a check that the default value above will not pass:
'sales_counselor' => 'required|exists:users,id',

Categories
Fixing Stuff Laravel Samuel

Fixing PHP Error: Maximum function nesting level of ‘100’ reached, aborting

when copying a Laravel project from production down to my local machine today I got the following error while trying to access a specific page:

PHP Error: Maximum function nesting level of '100' reached, aborting

This was a first for me to see this, also of note I was not running this locally on wamp, I was simply serving the file with php artisan serve on windows using git bash. To fix the issue we took the following steps:

-locate the controller that powers the page generating the error (if you don’t know this off the top of your head, start back at your routes.php file). Look through the routes file unitl you find the correct controller.

-open up the controller and locate the function that is controlling the front end view (the page where your error is occurring). Next test to make sure you have the right function by adding dump and die to the top of your function:

dd($value);
*note you can also just use something like: dd('test');

-if you have the correct spot then the page will display your DD (dump and die) message. Once you confirm this then add the code below to fix the maximum function nesting error:

ini_set('xdebug.max_nesting_level', 200); //put this in here to fix local ini_set limit

That’s all there is too it. Also a side note its not a great practice to do this as a long term fix, there are probably larger issues at play that need to be addressed. But in my current case this worked perfectly and if anyone out there is running into the same issue hopefully this helps you solve it.