Fixed error AND 0x01

This commit is contained in:
Sebastian Davaris 2020-06-29 14:49:57 +02:00
parent eb749e58a5
commit 988ceb7c8a
8 changed files with 36 additions and 60 deletions

View File

@ -7,6 +7,6 @@ use Illuminate\Database\Eloquent\Model;
class MenuPlan extends Model class MenuPlan extends Model
{ {
protected $fillable = [ protected $fillable = [
'monday', "tuesday", 'wednesday', 'thursday', "friday", "saturday", "sunday" 'monday', "tuesday", 'wednesday', 'thursday'
]; ];
} }

View File

@ -13,6 +13,9 @@ class CreateUsersTable extends Migration
*/ */
public function up() public function up()
{ {
if(Schema::hasTable("users"))
return;
Schema::create('users', function (Blueprint $table) { Schema::create('users', function (Blueprint $table) {
$table->id(); $table->id();
$table->string('name_first'); $table->string('name_first');

View File

@ -20,13 +20,17 @@ class CreatePermissionTables extends Migration
throw new \Exception('Error: config/permission.php not loaded. Run [php artisan config:clear] and try again.'); throw new \Exception('Error: config/permission.php not loaded. Run [php artisan config:clear] and try again.');
} }
Schema::create($tableNames['permissions'], function (Blueprint $table) { if(!Schema::hasTable("permissions"))
$table->bigIncrements('id'); {
$table->string('name'); Schema::create($tableNames['permissions'], function (Blueprint $table) {
$table->string('description'); $table->bigIncrements('id');
$table->string('guard_name'); $table->string('name');
$table->timestamps(); $table->string('description');
}); $table->string('guard_name');
$table->timestamps();
});
}
Schema::create($tableNames['roles'], function (Blueprint $table) { Schema::create($tableNames['roles'], function (Blueprint $table) {
$table->bigIncrements('id'); $table->bigIncrements('id');

View File

@ -19,9 +19,9 @@ class CreateMenuPlans extends Migration
$table->string('tuesday', 255); $table->string('tuesday', 255);
$table->string('wednesday', 255); $table->string('wednesday', 255);
$table->string('thursday', 255); $table->string('thursday', 255);
$table->string('friday', 255); // $table->string('friday', 255);
$table->string('saturday', 255); // $table->string('saturday', 255);
$table->string('sunday', 255); // $table->string('sunday', 255);
$table->timestamps(); $table->timestamps();
//$table->text('description'); //$table->text('description');
}); });

View File

@ -1,38 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateStaffTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('staff', function (Blueprint $table) {
$table->id();
$table->string('name_first');
$table->string('name_last');
$table->string('email')->unique();
$table->timestamp('email_verified_at')->nullable();
$table->string('password');
$table->integer("phone")->unique();
$table->rememberToken();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('staff');
}
}

View File

@ -61,15 +61,15 @@
<a href="{{ route("contacts.create") }}" class="text-white"><img src="{{ asset('/images/icons/plus.svg') }}" alt="Create">Opret Kontakt</a> <a href="{{ route("contacts.create") }}" class="text-white"><img src="{{ asset('/images/icons/plus.svg') }}" alt="Create">Opret Kontakt</a>
</div> </div>
</div> </div>
<div class="segment"> {{-- <div class="segment">--}}
<h3 class="text-white">Personale</h3> {{-- <h3 class="text-white">Personale</h3>--}}
<div class="row"> {{-- <div class="row">--}}
<a href="{{ route('staff.index') }}" class="text-white"><img src="{{ asset('/images/icons/eye.svg') }}" alt="Read">Vis Personale</a> {{-- <a href="{{ route('staff.index') }}" class="text-white"><img src="{{ asset('/images/icons/eye.svg') }}" alt="Read">Vis Personale</a>--}}
</div> {{-- </div>--}}
<div class="row"> {{-- <div class="row">--}}
<a href="{{ route('staff.create') }}" class="text-white"><img src="{{ asset('/images/icons/plus.svg') }}" alt="Create">Opret Personal</a> {{-- <a href="{{ route('staff.create') }}" class="text-white"><img src="{{ asset('/images/icons/plus.svg') }}" alt="Create">Opret Personal</a>--}}
</div> {{-- </div>--}}
</div> {{-- </div>--}}
<div class="segment"> <div class="segment">
<h3 class="text-white">Feedback</h3> <h3 class="text-white">Feedback</h3>
<div class="row"> <div class="row">

View File

@ -26,7 +26,14 @@
<td>{{ $user->email }}</td> <td>{{ $user->email }}</td>
<td>{{ $user->phone }}</td> <td>{{ $user->phone }}</td>
<td><a href="{{ route("users.edit", [ "user" => $user->id ]) }}"><img class="w-100" src="{{ asset('/images/icons/pencil-dark.svg') }}" alt="Update"></a></td> <td><a href="{{ route("users.edit", [ "user" => $user->id ]) }}"><img class="w-100" src="{{ asset('/images/icons/pencil-dark.svg') }}" alt="Update"></a></td>
<td><a href="{{ route("users.destroy", [ "user" => $user ]) }}"><img class="w-100" src="{{ asset('/images/icons/trashcan-dark.svg') }}" alt="Delete"></a></td> <td>
<form method="post" action="{{ route("users.destroy", [ "user" => $user ]) }}" class="w-100">
@csrf
@method("delete")
<button class="w-100"><img class="w-100" src="{{ asset('/images/icons/trashcan-dark.svg') }}" alt="Delete"></button>
</form>
</td>
</tr> </tr>
@endforeach @endforeach
</table> </table>

View File

@ -31,7 +31,7 @@ Route::get("phones", "PhoneController@index")->name("phones.index");
Route::resource("contacts", "ContactController"); Route::resource("contacts", "ContactController");
Route::resource("menu-plans", "MenuPlanController"); Route::resource("menu-plans", "MenuPlanController");
Route::resource("users", "UserController"); Route::resource("users", "UserController");
Route::resource("staff", "StaffController"); //Route::resource("staff", "StaffController");
Route::resource("events", "EventController"); Route::resource("events", "EventController");
Route::resource("washing-machines", "WashingMachineController"); Route::resource("washing-machines", "WashingMachineController");
Route::resource("washing-reservations", "WashingReservationController"); Route::resource("washing-reservations", "WashingReservationController");