Question

The first problem I'm running in to is that when installing I receive a mysql error stating that a table cannot be found. Of course it can't, I finished installing the dependencies much less run the migration. The error was being triggered by a Eloquent query in a view composer. After commenting out the entirety of my routes file Composer let me continue.

I proceed to uncomment out my route file - I get the error once again trying to run any artisan commands (can't migrate my database because I haven't migrated my database). Repeat the solution for step one and I've migrated my database.

Artisan serve is now serving me my layout file in the terminal and exiting. I'm at a bit of a loss to troubleshoot this. I assumed that it was possibly a plugin, trying to disable plugins one by one results in:

Script php artisan clear-compiled handling the pre-update-cmd event returned with an error

and being served up my layout file in the terminal.

It seems that the error is directly related to this function in my routes file:

View::composer('layouts.main', function($view) {
    $things = Thing::where('stuff', 1)->orderBy('stuff')->get();
    $view->with(compact('things'));
});

This isn't a new introduction to the application however so the underlying cause is coming from somewhere else.

Was it helpful?

Solution

As i said in the comment, if you are finding database errors in production server but not in local, then

  1. check database credentials. if its ok then....

  2. check the different configs in the environment.

using profilers(any) will let you know what environment you are in.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top