Questions tagged as 'laravel-eloquent'

0
answers

Group by month or week with Laravel eloquent

I have a project that has management of my investments, that is, it takes my daily statement and saves it in my project so that I can see how much it is yielding, in summary I have a table that these values are daily, I can already generate the...
asked by 07.12.2018 / 20:01
0
answers

Doubt about eloquent with Laravel

Hey guys, I'm setting up a football club management system just to practice and in that a doubt arose, I have the following eloquent: $matches = DB::table('ut_tickets AS TIC') ->select('TIC.id', 'STA.name AS stadium', 'CLM.name AS club_...
asked by 18.12.2018 / 19:34
0
answers

Listing in laravel

Hello, I have following modeling: Atableworkoutsthathasseveralmodelsoftraining(models_treinos).Thetreadmillmodelhasseveralexercises.Inlaravel,Ineedtolistacertainworkout(id1,forexample),allthemodelsofthatworkoutandalltheexercisesofthatmodel.Inth...
asked by 20.11.2018 / 18:26
0
answers

Property does not exist on this collection instance

What I researched might be something related to having 1:N , hasMany > belongsTo relationship, but I do not know what I have to do. I'm developing a API in Laravel 5.5 and I have some tables that relate when the...
asked by 20.11.2018 / 12:20
2
answers

How do I store 0 or 1 of a checkbox?

How do I store 0 or 1 of a checkbox with Laravel? Html <div class="custom-control custom-checkbox"> <input type="checkbox" name="dashboard" value="1" class="custom-control-input" id="Dashboard"> <label class="c...
asked by 14.11.2018 / 01:25
0
answers

Parameter by name in the query

I have the following query SELECT * FROM myTable WHERE ip = 192.168.1.2 I would like to make a query by sending parameter by name using DB::raw() $dados = DB::raw("SELECT * FROM myTable WHERE ip = :ip", ["ip" => '192.168.1.2'])...
asked by 15.11.2018 / 19:01
0
answers

Group Data - Collection Laravel

I need to group the data of a SQL function in Indicators and Data, but in my attempt to group, I'm only getting by date (Column), so the data repeats. Model: public static function makeCluster($date, $flag_negocio) { /** @var static $in...
asked by 04.11.2018 / 05:25
1
answer

Get data pivot table Laravel

How can I get the pivot table data using Laravel Eloquent? I need to know which setor_id of users and group_id linked     
asked by 27.10.2018 / 03:14
1
answer

How to make an orderBy in laravel?

I have this orderBy , but it is not working as it should, for example: $query = $query->where( 'approved', 1 ) ->orderBy('featured',1) ->orderBy('priority',1) ->orderBy('created_at...
asked by 17.10.2018 / 15:02
1
answer

Call to undefined method Illuminate \ Database \ Query \ Builder :: table ()

I'm trying to populate a datatable, but I'm not doing it at all. Could you help me? ============= Evaluator_Report - Model ======== <?php namespace App; use Illuminate\Database\Eloquent\Model; class Avaliativo_Relatorio extends Model...
asked by 19.09.2018 / 22:30