Added comments for easier understanding.
This commit is contained in:
parent
a9cd26075e
commit
b89c1509fe
skolehjem/database
migrations
2014_10_12_000000_create_users_table.php2014_10_12_100000_create_password_resets_table.php2019_08_19_000000_create_failed_jobs_table.php2020_06_08_080402_create_permission_tables.php2020_06_08_085447_create_washing_reservations.php2020_06_08_090042_create_calendar_dates.php2020_06_08_090108_create_calendar_events.php2020_06_08_091617_create_feedbacks.php2020_06_08_123954_create_washing_machines.php2020_06_09_081037_alter_feedbacks.php2020_06_09_081126_alter_washing_reservations.php2020_06_23_070657_create_menu_plans.php2020_06_24_064840_create_external_links.php2020_06_29_065007_create_contact.php2020_06_29_091545_create_events.php2020_06_30_065154_create_albums_table.php2020_07_01_061911_create_resource_category.php2020_07_01_062112_create_resource_extension.php2020_07_01_062544_create_resource.php2020_07_01_064330_create_resource_categories.php
seeds
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
//Migrations acts as a version control for the database allowing you to modify the app's database schema
|
||||
|
||||
//allows use of necessary libraries
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
@ -13,9 +15,10 @@ class CreateUsersTable extends Migration
|
|||
*/
|
||||
public function up()
|
||||
{
|
||||
//checks if table already exists
|
||||
if(Schema::hasTable("users"))
|
||||
return;
|
||||
|
||||
//if not, create a table with these fields
|
||||
Schema::create('users', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name_first');
|
||||
|
@ -34,6 +37,8 @@ class CreateUsersTable extends Migration
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
|
||||
//if table exists, drop table.
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('users');
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
//Migrations acts as a version control for the database allowing you to modify the app's database schema
|
||||
|
||||
//allows use of necessary libraries
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
<?php
|
||||
//Migrations acts as a version control for the database allowing you to modify the app's database schema
|
||||
|
||||
//allows use of necessary libraries
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
//Migrations acts as a version control for the database allowing you to modify the app's database schema
|
||||
|
||||
//allows use of necessary libraries
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
//Migrations acts as a version control for the database allowing you to modify the app's database schema
|
||||
|
||||
//allows use of necessary libraries
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
//Migrations acts as a version control for the database allowing you to modify the app's database schema
|
||||
|
||||
//allows use of necessary libraries
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
//Migrations acts as a version control for the database allowing you to modify the app's database schema
|
||||
|
||||
//allows use of necessary libraries
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
//Migrations acts as a version control for the database allowing you to modify the app's database schema
|
||||
|
||||
//allows use of necessary libraries
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
//Migrations acts as a version control for the database allowing you to modify the app's database schema
|
||||
|
||||
//allows use of necessary libraries
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
//Migrations acts as a version control for the database allowing you to modify the app's database schema
|
||||
|
||||
//allows use of necessary libraries
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
//Migrations acts as a version control for the database allowing you to modify the app's database schema
|
||||
|
||||
//allows use of necessary libraries
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
//Migrations acts as a version control for the database allowing you to modify the app's database schema
|
||||
|
||||
//allows use of necessary libraries
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
//Migrations acts as a version control for the database allowing you to modify the app's database schema
|
||||
|
||||
//allows use of necessary libraries
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
//Migrations acts as a version control for the database allowing you to modify the app's database schema
|
||||
|
||||
//allows use of necessary libraries
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
//Migrations acts as a version control for the database allowing you to modify the app's database schema
|
||||
|
||||
//allows use of necessary libraries
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
//Migrations acts as a version control for the database allowing you to modify the app's database schema
|
||||
|
||||
//allows use of necessary libraries
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
//Migrations acts as a version control for the database allowing you to modify the app's database schema
|
||||
|
||||
//allows use of necessary libraries
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
//Migrations acts as a version control for the database allowing you to modify the app's database schema
|
||||
|
||||
//allows use of necessary libraries
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
//Migrations acts as a version control for the database allowing you to modify the app's database schema
|
||||
|
||||
//allows use of necessary libraries
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
//Migrations acts as a version control for the database allowing you to modify the app's database schema
|
||||
|
||||
//allows use of necessary libraries
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
|
|
@ -28,7 +28,10 @@ class UserSeeder extends Seeder
|
|||
}*/
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* A user is created as the Admin with the below fields.
|
||||
* Super User or Admin. Is allowed for all permission and is not to exist in final product release but purely for testing.
|
||||
*/
|
||||
Log::debug("OPRET");
|
||||
$user = new \App\User();
|
||||
|
||||
|
@ -39,7 +42,7 @@ class UserSeeder extends Seeder
|
|||
$user->phone = 12345678;
|
||||
|
||||
|
||||
|
||||
//gives all permission to the Admin.
|
||||
foreach (\Spatie\Permission\Models\Permission::all() as $permission) {
|
||||
$user->givePermissionTo($permission);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue