worked on ResourceExtensionController.php and added resource_extension migration
This commit is contained in:
parent
8415338120
commit
f0132bee2c
|
@ -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);
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
}
|
|
@ -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");
|
||||
|
|
Loading…
Reference in New Issue