Support the ongoing development of Laravel.io →

4,302 Threads

posted 9 years ago

How to change object key when get data?

Assume i am going to fetch country list. $country = Country::get(); foreach($country as value){ ec...

0 Likes
0 Replies

Multiple tables over multiple databases in a single Model

I am in the planning stage of undertaking a database migration where the two databases (one MySQL, o...

0 Likes
4 Replies
Solved
posted 9 years ago

Creating new model object with unusual value

Hi, I want to create and save model, something like this: $page = new \Page; $page->fill(\Input::...

0 Likes
2 Replies
Solved

Deleting DB-entry: findOrFail or destroy?

Hi, is there a difference between $go = Project::findOrFail($id); $go->delete(); and Project::de...

0 Likes
2 Replies

Best way of retreiving items with a condition on the relation

#The goal# What I'm trying to do is generate a new collection with all the Consultations ordered by...

0 Likes
3 Replies
Solved

Handling in model validation

I read everywhere that in model validation is best practice, but I don't know how to handle a failed...

0 Likes
3 Replies
Solved

Get last 10 tags, polymorphic many-to-many

Hello guys, how can I get last 10 used posts tags? http://help.laravel.io/bd1f15c318d5358b745f27afe3...

0 Likes
1 Replies

Seeding only new files

Hello! Is it possible to know which seeds ar allready seeded and which are new automatically with ar...

0 Likes
2 Replies
Solved

Wrong colums deleted??

Hello, I have some data displayed in table...lets asume like this: 1 - Title1 - Edit, Delete 2 - Tit...

0 Likes
1 Replies

Return specific column

$this->model->find($id)->tags()->get()->toJson(); Not return columns the table tags I...

0 Likes
1 Replies

Where can I keep my collection filters?

Hi, I have controller filters like those: <?php $stats = Stats::all(); $stats_today = $stats-...

0 Likes
4 Replies
posted 9 years ago

One-to-One relationship on inventoory

I have created 2 tables and UnderFiftyDollars will contain all items under $50 to show on a promotio...

0 Likes
1 Replies

Is there a better way?

Hi everyone, http://laravel.io/bin/kYVa9 In the above snippet, you may recoil in horror when you see...

0 Likes
0 Replies
posted 9 years ago

Get table name that is using scope (inside of scope)

So I have scope with following code public function scopeSortable( $query ) { if(Input::has(...

0 Likes
3 Replies
Solved
posted 9 years ago

Laravel ModelNotFound exeption handling with namesapces

I have this problem where laravel ModelNotFound exeption handler catches all exeptions not only rele...

0 Likes
0 Replies

Eloquent where() statements

I'm trying make a function that returns false if there is no inventory available. I need it to searc...

0 Likes
1 Replies

Bizarre behavior of pagination

This is my controller: public function prontuario_index(){ $Prontuarios = Prontuarios::get(15);...

0 Likes
7 Replies

Performant queries on large data sets

I'm building a REST API for a large data set, and running into a performance issue I'm not sure how...

0 Likes
3 Replies

Error: Using $this when not in object context

Hi, i call this somewhere in the CustomerController(): $results = CustomerModel::getCustomers(); Th...

0 Likes
7 Replies

Dynamic "where" on Eloquent Model

Hello, I'm hoping I can get help with a dilema I ran into. I hope it's something simple. I have a me...

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