Answer the question
In order to leave comments, you need to log in
How to make one page for adding\editing work?
Hi all! Tell me please. I am writing an admin. I want to make one page for adding/editing work. How to implement? It's just that in fact it will be the same page, only on the edit page the data from the database will already be displayed in the fields, and on the add page the same fields, only empty. So. How to do it better? Share your ideas, I will be grateful!
For example, I will have a general /new-work page to add. And for editing, you will need to follow the link by adding an id, such as /new-work-355. So, you need to somehow check something, if the URL = the second option, then display data from the database, but if the first one, then do not display anything.
Answer the question
In order to leave comments, you need to log in
LARAVEL
{{ old('name') ? old('name') : (isset($edit->name) ? $edit->name : '') }}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question