I’m new to Laravel and I’m trying to store a form. I created the view with the House controller but now I want to store the data in the view with the Booking controller. But when I click the button nothing happens. My question is if it is possible to make a view with one controller and store it with
Tag: controller
Do all API responses need to explicitly be returned with a json function?
I’m getting into api controllers and am wondering if this index function: inside my api controller has to be returned with response()->json() or if it is OK to just return the variable: Both seem to work. Are there reasons to use the former one? Answer the return $data will just convert the $data into a json response. no header will
Uploading image from input field and still getting validation error saying that field is required
Route Code: The Form I’m Using to Upload the File: Controller Code: Request file validation: The error I get when trying to save after selecting an Image: Trying to figure out what I’ve done wrong for hours and am so frustrated right now, please help me to resolve this issue. Thanks in advance. Answer Field in form is named gallery_img
Laravel : get only the clicked image to display, and not all of them
Yo everyone! I’m actually working on a lil’ project to learn laravel and here is the thing I struggle to achieve : I want the image I click on to be displayed in a view, but not all of my images (my images are stored in a database). I think the code is pretty simple, I’ll share it with you
Yii2: Controller action parameters with a dash?
If I have a URL like https://example.com/controller/action?customer-id=7414 how do I get customer-id in my action parameters? Since a dash is not allowed in variables names I cannot do the following! Documentation is usually excellent but on this exact point it’s just silent. How do I solve this? Answer When yiiwebController calls action it only binds parameters which names match exactly.
how to hide results from database until the seacrh is complete in Laravel?
i am making a search for the website so the user can search for results from database everything is working fine but how can i hide results until the user complete the search? this is the controller: and here is the view: so my problem is the view is showing all the results before the user search and i want
How to send multiple variable from blade to controller
i want to send ‘from’ and ‘to’ to controller from blade. how to write that in the tag. the necessary code is mentioned above. Thanks for your help in advance. Answer this is the method to send data in controller your route should be post .
Show PDF without path in URL
Refer to Can an ASP.NET MVC controller return an Image? , the answer suggest to return image file from controller in C#. My question is: Can I do the same thing or similar in PHP? What I want is to hide PDF path from URL. Thanks Answer I think you are trying to hide the real local path of your
Laravel LiveWire 2 : Do we have to make a new class or we can do like traditional Controller
So, it’s my first LiveWire learning Project. Just to the point, I’m making a Livewire Component called User using php artisan make:livewire user and then this is what I got First User.php And so, I want to make a create user at different pages. NOTES: Ive already use turbolinks for the SPA, and when I create like the traditional Laravel
Comparing user submitted data, then sending a response back
newbie here I apologize for the cryptic title, I’m new to Laravel and PHP. I’m building a CTF application using Laravel Jetstream with LiveWire as part of a university project. Users will submit flags they’ve found, and I want that data to be compared with a database entry. If they flag is correct, I want this to be shown: If