Skip to content
Advertisement

Tag: laravel

Insert multiple items in Laravel Collection inside a php loop

Hi I am trying to insert multiple items into a laravel collection inside a php loop but only one is getting inserted (the last one), please help to insert all the values. This array $some_array = array(); has values like 1,2,3,4 The loop is like Output required Answer use collection class at the top of the page.as, use this snippet.

Laravel Views Subfolders routing

I have sub folders inside my view folder called I want to route this saled.blade.php and datauploader.php files in web.php I have tried with in both the ways.but both shows 404 errors. and this is the way I mentioned the url of the file in home.blade.php So please help to resolve this Answer if directly form the web file :

joedixon/laravel-translation not updating

I have just installed a Joedixon/Laravel-translation package in Laravel version 8. It shows the words but when I want to update it will not work. I did everything that was said in the documentation and also I’ve read this article about it but it also didn’t work. https://github.com/joedixon/laravel-translation/issues/82 NOTES: 1: I changed the driver to database. 2: adding a new

gor error message when deleteing comment in Laravel project

working with Laravel 6 project and I have following CommentController, and My routes are as following but when I try to delete comment got following validation error message The comment field is required. how could I fix this problem here? edit.blade.php Answer Because HTML forms can’t send PUT, PATCH and DELETE requests, we must “spoof” the request and include an

Laravel Lumen Collection – Group By With Sum and preserve the values

I’m working on Lumen and my collection has duplicate values, example: I would like to sum the value property when the name is the same but preserve other values like (department and phone) and remove duplicates entity, example: What’s the best way to do this? Answer This can be achieved using collection functions (https://laravel.com/docs/8.x/collections). In this example I solved it

Advertisement