Questions tagged as 'laravel-eloquent'

1
answer

Upload image on server does not work

When I upload locally using WAMP64, everything happens normally. However, when I upload from the site, which is on the production server, the following error message is displayed.    NoWritableException in Image.php line 143:       Can not w...
asked by 14.12.2016 / 21:17
1
answer

Join in Eloquent - Join in Eloquent?

I'm learning Laravel now, and out of curiosity I came across the following problem, doing a join between two tables, in my case, " categorias " and " subcategorias ", when I'm going to list the subcategorias . It look...
asked by 12.05.2017 / 06:57
0
answers

Convert sql to eloquent

How can I convert this code sql into eloquent ? SELECT CONCAT(FLOOR(sum(diferenca)/60),'h',MOD(sum(diferenca),60),'m') as tempo FROM (SELECT TIMESTAMPDIFF(MINUTE, m1.created_at, min(m2.created_at)) as diferenca FROM me...
asked by 04.08.2018 / 19:35
3
answers

How to make the relationship of an extra field (pivot) in belongsToMany

I currently have the following situation: 1 User can belong to multiple municipalities Within this relationship - municipios_usuarios - I need to also save who made this relationship, ie usuario_id public function municipi...
asked by 15.07.2015 / 14:39
2
answers

Laravel 5.2 - Making Many To Many relationships between records of the same table

The tables: The users table registers users who can have N functions that are stored in the funcoes table (student, responsible, teacher, etc.). The funcao_user table is pivot that makes the Many To Many relationship b...
asked by 14.09.2016 / 22:34
1
answer

Laravel 5 improve filter

I created a filter in my view index, when I put something inside one of the filter inputs it enters the ifs but I think it is not good in this way, does anyone know in any better way? public function index() { $usuariosFiltro = null; $...
asked by 20.07.2015 / 20:27
1
answer

Where it takes a long time

I'm using Laravel 5.6 My model is normal <?php namespace App; use Illuminate\Database\Eloquent\Model; class MyTable extends Model { protected $table = 'myTable'; public $timestamps = false; } I'm trying to make a simple qu...
asked by 25.09.2018 / 22:22
3
answers

Eloquent with does not do inner join?

I remember the old "find" that in a query using Eloquent, if I used with Laravel made a inner join . Today I happened to check the queries of a project and ... [2014-11-20 23:21:16] sql.INFO: select * from 'ocurrences' where 'o...
asked by 21.11.2014 / 00:35
2
answers

Problems viewing the Data Laravel 5.1 [closed]

I'm a beginner in Laravel and I'm trying to get data from a DB with multiple Postgresql schemas with Laravel 5.1 and it's bringing me an error What configuration should I make for the model to correctly access the table of that schema? Dir...
asked by 04.01.2016 / 20:41
2
answers

Error while posting

I'm trying to save the information that comes from my registration form with this function: public function postCreate() { $this->beforeFilter('csf', array('on' => 'post')); $validator = Validator::make($data = Input::all(), Des...
asked by 01.05.2014 / 17:14