Ivan Vulović
Ivan Vulović

Reputation: 2214

Error while running models in Lumen

This is my Report model

namespace App;
use Illuminate\Database\Eloquent\Model;

class Report extends Model
{

    protected $fillable = ['ApiKey', 'Success', 'Error', 'Token', 'Password'];

    protected $hidden = ['Token'];

}

And in my controller i have this:

namespace App\Http\Controllers;
use Illuminate\Database\Schema\Blueprint;  

use App\Report;

I don't get any error, absolutely nothing happens, but I tested it with running die() command through code, and program stops in $report = new Report

On my home computer XAMPP, this code work, but it won't on remote server.

This is not only for this model, its for all models in code.

I have Apache, Ubuntu, PHP 5.5 with Lumen

Upvotes: 0

Views: 199

Answers (1)

baao
baao

Reputation: 73231

As discussed in the comments above the user is wrong and lumen can't access the model files due to missing permissions. You should change the user to www-data and set 775 permissions on the application's folder:

sudo chown -R www-data:www-data <path/to/application>
sudo chmod -R 775 <path/to/application>

Upvotes: 1

Related Questions