暫無描述
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2022_03_26_145730_create_roles_table.php 628B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. use App\Roles;
  3. use Illuminate\Database\Migrations\Migration;
  4. use Illuminate\Database\Schema\Blueprint;
  5. use Illuminate\Support\Facades\Schema;
  6. class CreateRolesTable extends Migration
  7. {
  8. /**
  9. * Run the migrations.
  10. *
  11. * @return void
  12. */
  13. public function up()
  14. {
  15. $dump = [
  16. 'name' => ['admin', 'driver', 'mitra'],
  17. ];
  18. foreach ($dump['name'] as $key => $value) {
  19. $role = new Roles;
  20. $role->name = $value;
  21. $role->guard_name = 'web';
  22. $role->save();
  23. }
  24. }
  25. public function down()
  26. {
  27. }
  28. }