I\'m building a package in Laravel 4 but am getting a non-object error when attempting to access the db from which seems to be a properly instantiated object. Here\'s the setup:
Try including the DB facade as well as Eloquent...
use Illuminate\Support\Facades\DB;
use Illuminate\Database\Eloquent\Model as Eloquent;
...and then see if you have access to DB::table('chat_history')
.
(Also note that in your class, your call to use Illuminate\Database\Model;
should be Illuminate\Database\Eloquent\Model;
)