My View:
<table border="1" style="text-align: left;">
<td>
<b>Firstname</b>
</td>
<td>
<b>Actions</b>
</td>
@foreach($Newslist as $News)
<tr>
<td>
</td>
<td>
<a href="/NewsEdit//EditForm"><button type="button" class="btn btn-primary">Edit</button></a>
</td>
</tr>
@endforeach
</table>
My routes/web.php:
Route::Post('NewsEdit//EditForm','NewsControllere@EditForm');
My Controller.php:
<?php
namespace App\Http\Controllers;
use App\Newsmodel;
use Illuminate\Http\Request;
class NewsControllere extends Controller
{
public function EditForm($NewsId)
{ dd(request()->all());
echo "deepakkeynes";exit();
//$Newsmodel = Newsmodel::find($NewsId);
//return view('/News')->with('News',$Newsmodel);
}
}
While clicking the edit button in the view, the following result is obtained: Result: 404 page Expected Result: The Id of the edit button along with the echo value!
Can anyone help me out? I am a newbie in laravel..!
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire