Support the ongoing development of Laravel.io →

990 Threads

posted 9 years ago

How to pass variable to raw sql query

Hi, i am trying to pass variable to raw sql query and it gives me an error. My query: DB::select(DB:...

0 Likes
1 Replies
Solved

Route Model Binding Return null.

Can Anyone help me with this issue? I'm new to laravel and would like to know how to resolve this. F...

0 Likes
1 Replies
Solved

How to show checkboxes as checked when values are set in the database

I really hope someone can help, I'm setting up entrust and trying to manage roles via an edit users...

0 Likes
7 Replies
Solved

date_format?

How do I use date_format? I can't figure out how to format a date from YYYY-MM-DD that's stored in m...

0 Likes
9 Replies
Solved

How to: Iterate through record from DB

Hello! I have actors collumn in movies table and all actors are saved in following way: actor1, acto...

0 Likes
4 Replies
Solved
posted 11 years ago

Normal foreign key error:

I have brand new database and i want to make a normal foreign key relationship now i get the error:...

0 Likes
5 Replies
Solved

seeding / accessing one-to-many-relationship

I have a problem with seeding a belongsTo-relationship. My code is the following: // the Model Compo...

0 Likes
1 Replies
Solved

How to: Get first N objects in foreach loop

Is it possible to get first Nth ojects in foreach loop. For example i have foreach loop with movies...

0 Likes
1 Replies
Solved

Join multiple tables Eloquent

I am trying to Join multiple tables and get results I have now 2 tables 1- projects_info (id - pro_t...

0 Likes
1 Replies
Solved

Multi-way Relationship?

Good day, I'm new to laravel and have been attempting to figure out how on earth to do a multi-way r...

0 Likes
2 Replies
Solved

Select from two tables and show everything

I want to show on the page data from two tables but with a little condition and I can't figured it o...

0 Likes
1 Replies
Solved

Codeception writes in production db and reads from testing

I am trying to write functional tests for my app. I am using Laravel 5.2 and Codeception. I have a s...

0 Likes
1 Replies
Solved

Changing Eloquent models database connection at runtime

Is there any way to force Eloquent models to re resolve the connection they were instantiated with?...

0 Likes
3 Replies
Solved

array_merge(): Argument #2 is not an array

I get this error when I try to edit my users array_merge(): Argument #2 is not an array I've tried...

0 Likes
7 Replies
Solved

Json response removes key in array :(

Hi dd my array looks like this: array:8 [▼ 0 => "promo\1\images\2.jpg" 1 => &quo...

0 Likes
3 Replies
Solved

How to pass data to json from Database?

Hello, Here is my Row Query to get the data from database. $user = DB::table('users')->get(); I w...

0 Likes
7 Replies
Solved

How to get child objects belonging to parent

I have a method that returns all the current user's blogs. User hasMany Blogs and Blog belongsTo Use...

0 Likes
2 Replies
Solved

Link each product to its product_details page

In native PHP it takes about 2 minutes to link each product on the page to its product_details page...

0 Likes
4 Replies
Solved

How do I use chunk to insert large amounts of data into database?

I would like to insert a large number of rows into my database using chunks, but I am not sure I am...

0 Likes
2 Replies
Solved

Trying to display orders on logged user

I'm trying to make a menu for user when he loggin to be able to check his order history. So far I go...

0 Likes
3 Replies
Solved

Thanks to our community

Solutions given in the past year. Excluding solutions from thread authors.

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2026 Laravel.io - All rights reserved.