السلام عليكم ممكن حل مشكلة لم يتم تخزين بيانات Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException vendor\laravel\framework\src\Illuminate\Routing\AbstractRouteCollection.php:130 The POST method is not supported for route people/create. Supported methods: GET, HEAD, PUT, PATCH, DELETE.
<?php
namespaceApp\Http\Controllers;useApp\Models\People;useIlluminate\Support\Facades\DB;useApp\Models\Specialty;useApp\Models\Staffing;useApp\Models\subSection;useIlluminate\Http\Request;useIlluminate\Support\Carbon;classPeopleControllerextendsController{/**
* Display a listing of the resource.
*/publicfunction index(){}/**
* Show the form for creating a new resource.
*/publicfunction create(){
$sub_sections = subSection::whereNull('parent_id')->get();
$staffings=Staffing::all();
$specialties=Specialty::all();return view('admin.people.create',compact('sub_sections','staffings','specialties'));}/**
* Store a newly created resource in storage.
*/publicfunction store(Request $request){
DB::beginTransaction();try{
$person =newPeople();
$person->name = $request->name;
$person->N_id = $request->N_id;
$person->email = $request->email;
$person->phone = $request->phone;
$person->country = $request->country;
$person->city = $request->city;
$person->street_address = $request->street_address;
$person->gender = $request->gender;
$person->marital_status = $request->marital_status;if($request->filled('birth_date')){
$person->birth_date =Carbon::parse($request->birth_date)->toDateString();}
$person->save();
DB::commit();return redirect()->back()->with('success','تــمــت إضــافــة مــوظــف بــنــجــاح');}catch(\Exception $e){
DB::rollback();
dd($e->getMessage());// يعرض رسالة الخطأ الحقيقية}}publicfunction show(string $id){//}/**
* Show the form for editing the specified resource.
*/publicfunction edit(string $id){//}/**
* Update the specified resource in storage.
*/publicfunction update(Request $request,string $id){//}/**
* Remove the specified resource from storage.
*/publicfunction destroy(string $id){//}}
السؤال
ايمن ميلاد
السلام عليكم ممكن حل مشكلة لم يتم تخزين بيانات Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException vendor\laravel\framework\src\Illuminate\Routing\AbstractRouteCollection.php:130 The POST method is not supported for route people/create. Supported methods: GET, HEAD, PUT, PATCH, DELETE.
1 جواب على هذا السؤال
Recommended Posts
انضم إلى النقاش
يمكنك أن تنشر الآن وتسجل لاحقًا. إذا كان لديك حساب، فسجل الدخول الآن لتنشر باسم حسابك.