laravel resource controller edit Not Working

Today, We want to share with you laravel resource controller edit Not Working.In this post we will show you laravel edit, delete show controller, hear for laravel controller update database we will give you demo and example for implement.In this post, we will learn about resource controller laravel command with an example.

laravel resource controller edit Not Working

There are the Following The simple About laravel edit route not working Full Information With Example and source code.

As I will cover this Post with live Working example to develop laravel update route, so the laravel destroy method is used for this example is following below.

Laravel is a web application framework with expressive, elegant syntax.The PHP Framework for Web Artisans,freeing you to create without sweating the small things. CRUD Operation With Server Side.

Read Also:  Laravel 6 Inserting & Updating Eloquent Models

Keywords : laravel resource controller example,laravel update method,laravel update route,laravel destroy method,laravel controller update database,resource controller laravel command,laravel edit route not working,laravel delete controller,How to create Laravel Resource Controller with resource route,route resource in laravel 5.4,simple laravel crud function with resource controller,php artisan make:controller UserController,

Laravel, Show(), Edit (), update functions not working

Example 1

public function show(Task $task)
{
    dd(['task' => $task]);
    //return back()->with('success','Message Contents Are Already Shown');
}

Example 2

public function show($id)
{
    $task = Task::findOrFail($id);
    dd(['task' => $task]);
    //return back()->with('success','Message Contents Are Already Shown');
}

Laravel edit route not defined


Route::get('products/{products}/edit', '[email protected]')->name('products-edit');

//use
{{route('products-edit', ['products' => $data->id])}}

Laravel 5.2 Route not working when using resource for CRUD operation

Route::resource('student', 'StudentController', ['names' => [
    'create' => 'student.build'
]]);

Route::resource('manager/post', 'PostController', ['except' => 'show', 'names' => [
    'store' => 'manager.post.store'
]]);

//Update
Route::group(['prefix' => 'manager', 'as' => 'manager.'], function () {
    Route::resource('post', 'PostController', ['except' => 'show']);
});

How to create Laravel Resource Controller with resource route?

Resource route

Route::resource('members', 'MemberController');

Route::get('members',['as'=>'members.index','uses'=>'[email protected]']);
Route::post('members/create',['as'=>'members.store','uses'=>'[email protected]']);
Route::get('members/edit/{id}',['as'=>'members.edit','uses'=>'[email protected]']);
Route::patch('members/{id}',['as'=>'members.update','uses'=>'[email protected]']);
Route::delete('members/{id}',['as'=>'members.destroy','uses'=>'[email protected]']);
Route::get('members/{id}',['as'=>'members.show','uses'=>'[email protected]']);

Resource Controller

php artisan make:controller MemberController --resource --model=member

app/Http/Controllers/MemberController.php

<?php
namespace App\Http\Controllers;
use App\member;
use Illuminate\Http\Request;
class MemberController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function index()
    {
        //
    }
    /**
     * Show the form for creating a new resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function create()
    {
        //
    }
    /**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
    public function store(Request $request)
    {
        //
    }
    /**
     * Display the specified resource.
     *
     * @param  \App\member  $member
     * @return \Illuminate\Http\Response
     */
    public function show(member $member)
    {
        //
    }
    /**
     * Show the form for editing the specified resource.
     *
     * @param  \App\member  $member
     * @return \Illuminate\Http\Response
     */
    public function edit(member $member)
    {
        //
    }
    /**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \App\member  $member
     * @return \Illuminate\Http\Response
     */
    public function update(Request $request, member $member)
    {
        //
    }
    /**
     * Remove the specified resource from storage.
     *
     * @param  \App\member  $member
     * @return \Illuminate\Http\Response
     */
    public function destroy(member $member)
    {
        //
    }
}

Web Programming Tutorials Example with Demo

Read :

Read Also:  Laravel 5.8 Image Resize Tutorials

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about How to create Laravel Resource Controller with resource route.
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.


Related FAQ

Here are some more FAQ related to this Article:

  1. Read Also:  HTTP Session Management Using Laravel
  2. Read Also:  Laravel Clear cache Tutorial With Example
  3. Read Also:  Laravel 6 self join table in Eloquent
  4. Read Also:  Laravel 6 Eloquent ORM Delete Example
  5. Read Also:  Laravel 6 Eloquent ORM MVC Tutorial
  6. Read Also:  Laravel 6 Set Active Navigation Menu Example
  7. Read Also:  Laravel Collection Contains with function
  8. Read Also:  how to call curl with get, post, put, delete in php?
  9. Read Also:  Laravel 6 CRUD Resource Route and Controller Tutorial
  10. Read Also:  how to create controller in laravel through cmd?