I am trying to use this package:
https://github.com/VentureCraft/revisionable
But I get:
Fatal error: Class 'Auth' not found in /var/www/html/selection/vendor/venturecraft/revisionable/src/Venturecraft/Revisionable/RevisionableTrait.php
and the same for DB.
In the code he uses \
\DB::table($revision->getTable())->insert($revisions);
If I add a use to the Facade and ditch the \ it works.
Why is this happening and is there a way to fix it, without modifying the package?
Further Information.
The problem is happening in this trait:
I am trying to use in my model , as described in the instructions:
class Record extends Model
{
use \Venturecraft\Revisionable\RevisionableTrait;
I guess the problem is that \DB isn't working. Should it work without a use?
Here is my Model:
namespace App;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Venturecraft\Revisionable\RevisionableTrait;
//use Venturecraft\Revisionable\RevisionableTrait;
class Record extends Model
{
use RevisionableTrait;
use SoftDeletes;
//make these instances of Carbon
protected $dates = [
'created_at',
'updated_at',
'deleted_at',
'date_selected'
];
/**
* Fillable fields
*
* @var array
*/
protected $fillable = array('product_id', 'best', 'seconds', 'pitched', 'area_id', 'user_id', 'date_selected','selector_id');
public static function boot()
{
parent::boot();
}
}
Just as a test, I tried to use \DB in my controller and I get: Class 'DB' not found in 255 Should this work?
Working now, my app.php was corrupt. :-(