File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
resources/views/components Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 1
1
<?php
2
2
use Illuminate\Database\Migrations\ Migration ;
3
+ use Illuminate\Database\Migrations\ Migrator ;
3
4
use Illuminate\Database\Schema\ Blueprint ;
4
5
use Illuminate\Support\Facades\ Schema ;
5
6
use Illuminate\Support\Facades\ DB ;
6
7
use Illuminate\Support\Facades\ File ;
8
+ use Database\Seeders\ ButtonSeeder ;
7
9
use App\Models\ Page ;
8
10
9
11
// run before finishing:
130
132
131
133
/* Updates button database entries */
132
134
Schema:: disableForeignKeyConstraints ();
133
- try {Artisan:: call (' migrate' , [' --force' => true ]);} catch (exception $e ) {}
135
+ try {
136
+ $migrator = app (' migrator' );
137
+ $migrator -> run (database_path (' migrations' ), [' --force' => true ]);
138
+ } catch (exception $e ) {}
134
139
try {DB:: table (' buttons' )-> delete ();} catch (exception $e ) {}
135
140
try {DB:: table (' buttons' )-> truncate ();} catch (exception $e ) {}
136
- try {Artisan:: call (' db:seed --class="ButtonSeeder" --force' );} catch (exception $e ) {}
141
+ try {
142
+ $seeder = new ButtonSeeder ();
143
+ $seeder -> run ();
144
+ } catch (exception $e ) {}
137
145
Schema:: enableForeignKeyConstraints ();
138
146
139
147
try {
You can’t perform that action at this time.
0 commit comments