Fastest Web Hosting

laravel use same form for create and edit

0 votes
asked Nov 4, 2016 in Laravel by punnet (400 points)

Am quite new to Laravel and I have to create a form for create and a form for edit. In my form I have quite some jquery ajax posts. Am wondering whether Laravel does provide for an easy way for me to use the same form for my edit and create without having to add tons of logic in my code. I don't want to check if am in edit or create mode every time when assigning values to fields when the form loads. Any ideas on how I can accomplish this with minimum coding?

1 Answer

0 votes
answered Nov 7, 2016 by anonymous
edit.blade.php :
<h1>Edit</h1>
<form action="/thing/32" method="POST">
@include('partials/form');
</form>

create.blade.php
<h1>Create</h1>
<form action="/thing/" method="POST">
@include('partials/form');
</form>

partials/form.blade.php:
<input type="text" ....>

Job Board

TechnicalSharp is a technical community of developers where they are sharing their knowledge and solutions and against it they are getting the score point which help them to make profile strong which is under eyes on MNC's
...