Support the ongoing development of Laravel.io →

4,311 Threads

Query model in a custom classes gives me an error

Hi, I've added a custom classes to ...app/classes/... using a tutorial I've read and so far so good...

0 Likes
2 Replies
Solved

Issue When Polymorphic Relationship Doesn't Exist

I have the following relationships setup... Viewing -> viewable() = morphTo Rental -> viewing(...

0 Likes
2 Replies
Solved

[SOLVED] Stumped as to why a query is not working

I'm working on my first project done in Laravel and almost everything so far has been smooth sailing...

0 Likes
0 Replies
posted 9 years ago

Query with DateDiff()

hello, i am trying to run an eloquent query with the PHP DateDiff() function... This works $sql = &q...

0 Likes
0 Replies
posted 9 years ago

error in Model ?

Hello, I have this model : <?php class Category extends Eloquent { protected $fillable = a...

0 Likes
0 Replies

Polymorphism

I have a table called attachments which has the fields ID TABLE_NAME TABLE_ID and ATTACHMENT Another...

0 Likes
1 Replies

Cast plain old array to Laravel Collection

I have written a PostGres function that uses a CTE to return me a result set. The result set contain...

0 Likes
3 Replies
Solved

Laravel 5 - Observer dont works!

I have a service provider: <?php namespace App\Providers; use Illuminate\Support\ServiceProvider...

0 Likes
0 Replies

[Revisionable Laravel] Why does the revision data not saved in the table revisions?

here is my OperatingProcedure model class OperatingProcedure extends BaseModel { use \Venturecra...

0 Likes
4 Replies

Functions in models - static or create a facade?

Hi I've been using larval for a while now but I really want to make sure I'm doing this correctly an...

0 Likes
3 Replies

Eager Loading with constrains -> load post based on category name

Hi everyone, i'm new to Laravel and trying to get confortable with Eloquent. In the last days i stru...

0 Likes
3 Replies
Solved

How to access relationship over relationship? Something like belongsToThrough() needed.

Hey, I have this schema: table_1: id table_2: id table_3: id, table_2_id, table_1_id I need this sc...

0 Likes
2 Replies
Solved

Paginator appends array not working

Hi, I'm using a form send by GET method. This form contains some multiple checkbox. {{ Form::open(['...

0 Likes
6 Replies
Solved

nested set MVC template

https://github.com/etrepat/baum#usage Let's ssay people start to make use of this nested set. How do...

0 Likes
0 Replies

Foreign keys and mass assignment

Hi everyone, I have a question about eloquent mass assignment. Is that my all foreign keys must defi...

0 Likes
10 Replies
Solved

Laravel global scope on retrieving a model

Hi guys, I'm retrieving Events from the database and every time I get events from the database I wan...

0 Likes
1 Replies
posted 9 years ago

Model / Eloquent: Replace a column in select statement every time?

Hello, I want to permanently replace a column in a select query of a model. So basically if I run Mo...

0 Likes
5 Replies
Solved

Get() vs Select($cols)->get()

Let's assume we have these variables: $query = Study::join('patient', 'study.patient_fk', '=', 'pati...

0 Likes
3 Replies
Solved

best way to insert *many* rows into a table

Every night I hit my provider for an array of calls that are around 1-2k rows per night. I need to s...

0 Likes
2 Replies

Call to undefined method Illuminate\Database\Query\Builder::Parents()

I'm getting this error Call to undefined method Illuminate\Database\Query\Builder::Parents() I'm n...

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