Questions tagged as 'laravel-eloquent'

0
answers

Sum of time worked by several employees

I have a collaborators table, and 2 other activity tables, each with a time column used to perform that activity and would like to add these tables to know the total time, for example, employee A did 10 hours on a project (table 1) and another 1...
asked by 10.08.2017 / 23:26
2
answers

Laravel directing HTTP method to erroneous function on Controller

I have a project in Laravel and Vue.js where I have a function in Vue.js that sends a post with the data of a form, so far so good, except that when the this.$http.post() function makes the request for the backend, th...
asked by 13.07.2017 / 23:41
1
answer

Get PHP sub-category description Laravel Eloquent

Hello, I need to get the description of my parent category, but I can not get the description in the same select, I can only get the parent category id. I have a table with the following structure Below is the code that I am getti...
asked by 28.06.2017 / 20:12
0
answers

Group By | Relationship Many To Many Laravel 5

I'm developing an application in Laravel 5 where I have the tables employees , companies , exams , employee_exams and their respective fields as migration below: :: Table Companies public function up() { Schem...
asked by 14.06.2017 / 19:33
0
answers

Method error does not exist in Laravel

Good afternoon, guys. I have an application that uses Polymorphic Relations according to Laravel doc. link I'm having the following error when trying to save the mode. The error occurs in the second save () method of the store method....
asked by 30.04.2017 / 21:59
1
answer

How to create Scope in Laravel 5.4 with tables linked through belongsToMany

The structure of the table is this: pessoa id - integer nome - string unidade id - integer nome - string pessoa_unidade pessoa_id - integer unidade_id - integer I have the templates: class Pessoa extends Model { pu...
asked by 06.05.2017 / 12:49
0
answers

Getters and Setters are automatically generated by Eloquent when we use relies / laravel to generate the Modules?

I have an already functional application. I'm moving on to laravel 5.4. Since the database already exists and with real data, my choice is not to use Migrations. One option would be to use the Query Builder to access the data in the database....
asked by 06.03.2017 / 15:46
0
answers

With Eloquent is not bringing any value

I'm using Laravel 5.2, I'm trying to 'join' n to m with 'With' from 'Eloquent' but it does not return any value even though they exist in the database. Class Person: class Pessoa extends Authenticatable { const CREATED_AT = null; con...
asked by 24.02.2017 / 19:55
2
answers

eloquent save () method does not work

When I try to use the save() method of eloquent-laravel 5.1, in the way it asks for documentation, the update is not done in the database. This is how the documentation asks for it: $flight = App\Flight::find(1); $flight->name...
asked by 07.02.2017 / 00:40
0
answers

How to set the timeout for dump in database.php?

I need to increase the timeout of MySQL to execute a dump processing of the bank. 'mysql' => [ 'driver' => 'mysql', 'host' => env('DB_HOST', 'localhost'), 'port' => env('DB_P...
asked by 15.11.2016 / 04:06