Support the ongoing development of Laravel.io →

988 Threads

eloquent relations

I have two tables one is templates and the other is template_images Showing migration of the two tab...

0 Likes
1 Replies
Solved

How should I name an Eloquent polymorphic table?

I am using Laravel eloquent to design my database. Eloquent has a naming convention for naming a man...

0 Likes
1 Replies
Solved
posted 9 years ago

setting empty field to null

What is the best solutions for setting empty field to null in a model? I don't want to set mutator f...

0 Likes
9 Replies
Solved
posted 6 years ago

Eloquent create method ignore the fillable attributes in laravel 5.4

i face a problem when i register a user through web service API project, and it was working but sudd...

0 Likes
4 Replies
Solved
posted 6 years ago

->count() and ->get()->last()

I have, $a = App\SomeModel::where('id', 1)->get()->last(); My model's table has 72 entries. $a...

0 Likes
3 Replies
Solved

Handle multi-level restful URL

Hi. I already done making this url but I want to know what is the best practice to handle multi leve...

0 Likes
5 Replies
Solved
posted 7 years ago

Code review for improvement

Hi there! I have a bunch of accessor and I want to receive suggestions on how to improve it. public...

0 Likes
2 Replies
Solved

Create dropdown using lists() method to get two columns and combine them in final view

I was working with dropdowns and was thinking if it is possible to use lists() method to get two col...

0 Likes
4 Replies
Solved

Laravel 5.4, problem saving an associated model

i'm trying to save a new tvshow and it's episodes into the database with the following code but in t...

0 Likes
1 Replies
Solved
posted 10 years ago

Inserting of selected fields from 1 table to another table by eloquent

Can I know how to I select some fields from table 1 and insert the values of the selected into anoth...

0 Likes
3 Replies
Solved

Counting total pricing

Hi everybody, I am creating e-commerce system but i dont know how to count the total price of items...

0 Likes
1 Replies
Solved

Relationships, Controllers, and Views

Ok, really quite stuck at the moment trying to wrap my head around relationships and how best to use...

0 Likes
5 Replies
Solved

Odd CRUD issue

Im having a odd issue with my CRUD on Laravel 5.4 and PHP 7.1 when developing via "php artisan...

0 Likes
1 Replies
Solved

DB select get only first row

I have a row query \DB::select("SELECT * FROM table_name WHERE id=$id"); the result shoul...

0 Likes
5 Replies
Solved

Trying to get property of non-object from eloquent Relationship

I have used a relationship that returns data but when i use it it throws error "Trying to get p...

0 Likes
1 Replies
Solved

Reference/Guide of Methods of Model Class

Guys how do I get complete Reference of Methods of Model Class?? like where(), Get(), first(), etc a...

0 Likes
2 Replies
Solved

Eloquent Groupby with Rollup

How do I use the mysql rollup feature with laravel eloquent? I did try a few but not able to get the...

0 Likes
1 Replies
Solved

Eloquent - relationship pivot table attributes

Hey, I am trying to create simple shopping cart / order module and I've decided to connect orders an...

0 Likes
2 Replies
Solved

Route model with relationship

hi all I'm making a blog and i have a question : for the view post page, i use this route : Route::g...

0 Likes
4 Replies
Solved

"Base table not found" error when extending Model

Hello guys! I got a problem that I'm not managing to solve. I have a model called "Jogo" t...

0 Likes
11 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.

© 2024 Laravel.io - All rights reserved.