Questions tagged as 'eloquent'

1
answer

Laravel 5 Eloquent Model error

Hello Stackoverflow community, I have this error while I try to use query between models and relationships in Laravel 5.3: BadMethodCallException in Builder.php line 2450: Call to undefined method Illuminate \ Database \ Query \ Builder :: ad...
asked by 06.04.2017 / 22:11
1
answer

Problem with DDBB MySQL and Eloquen relationship

I have 3 Models (tables) in the development of a web page: * Article *Colour * Size The tables must be related since "Article" can have several colors and several sizes. The problem is that there must be a "Quantity" field that I do not kn...
asked by 12.08.2018 / 04:13
1
answer

Session in Laravel

I have a question regarding the sessions that are due in Laravel, as they will know in the file session.php there is a variable called lifetime that there is configured the time in which you want a session to be alive. The issue that I do not...
asked by 20.10.2018 / 22:57
1
answer

Error Exception: Trying to get property of non-object - laravel

I need to get the ID and Name fields from my pivot table, I've tried this public function Display(){ $langservice = new langService(); $musgroups=$langservice->getMusgroup(session()->get('lang_id')); foreach($musgroups as $mu...
asked by 20.12.2018 / 16:27
1
answer

Insert data in form with foreign key laravel

I need help, I have problems to create a new record or update it, from a form, since I use foreign keys to do it. The error is "Undefined variable: marcas (View: C:\xampp\htdocs\..... these are my scripts Models class Marca extends Mod...
asked by 12.05.2018 / 15:31
1
answer

Eloquent query

Performing a query in eloquent, which lists the records of the table to which they are related to the records in table b, up there well. Additionally I need you to also list the records of a that are not related in b. Any suggestions?     
asked by 15.03.2017 / 15:42
1
answer

Getting data with orWhere

I have the following function that collects data from the books I have purchased. It certainly works, when I search for the three parameters it gives me what I want and when I do not use the parameters it gives me what I look for too. The thing...
asked by 10.03.2018 / 19:06
1
answer

Update fields of several tables in Laravel

I have a question, how can I make this query in laravel using Eloquent ? UPDATE Tabla1, Tabla2, Tabla SET Tabla1.estado = 1, Tabla2.estado = 1, Tabla3.estado = 1, WHERE Tabla1.estado = 0 or Tabla2.estado = 0 or Tabla3.estado...
asked by 27.04.2017 / 14:42
2
answers

I can not log in with manual authentication of laravel 5.4

<?php namespace App\Http\Controllers\Auth; use App\Http\Controllers\Controller; use Illuminate\Foundation\Auth\AuthenticatesUsers; use Illuminate\Support\Facades\Redirect; use Illuminate\Support\Facades\Auth; use Illuminate\Http\Request; cla...
asked by 30.08.2017 / 00:46
1
answer

I update all pivot records

In Laravel 5.4 I'm trying to save the contents of an N: M relationship in a pivot, the problem I have is that it updates all the records that are related to that id, it's like I did an update with the where of the id of the student. The code:...
asked by 25.08.2017 / 17:17