Added comments for easier understanding.
This commit is contained in:
parent
a9cd26075e
commit
b89c1509fe
|
@ -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