worked on ResourceExtensionController.php and added resource_extension migration

This commit is contained in:
Vedde 2020-06-30 11:27:39 +02:00
parent 8415338120
commit f0132bee2c
3 changed files with 36 additions and 3 deletions

View File

@ -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);

View File

@ -0,0 +1,33 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateResourceExtensions extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('resource_extensions', function (Blueprint $table) {
$table->id();
$table->string("extension")->unique();
$table->text("description");
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('resource_extensions');
}
}

View File

@ -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");