diff --git a/skolehjem/app/Contact.php b/skolehjem/app/Contact.php index 4aebacc..3c7d017 100644 --- a/skolehjem/app/Contact.php +++ b/skolehjem/app/Contact.php @@ -15,6 +15,6 @@ class Contact extends Model { //protected variable which contains name of database field(s) to be filled. protected $fillable = [ - 'name_first', "name_last", 'email', 'phone' + 'contactname', "title", 'email', 'phone' ]; } diff --git a/skolehjem/app/Http/Controllers/ContactController.php b/skolehjem/app/Http/Controllers/ContactController.php index 7abfc08..96487ee 100644 --- a/skolehjem/app/Http/Controllers/ContactController.php +++ b/skolehjem/app/Http/Controllers/ContactController.php @@ -53,8 +53,8 @@ class ContactController extends Controller public function store(Request $request) { $requestContact = $request->validate([ - "name_first" => "required|max:255", - "name_last" => "required|max:255", + "contactname" => "required|max:255", + "title" => "required|max:255", "email" => "required|max:255", "phone" => "required|max:255", ]); diff --git a/skolehjem/database/migrations/2020_06_29_065007_create_contact.php b/skolehjem/database/migrations/2020_06_29_065007_create_contact.php index 233c7e3..0c01880 100644 --- a/skolehjem/database/migrations/2020_06_29_065007_create_contact.php +++ b/skolehjem/database/migrations/2020_06_29_065007_create_contact.php @@ -16,8 +16,8 @@ class CreateContact extends Migration Schema::create('contacts', function (Blueprint $table) { $table->id(); $table->timestamps(); - $table->string('name_first', 255); - $table->string('name_last', 255); + $table->string('contactname', 255); + $table->string('title', 255); $table->string('email', 255); $table->integer('phone'); //$table->unique('email'); diff --git a/skolehjem/resources/views/admin/contacts/create.blade.php b/skolehjem/resources/views/admin/contacts/create.blade.php index f9f485e..c64fefd 100644 --- a/skolehjem/resources/views/admin/contacts/create.blade.php +++ b/skolehjem/resources/views/admin/contacts/create.blade.php @@ -13,10 +13,10 @@

Opret Kontakt:

@csrf - - - - + + + + diff --git a/skolehjem/resources/views/admin/contacts/edit.blade.php b/skolehjem/resources/views/admin/contacts/edit.blade.php index 5167abf..a11e652 100644 --- a/skolehjem/resources/views/admin/contacts/edit.blade.php +++ b/skolehjem/resources/views/admin/contacts/edit.blade.php @@ -14,10 +14,10 @@ $contact]) }}"> @csrf @method("put") - - - - + + + + diff --git a/skolehjem/resources/views/admin/contacts/index.blade.php b/skolehjem/resources/views/admin/contacts/index.blade.php index f180b26..d681ea9 100644 --- a/skolehjem/resources/views/admin/contacts/index.blade.php +++ b/skolehjem/resources/views/admin/contacts/index.blade.php @@ -24,8 +24,8 @@ @foreach($contacts as $contact) - {{ $contact->name_first }} - {{ $contact->name_last }} + {{ $contact->contactname }} + {{ $contact->title }} {{ $contact->email }} {{ $contact->phone }} $contact ]) }}">Update diff --git a/skolehjem/resources/views/admin/users/edit.blade.php b/skolehjem/resources/views/admin/users/edit.blade.php index af0348c..4fc653d 100644 --- a/skolehjem/resources/views/admin/users/edit.blade.php +++ b/skolehjem/resources/views/admin/users/edit.blade.php @@ -20,19 +20,34 @@ - - - - + + + + - +