Member Since 2 Years 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
Best Reply Awards 0
Best Reply
  • start-engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-session Created with Sketch.

    School In Session

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

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

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

  • subscriber-token Created with Sketch.


    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.


    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist Created with Sketch.

    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 Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

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

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

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

20 May
3 months 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
3 months ago

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


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')
                              , 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])

          $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
1 year 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 to fill in the variables, 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

<tr v-for = "(row, index) in components">
           v-model = "row.vlr"
           : placeholder = "'Value'"
           : options = "{
               digitGroupSeparator: '.',
               decimalCharacter: ',',
               currencySymbol: '$',
               currencySymbolPlacement: 'p',
               roundingMethod: 'U',
               minimumValue: '0'
           } "
        > </ vue-autonumeric>
    </ td>
</ tr>

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


I have a three models:

PedidoUnidadeCarga hasMany PedidoUnidadeCargaTrecho

PedidoUnidadeCargaTrecho hasMany PedidoUnidadeCargaTreCusto

I'm getting:

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

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


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.