From a blade template I want to pass an array with a variable amount of values to a route, as described in the answer here. However when I do this I can only ever access the first value in the array I …
Tag: laravel-5
Attach images to product variants when creating a new product Laravel
i’m having difficulty attaching images to variants when creating new products. for example a product A with when I save this to the database, img1, img2, img3, img4 goes to both variant A1 and A2 instead of each variant to have its own images. How do I solve this? here is my controller Blade file Answer You need to group
How to access assets from resources sub folder in Laravel?
This is the javascript source in blade file. OR Both asset and URL::to doesn’t work. The actual file path is: resources -> views -> template -> js error shows 404 not found on local xampp server. its working fine in production. project is copy of production code. I would appreciate for your kind support. thanks Answer Static assets are usually
How to make URL from Laravel routes
I’ve got Laravel backend and I’m trying to make iOS to it, but there is no documentation. It is my first time with Laravel, so confused with the routes and middlewares. How do I compose URL from code …
Saving selected option after validation in Laravel
I need help with saving a selected option after validation fails. Here is main.blade.php Controller looks like: I tried this, but it always returns only the last option: Answer If I understood you correctly you want to keep the previously selected option selected when the validation fails. Less repetitive solution with a @foreach:
Can’t understand a logic of Object And Array in php
If I write this line on routes/web.php file It outputs this: That’s cool, but my question is since app()[‘config’] returns an object so how this [“auth.guards.web”]works? Even there is no index with that name! Outside of Laravel I tried to write a class named Test so that it returns the same output but I got an error! Which is, Can
how to update a checkbox value on update function on request based?
i written a very simple code to update value of checkbox but it update 1 in db on uncheck it doesnot update 0 if request is submit here is code
What is the difference between with, compact and array in when return view in laravel
I’m little bit confuse I want to know the difference between those three returns: return view(‘post’, [‘post’ => $post]); return view(‘post’, compact(‘post’)); return view(‘post’)->with(‘post’=>$post); So, can someone explain for me the difference in easy way. Answer Array : You may pass an array of data to views, like this : When passing information in this manner, the data should be
how to do not update value on update function?
i want this code should not be run if user call upate route code i am using a same fucntion to update or store order but on update i donot want to run above code i know it is very simple but i am a student and learning help me here it is controller function first user create order the
get correct data from array
i am trying to decode array. this is my array array:4 [▼ “_token” => “tgPAddbrf3hI5tBIQIGyFYe9Y5RpwCj3rpZG5uVf” “resident_id” => array:4 [▼ 117 => “…