Questions tagged as 'laravel-eloquent'

1
answer

View does not show string value in primary key field

Good people. I'm trying to list the attributes of my table in Laravel 5.6 through a view list, but in the registration (PK) field the contained values are not displayed completely. This field is a code and is of type string but in the view it sh...
asked by 28.03.2018 / 19:38
1
answer

Keep id and id_user equal in updateOrCreate

Hi, I am trying to make a updateOrCreate : $eventos = Eventos::updateOrCreate( ["id" => $id, "id_usuario" => $id_usuario], ["nome" => $nome, "descricao" => $descricao] ); The problem is that when doing update...
asked by 02.02.2018 / 14:19
1
answer

Make inclusion of the respective user Laravel 5.5 Auth Default

I have a simple question, I am putting together some registers for the purpose of studying the laravel framework, with People, Chart of Accounts and etc. I'm using Laravel's default authentication, and now I came across the following situatio...
asked by 27.02.2018 / 13:16
1
answer

Multi-table inheritance in Laravel

I have a Resource entity, which in turn has several implementations, for example, VideoResource and MarkdownResource . Resource has several shared properties, the other two examples in turn have specific properties...
asked by 20.02.2018 / 03:29
1
answer

Find the best selling products (laravel / eloquent)

In laravel, supposing there is a 'Product' model (whose table is products), an 'Account' model (whose table is accounts), and an N: N relationship between accounts and products, in the table_product table, find an elegant way to fetch the 5 best...
asked by 28.11.2017 / 14:26
1
answer

More than one relationship with table top

I have an Accounts Receivable table that has a relationship with the Customer Table and TWO relationships with a Chart of Accounts table I searched the Eloquent documentation but did not find how I can do these two relationships with the sa...
asked by 17.11.2017 / 18:15
1
answer

How to conduct a double consultation on laravel?

I have a query in SQL Ansi: select * from payments as P, receipts as R where P.created_at < CURRENT_DATE AND P.updated_at < CURRENT_DATE AND R.created_at < CURRENT_DATE AND R.updated_at < CURRENT_DATE Precious to perform the sa...
asked by 24.10.2017 / 22:51
1
answer

How to configure email sending in Laravel within cron?

After the creation of cron (code below) a scan is made in the database behind altered data. I have to send an email with this data. How can I do this ??? cron code: <?php namespace App\Console\Commands; use Illuminate\Console\Command...
asked by 25.10.2017 / 16:42
1
answer

Clasture where in field type json no (Laravel + Eloquent)

The problem is the following, I have to bring from a select the permissions that a profile has, only the permissions are in a json field, and because if it is several permissions we have a data collection, I need to do this within a middleware:...
asked by 19.10.2017 / 23:28
1
answer

Can I use select in relationship in laravel?

I have a model that takes the data with a with in laravel, to get correlated data, is there form of this correlated data to see only some specific fields and not all the data in the table? I tried to do so: return ModelPai::with(array('nome...
asked by 19.10.2017 / 14:27