###Here is my seeder table class
class DataClassificationTableSeeder extends Seeder{
//Data Classification
public function run(){
DB::table('data_classifications')->delete();
$Datas = array(
'',
'Top Secret',
'Secret',
'Confidential',
'Restricted',
'Unclassified'
);
DataClassification::unguard();
foreach($Datas as $key => $Data){
if($key == ''){
continue;
}
else{
DataClassification::create(array(
'id' => $key,
'classification' => $Data,
));
}
}
DataClassification::reguard();
}
}
and i added following line in databaseseeder class
$this->call('DataClassificationTableSeeder');
Here is modal for this
class DataClassification extends Eloquent {
//Data Classification
protected $table = 'data_classifications';
protected $primaryKey = 'id';
public $timestamps = false;
}
all my tables get seeds but this is not seeding and also not giving any error I have to manually call this from terminal to seed then it works fine
check the table seeder that is called before this one
These are before and after all are working without any error
$this->call('SystemOwnerTableSeeder');
$this->call('SystemStewardTableSeeder');
$this->call('DataClassificationTableSeeder');
$this->call('AccessibilityTableSeeder');
$this->call('DataLocationTableSeeder');
Oops I found one of my seeder table was deleting its content f.... copy past.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community