diff --git a/skolehjem/app/Http/Controllers/ResourceExtensionController.php b/skolehjem/app/Http/Controllers/ResourceExtensionController.php index e5136e2..422ecc5 100644 --- a/skolehjem/app/Http/Controllers/ResourceExtensionController.php +++ b/skolehjem/app/Http/Controllers/ResourceExtensionController.php @@ -50,9 +50,8 @@ class ResourceExtensionController extends Controller public function store(Request $request) { $requestBody = $request->validate([ - "name" => "required|unique:events|max:255", - "description" => "required|max:255", - "date" => "required" + "extension" => "unique|required|max:255", + "description" => "required|max:255" ]); $event = new ResourceExtension($requestBody); diff --git a/skolehjem/database/migrations/2020_06_30_092130_create_resource_extensions.php b/skolehjem/database/migrations/2020_06_30_092130_create_resource_extensions.php new file mode 100644 index 0000000..3f1abb5 --- /dev/null +++ b/skolehjem/database/migrations/2020_06_30_092130_create_resource_extensions.php @@ -0,0 +1,33 @@ +id(); + $table->string("extension")->unique(); + $table->text("description"); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('resource_extensions'); + } +} diff --git a/skolehjem/routes/web.php b/skolehjem/routes/web.php index ce578ac..b371e91 100644 --- a/skolehjem/routes/web.php +++ b/skolehjem/routes/web.php @@ -38,3 +38,4 @@ Route::resource("washing-machines", "WashingMachineController"); Route::resource("washing-reservations", "WashingReservationController"); Route::resource("feedbacks", "FeedbackController"); Route::resource("external-links", "ExternalLinkController"); +Route::resource("resource-extensions", "ResourceExtensionController");