1234567891011121314151617181920212223242526272829303132333435 |
- <?php
-
- use App\Roles;
- use Illuminate\Database\Migrations\Migration;
- use Illuminate\Database\Schema\Blueprint;
- use Illuminate\Support\Facades\Schema;
-
- class CreateRolesTable extends Migration
- {
- /**
- * Run the migrations.
- *
- * @return void
- */
- public function up()
- {
-
- $dump = [
- 'name' => ['admin', 'driver', 'mitra'],
- ];
-
- foreach ($dump['name'] as $key => $value) {
- $role = new Roles;
- $role->name = $value;
- $role->guard_name = 'web';
- $role->save();
- }
- }
-
-
- public function down()
- {
-
- }
- }
|