brigman

brigman

Member Since 1 Year Ago

Experience Points 3,820
Experience Level 1

1,180 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed 36
Lessons
Completed
Best Reply Awards 0
Best Reply
Awards
  • Start Your Engines Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • Chatty Cathy Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

20 May
1 month ago

brigman left a reply on Laravel DB::query To Eloquent

Thanks jlrdw, I've the same position.

In other hand, I've childs of this query ( master -> detail ), best idea is foreach in this items and add the childs in one new collection to return just one payload ?

19 May
1 month ago

brigman started a new conversation Laravel DB::query To Eloquent

Hello,

I've the follow DB query, but, I want to convert to Eloquent to use "with" statement for some childs and use in master/detail grid. It's possible ?

I've tried some ideas, without success.

$items = DB::table('pessoa_fisica as pf')
            ->join('atend as a', 'a.pefi_id', '=', 'pf.pefi_id')
            ->join('atend_servico as ateser', 'ateser.atend_id', '=', 'a.atend_id')
            ->join('servico as s', 'ateser.servico_id', '=', 's.servico_id')
            ->join('convenio as c', 'a.convenio_id', '=', 'c.convenio_id')
            ->join('atend_agendado_servico as aas', 'aas.ateser_id', '=', 'ateser.ateser_id')
            ->leftjoin('tratamento_servico_atend as tsa', 'ateser.ateser_id', '=', 'tsa.ateser_id')
            ->leftjoin('tratamento_servico as ts', 'tsa.traser_id', '=', 'ts.traser_id')
            ->select( 's.descr as descr_servico'
                    , 'c.descr as descr_convenio'
                    , 'ts.dt_alta'
                    , 'pf.nome'
                    , 'pf.num_cliente'
                    , 'pf.pefi_id'
                    , 's.servico_id'
                    , \DB::raw("date_format(aas.dt_agendada_ini, '%H:%i') as hr_agendada")
                    , \DB::raw("date_format(aas.dt_agendada_ini, '%w') as dia_semana_agendada")
                    , \DB::raw('count(*) as total_consultas')
                    )
            ->groupBy(\DB::raw("s.descr
                              , c.descr
                              , ts.dt_alta
                              , date_format(aas.dt_agendada_ini, '%w')
                              , date_format(aas.dt_agendada_ini, '%H:%i')
                              , pf.nome
                              , pf.num_cliente
                              , pf.pefi_id
                              , s.servico_id
                              "))
            ->whereRaw('aas.status = 1')
            ->whereRaw('pf.num_cliente = 107014')
            ->orderBy(\DB::raw("s.descr, count(*)"))
            ->havingRaw("count(*) > ?", [ 3])
            ->paginate(50);


          $response = [ $items,
                        'links' => [
                              'pagination' => [
                                  'total'         => $items->total(),
                                  'per_page'      => $items->perPage(),
                                  'current_page'  => $items->currentPage(),
                                  'last_page'     => $items->lastPage(),
                                  'from'          => $items->firstItem(),
                                  'to'            => $items->lastItem()
                              ],
                          ]
                      ];
31 Jul
10 months ago

brigman started a new conversation Autonumeric + Vue + Array Multi Rows

I'm using vue-autonumeric to format numeric fields, but when I try to format values ​​from an array inside a v-for several problems occur. I think it's a problem of my understanding of the flow, or how popular the variants are, because the same problems occurred with the v-money plugin that made me test the vue-autonumeric plugin.

When I click an edit button, I do the following:

this. components = null; this. components = []; this. components = [{vlr: 8888}]; this. components = [{vlr: 9999}]; this. components = [{vlr: 7777}];

And in the template, I have ``

`` But when trying to render, the value is not filled, and, the following errors occur:

[Vue warn]: Invalid prop: custom validator check failed for prop "value" .found in

Warning: The given value "% 0.00" can not be converted to a numeric one and therefore can not be used appropriately.

Warning: The value you are trying to set results in NaN. The element value is set to the empty string instead.

08 Jun
1 year ago

brigman started a new conversation Sum On Relation Of Relation

Hello,

I have a three models:

PedidoUnidadeCarga hasMany PedidoUnidadeCargaTrecho

PedidoUnidadeCargaTrecho hasMany PedidoUnidadeCargaTreCusto

I'm getting:

$query = (new PedidoUnidadeCarga)->newQuery();
.
.
.
$items = $query->with("PedidoUnidadeCargaTrecho.PedidoUnidadeCargaTreCusto")
                           ->paginate(50);

I want a SUM of PedidoUnidadeCargaTreCusto.vlr_custo at PedidoUnidadeCarga Level.

What i'm doing now is:

            foreach($items as $item)
            {
                $vlr_total = 0;
                foreach($item->PedidoUnidadeCargaTrecho as $trechos)
                {
                    foreach($trechos->PedidoUnidadeCargaTreCusto as $custo)
                    {
                        $vlr_total = $vlr_total+$custo->vlr_custo;
                    }
                }
                $item->vlr_total_receita = $vlr_total;
            }

I have tried a lot of examples, but without success in "Eloquent Way". How I can create an accesstor to get the sum ?

08 Jan
1 year ago

brigman left a reply on Multi Tenancy On SPA

@andonovn You are right, Thank you! I didn't see this option, so, always when I get my auth() i will get the correct ID to filter.

Thank you, you save me a lot of time

brigman started a new conversation Multi Tenancy On SPA

Hello,

I have a project developed on Laravel + VUEJS. I use passport for authentication and i have authorization working.

My users have new request and i dont know how control this in the best way.

Each user when logging get 2 or more companies access, and, I need storage this information and send to laravel each request to filter the data deppending on company connected.

In normal project, I used session and filter on laravel the data using session, but now, I dont have session to do the filter.

In a simple way, the user can change the connected company, and, when change, all data will change.

How I can achieve this with security ? I can use session, but, it can expiry, i dont know if this is a good aproach.