What kind of relationship is best for my situation?

Hi everyone. I have the following situation. I have an Organisations and a Contacts table. Each can belong to the other. So for examp...
01

Laravel 5.2 QueryBuilder binding conflict

I'm attempting to bind several parameters to a QueryBuilder: Some for joins based on DB::raw, some for a selectRaw, some for whereRaw:...
01

two foreign keys Duplicate key on write or update error

I am getting an error when I try to add two foreign keys at once. The error says that: Can't create table proiectip.#sql-...
00

Composite Key: supported or not ?

I am little bit confused. I searched here and in a discussion old 4 months ago people say that composite key are not supported by eloquent. I also...
01

Return subset of the same data

Hi! I have a query, but it isn't doing quite what I need. First my table (a small part of the table): name | user_id | date...
03

Updating a large table with a calculation based on another field within the same row.

Hi, I have a large table, which simplified looks like this.. id edkey secretkey imported 1 23 1 2 5...
03

Issue in Laravel API documentation or In my understand?

Please checkout this documentation page about El...
01

Save a hasOne relationship change

I currently have a relationship between checklistItem and actions as followed: public function action() { return $this->belo...
03

Helper to retrive a users posts checking between multple dates.

Hello! I have written a helper function to get all active posts from a user within a specific time span. The problem here is that the condit...
06

Need to get another tables values without model

I have two tables Since I can't format them here, check the imgur link img The wi...
00

How to Delete Multiple Records Using Laravel Eloquent

Now this, from what I can see, should have been simple. I want to be able to delete multiple records from the database. I have the id...
07

[Auth] Alphanumeric ID

Hello, my users have a alphanumeric ID like KB1919. Everything works fine but when i call Auth::id() I get int(0) back. What's to do?...
06

Best way to fetch data from DB within the actual hour?

Hi there, what is the best way to fetch data from the DB within the actual hour? For example, it is 01:28 PM and i would fetch all da...
03

Laravel Eloquent limit results for relationship

I have a simple set-up of Albums and Images, each album has many images. I can get all the data fine but I want to limit the returned number of ima...
00

How to check if model has some relationships

Hi all! I ´m creating CRUD application with repository pattern and I would like to check, if model has some relationships. So I can display...
09

Sorting and Paginating on Eloquent Relationship

Hello, I have two tables: deliverable and deliverable_version, which a deliverable can have many...
00

Pass through ID when using with and whereHas?

Hey, I currently have the following query: $forms = FormBuilder::with(['venues' => function($q) { $q->whereHas('ent...
00

pagination with filtering - issue in pagination goes back to unfiltered data

Hi all, I want to show all records in index.blade.php, at the same time I wan to allow users to filter results based in certain criteria suc...
06

Field validation set to present

This is currently set as: public static $rules = [ 'metable_id' => 'required|integer', 'metable_type' => 'required',...
00