mercredi 1 avril 2020

can't get the data from edit function using Laravel 5.6

I created the CRUD application with Laravel 5.6. I created the resource controller to do the function. In controller (Index and Create) functions are working fine but edit function I try to echo the variables it's showing blank. I can't understand why is that. Please help to fix these issues.

Model File

<?php

namespace Asset_Management_System;

use Illuminate\Database\Eloquent\Model;

class assetType extends Model
{
    //
}

Controller File

<?php

use Illuminate\Http\Request;
use Asset_Management_System\assetType;

public function edit(assetType $AssetTypeData)
    {
        echo $AssetTypeData->id;
    }
?>

URL Path

http://127.0.0.1:8000/AssetTypes/1/edit

Route

Route::resource('AssetTypes','AssetTypeController');

When I click the edit button it's going to edit page but data is coming.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire