database/seeds/DocumentTypesTableSeeder.php
/**
     * Run the database seeds.
     *
     * @return void
     */
Run the database seeds.
@return void
Run the database seeds . @return void
public function run()
    {
        DB::table( 'document_types' )->truncate();
        $types = [
            [
                'name' => 'Vendors Supporting Documents',
                'description' => 'These are the documents vendors upload during registration. This type should never be deleted.'
            ],
            [
                'name' => 'Proposal Document',
                'description' => 'Document submitted by xyz for xyz purpose'
            ],
            [
                'name' => 'Others',
                'description' => 'Other types of documents'                
            ]
        ];
        foreach ($types as $type) {
            $documentFormat = new DocumentType($type);
            $documentFormat->save();
        };
    }
public function run ( ) { DB :: table ( 'document_types' ) -> truncate ( ) ; $ types = [ [ 'name' => 'Vendors Supporting Documents' , 'description' => 'These are the documents vendors upload during registration. This type should never be deleted.' ] , [ 'name' => 'Proposal Document' , 'description' => 'Document submitted by xyz for xyz purpose' ] , [ 'name' => 'Others' , 'description' => 'Other types of documents' ] ] ; foreach ( $ types as $ type ) { $ documentFormat = new DocumentType ( $ type ) ; $ documentFormat -> save ( ) ; } ; }
Run the database seeds.
Run the database seeds .
// Disable Foreign key check for this connection before running seeder //DB::statement('SET FOREIGN_KEY_CHECKS=0;'); //create document types // enable Foreign key check  //DB::statement('SET FOREIGN_KEY_CHECKS=1;');