Questions tagged as 'eloquent'

1
answer

Alias for consultation in two tables with laravel

Is there an abbreviated way to identify the columns of each table by creating the query in this way? $product = Product::with(['order'])->where('user_id','=',\Auth::user()->id)->find($id); For example, specifying something like thi...
asked by 06.08.2017 / 06:24
1
answer

How to make a join with the user model that brings laravel by default and a model related to it?

In the migration create a table called employees, and this has the fk of the users table that has the default laravel for the logeo. Therefore the table users and employees are related, now what I intend is to obtain the employee data from th...
asked by 05.12.2018 / 11:26
0
answers

Base Relations Mysql -

I'm a little confused with these relationships. I'm doing a game of questions and answers. In a group | Table | a user makes a publication with a series of questions ((in fact, that user who asks questions can only ask them who made the gr...
asked by 02.12.2018 / 02:52
0
answers

Share variable in Laravel controller

I am doing an intranet for my work, it is a production control (We are a printing press, the platform is to know in which department each work is at each moment). The platform consists of different phases (departments), jobs, clients and workers...
asked by 11.11.2018 / 16:21
2
answers

Related Eloquent query

Hello, I'm trying to get the data of a 'client' I have 3 Tables |Cliente|Cliente_servicio|Servicios In the client table, I have a client's data In the Customer_Service table I have the IDcliente, IDservicio, Description in the Serv...
asked by 08.10.2018 / 08:21
0
answers

Eloquent query does not bring me the record with the specific filter

I have tried to make a query that brings me all the articles that are in Active but I have not got any results. It always brings me all so the state is inactive and is what I do not want. These are the questions I have so far: First que...
asked by 28.09.2018 / 00:37
0
answers

eloquent query does not bring me records when I make a select

I have the following query in eloquent that shows me the records Usuario::with(['rutas'=> function($query){ $query ->select('rutas.*','puntosDeVenta.id_puntodeventa','puntosDeVenta.codigo') ->join('puntosDeVenta...
asked by 26.09.2018 / 17:11
2
answers

Get data from an array with facade DB in laravel 5.5

Dear, I have the following query made with laravel $datos = DB::table('mandato') ->join('compromiso_pago','mandato.CP_IdCompromisoPago','=','compromiso_pago.IdCompromisoPago') ->join('unidad_recaudadora','compromiso_pago.UR_IdUnidadRecau...
asked by 06.09.2018 / 00:07
1
answer

Compare value of a preformatted field with sha1 in eloquent orm

I am sending a URL to the mail of a user who should receive it like this: link Where 23 is the id of a record in a table, which for practical purposes is not desired at this time, so I convert 23 with sha1 () a string .. so that the URL...
asked by 16.07.2018 / 06:07
2
answers

Pivot table values with laravel

I am using laravel 5.5, I have a Member model and a Team model, I made the belongsToMany relationship correctly. The problem is that in the pivot table of that relationship there are several data that I need to access, for example the fields sea...
asked by 05.03.2018 / 01:58