mercredi 9 mai 2018

Laravel 5.5 issue in fetching data through eloquent model

The database table is : prefix_adminUsers and I have a model in UserAdmin.php as below:

namespace App\Model;

use Illuminate\Database\Eloquent\Model;

class UserAdmin extends Model
{
    protected $table = 'adminUsers';
    public $timestamps = false;
}

When I tried to access the same by controller it show me the error:

Illuminate\Database\Eloquent\Builder Object ( [query:protected] => Illuminate\Database\Query\Builder Object ( [connection] => Illuminate\Database\MySqlConnection Object ( [pdo:protected] => PDO Object

my controller is as follows:

use App\Model\UserAdmin;
$userRecord = UserAdmin::where('id', '=', Auth::user()->id);
print_r($userRecord);



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire