Support the ongoing development of Laravel.io →
Database Eloquent Configuration

My directory structure is CBridge->app->Models->Companies

In companies.php I have below code

<?php 

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

// Model for Companies Table

class Companies extends Model 
{
    protected $connection = 'mysql';
    protected $table = 'Companies';
    protected $primaryKey = 'CompanyId';
    public $timestamps = false;
    public $incrementing = false;
    protected $fillable = array(
	    		'CompanyName',
	    		'CompanyDomain'
	    );

public function __construct()
{
}

}

In my cmd I am at CBridge directory. CBridge> Php artisan tinker

App\Models\Companies\Companies:all();

Above command gives me error. not found in eval()' d code on line 1.

Please help. My table name in Companies.

Weird: Sometimes the command mentioned above starts working and sometimes it starts showing above error. Very confused.
Last updated 3 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.