Support the ongoing development of Laravel.io →

3,315 Threads

posted 10 years ago

deleting with associations

Hi all, I have a User model that hasMany Assessments so: class User...{ public function assessment()...

0 Likes
2 Replies

Database whereHas with Wherein (Query Builder)

id item_id tag_id 244 25090 28 247 25091 28 249 25091 33 250 25092 28 251 25092 33 253...

0 Likes
1 Replies

Capture Model old data before committing updated data to database

Hi, We have a requirement in our application wherein we need to capture all instance of update opera...

0 Likes
1 Replies

Array on One Column (Join)

DB::table('users') ->join('contacts', 'users.id', '=', 'contacts.user_id') ->join('orders', 'u...

0 Likes
1 Replies
posted 10 years ago

Manager/User relationship

Hi, I have set up my site so that a User can have a Role by doing: class User... public function...

0 Likes
1 Replies
posted 10 years ago

Getting orderby in conversation

How do I achieve to order my conversation by latest messages. I got this so far but it's not working...

0 Likes
1 Replies

Opinion on getReceiver

Would you do // Model public function getReceiver() { return $this->users()->where('user_i...

0 Likes
0 Replies
posted 10 years ago

Will a touched object have the same timestamps as the toucher?

I have a similar example to that in the docs.. a comment and post scenario. I want notifications whe...

0 Likes
0 Replies

Laravel Validate Many-To-Many Relationship

So I have this Offer model with several offers available. I also have a Pattern model that has a man...

0 Likes
0 Replies

Displaying content with html tags.

Hi , I am using ckeditor for textarea. It is working fine. But when we display description on fronte...

0 Likes
2 Replies

Howto handle exceptions that occur when database is disconnected or unreachable?

I am in the process of writing a SPA application using angularjs for the frontend and laravel as a R...

0 Likes
0 Replies

Permissions - only show deep nested content in users group?

Once again I'm pretty lost, the same place as other projects I've started xD A "closed" ap...

0 Likes
3 Replies
posted 10 years ago

Showing models only through relation

What is the best way to use findOrFail / find on a model to find models just belonging to an user. M...

0 Likes
2 Replies

Possible to use PHP functions in-line with Eloquent ->where clause?

Hi, I've got this in my code. $list = $the_things->where( 'date_field', '>', time() ); That d...

0 Likes
1 Replies

How safe is Input::all() if I pass it to the Model::create() method?

I'm curious as to how much escaping and input sanitizing Laravel does behind the scenes. For instanc...

0 Likes
5 Replies

Foreign key constraint is incorrectly formed

http://laravel.io/bin/Nk3v#2 I thought I had everything working, until I added this last foreign key...

0 Likes
0 Replies

Eloquent error: Integrity constraint violation

Hi, this is my first thread so if I doing wrong some things please don't hate me :) I'm using Migrat...

0 Likes
2 Replies
posted 10 years ago

Create a model instance including its relationships

I'm trying the create a model instance including it's relations, but i can't seem to find a proper w...

0 Likes
1 Replies

Routing for a simple search

I want to know the best and simple way to setup routing for this: I have a form that posts to /prici...

0 Likes
3 Replies

Creating Eloquent model with 2 columns?

tableA that contains 2 particular columns. idA, idB tableB has 1 column that those are mapped to. id...

0 Likes
2 Replies

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.