Merge branch 'master' of https://github.com/sebathefox/skolehjem-webapp
This commit is contained in:
commit
8cfca540f4
|
@ -7,7 +7,7 @@ use Illuminate\Http\Response;
|
|||
use App\Contact;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use phpDocumentor\Reflection\Types\Context;
|
||||
//hello
|
||||
|
||||
class ContactController extends Controller
|
||||
{
|
||||
public function __construct()
|
||||
|
|
|
@ -286,7 +286,7 @@ class UserController extends Controller
|
|||
"<th style=\"width: 1em;\"><img class=\"w-100\" src=\"http://127.0.0.1:8000/images/icons/pencil.svg\" alt=\"Update\"></th>".
|
||||
"<th style=\"width: 1em;\"><img class=\"w-100\" src=\"http://127.0.0.1:8000/images/icons/trashcan.svg\" alt=\"Delete\"></th>".
|
||||
"</tr>";
|
||||
$users = DB::table('users')->where('name_first', 'LIKE',$request->search.'%')
|
||||
$users = User::query()->where('name_first', 'LIKE',$request->search.'%')
|
||||
->orWhere('name_last','LIKE', $request->search.'%')
|
||||
->orWhere('phone','LIKE', $request->search.'%')
|
||||
->orWhere('email','LIKE',$request->search. '%')->get();
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class UserEvent extends Model
|
||||
{
|
||||
//
|
||||
}
|
|
@ -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;
|
||||
|
@ -13,13 +15,13 @@ class CreateResourceCategories extends Migration
|
|||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('resource_categories', function (Blueprint $table) {
|
||||
/*Schema::create('resource_categories', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string("name")->unique();
|
||||
$table->text("description");
|
||||
$table->string("slug")->unique();
|
||||
$table->timestamps();
|
||||
});
|
||||
});*/
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateUserEventsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('user_events', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->integer("user_id")->unique();
|
||||
$table->integer("event_id")->unique();
|
||||
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign("user_id")->references("id")->on("users");
|
||||
$table->foreign("event_id")->references("id")->on("events");
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('user_events');
|
||||
}
|
||||
}
|
|
@ -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