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.
Tag: laravel
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
Date time format in php – Fatal error: Uncaught Error: Call to a member function format() on string
I have this kind of error, and wondering if there’s anyway I can fix this that is the error message returning, My database is saving date and time on a single column but I like them to be separated, is it possible? Thanks Lads Answer it looks like you’re using it without a Model and so the data will be
Laravel PHP form wont submit to database or recognise my Route in web.php (but works for my first form)
I’m kind of new to Laravel. I have 2 separate pages, one is a form for teachers and one is a form for parents. The parent form works completely fine and I can see the results in my database, however, my teacher form wont submit. The page refreshes and that’s all. I noticed my Route for my teacher form wasn’t
diglactic/laravel-breadcrumbs, is there a way to change the parent to custom links?
i used some breadcrumbs that look like this it work but my app is in somewebsite.com/myapp/ I want to make the parent go to /myapp/ instead of somewebsite.com is there a way to do that ? Answer Project maintainer here, guessing you’ve solved this by now but figured I’d reply all the same. Breadcrumbs is simply ingesting the output of
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
Laravel – Javascript doesn’t work after I passed a parameter through route
I’m trying to create a website that showcases all search results from various e-marketplace. I’m using javascript to show the result, and it works fine before I try to pass parameter through route. But once I did, the result stopped showing. I assume it’s something to do with the Javascript. Here’s the code: And here’s the code for the web.php:
How To Load data using livewire instead of ajax?
i have this perfectly working example using ajax ! >>>>ajax example .. im using this code to load data whenever click on the nav bar : is it possible to do the same actions using livewire laravel ? the goal is to navigate through the menu and show data in the div whenever i click one of the nav-buttons !