Try a composer dumpautoload to regenerate autoload.
Jan 5, 2016
3
Level 7
Seeding at production fails
I have deployed my laravel app to a shared hosting enviroment for some feedback. It has SSH and git. Things work just fine until now. Im unable to seed the database.
Running the commands
php artisan migrate:refresh
php artisan db:seed
works fine on my localhost (windows)
On the linux server however
-securelve_sh-4.1$ php artisan db:seed
[ReflectionException]
Class UsersTableSeeder does not exist
My code shouldnt be the problem (`?) but here it is. DatabaseSeeder.php
<?php
use Illuminate\Database\Seeder;
use Illuminate\Database\Eloquent\Model;
class DatabaseSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Model::unguard();
$this->call(UsersTableSeeder::class);
$this->call(TradesTableSeeder::class);
Model::reguard();
}
}
UsersTableSeeder.php
<?php
use Illuminate\Database\Seeder;
use Faker\Factory as Faker;
class UsersTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('users')->delete();
$faker = Faker::create();
foreach(range(1,10) as $index) {
DB::table('users')->insert([
'firstname' => $faker->firstName,
'lastname' => $faker->lastName,
'email' => $faker->email,
'password' => bcrypt('secret'),
]);
}
}
}
I have checked all filenames cases. And the gitignores seems to allow for the seeding stuff. How can I proceed the debugging? Any Ideas?
Level 52
1 like
Please or to participate in this conversation.