Skip to content
Advertisement

Tag: laravel

Laravel accessor returning different month from the one in the database

I’ve got the following code. The first function works as expected when I output {{ $event->date_and_time }} in my blade. But, when try {{ $event->month }} I don’t get the correct month. No matter the month in the database, the output is always JULY. e.g this 2225-12-12T05:46 from the db outputs July instead of Dec. Can’t figure out what it

searching in large tables in laravel

I have some items from a table and I want to search for each item’s id in other 4 tables (that currently have around 5k-6k rows but will be larger in the future). I have to search through all tables (as above) and if I don’t find the item in one of the tables, I keep searching in the others.

Goutte laravel web scrap from all table data

I need to scrap all Th and td data return like an array. Result showing only first Th/td data. result showing only first Th/td, need to all row: Answer The provided code is looping every table ($page->filter(‘table’)->each) and selecting only a single tr > th. But what you want is to loop the tr’s of the table. Probably you will

Eloquent relationship returns nothing

I am trying to make a system that allow users to create playlists which add on it movies there favorites movies or songs. I named the main model “Top”. I also have models : User, Category, Liste_top (this name is bad but it make de junctions beetween a Top and a Movie/Song. A better name, I guess, would be something

Laravel migrate ends up in wrong database

I have the following settings in .env When I run Everything seems to be ok. But when I look at my target database “unwa”, it is empty. A die and dump revealed, that I was connected to another database “auction” that happens to be the first (alphabetically) database. I find all my tables in the “auction” database. How can I

Advertisement