lucassimines

lucassimines

Member Since 3 Years Ago

São Paulo

Experience Points 11,050
Experience Level 3

3,950 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 52
Lessons
Completed
Best Reply Awards 0
Best Reply
Awards
  • 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.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    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.

23 Oct
8 months ago
12 Sep
10 months ago

lucassimines left a reply on How Can I Combine BelongsTo To A Related_id Column And Related_model?

Yea I think the polymorphic relationship will be the best way to solve this.

About the separate relations didn't work because it can't be null. Thanks for helping @tykus

lucassimines left a reply on How Can I Combine BelongsTo To A Related_id Column And Related_model?

But the related_model column is in my slider table and not in my books table

 Column not found: 1054 Unknown column 'related_model' in 'where clause' (SQL: select * from `books` where `related_model` = book and `books`

lucassimines started a new conversation Hello How Can I Combine BelongsTo To A Related_id Column And Related_model?

I have the following in my Slider.php model:

public function book()
    {
        return $this->belongsTo('App\Book', 'related_id');
    }

    public function report()
    {
        return $this->belongsTo('App\Report', 'related_id');
    }

But I want to my slider return only books if it's slider column 'related_model' equal book and only reports if the related_model column val equal report

09 Jul
1 year ago

lucassimines started a new conversation How To Query Unicode Character With Query Builder 'where' ?

How to query unicode character with Query Builder 'where' ?

I have a JSON column that have characters like '\u00e3' but I cant find them using Laravel's where methods.

How can I solve that?

01 Feb
1 year ago

lucassimines left a reply on How Can I Get The Parameter From Route Group Before Using Get Method?

This way below works:

Route::group(['prefix' => '{model_slug}/categories'], function () {
            Route::get('/', function ($model, \App\Category $c) {
                if (Auth::user()->can($model)) {
                    $c = $c->where('model_type', $model)->with('children')->with($model)->orderBy('order')->get();
                    return $c;
                }
            });
});

lucassimines started a new conversation How Can I Get The Parameter From Route Group Before Using Get Method?

I'm trying to pass the group parameter to middleware, I got the exactly model_slug from Request::segment(2), but it doesn't work, just work if I type the model_slug string directly

How can I solve this?

Route::group(['prefix' => '{model_slug}/categories'], function () {
            $permission = 'permission:' . Request::segment(2);
            Route::get('/', function ($model, \App\Category $c) {
                $c = $c->where('model_type', $model)->with('children')->with($model)->orderBy('order')->get();
                return $c;
            })->middleware($permission);
 });
09 Nov
1 year ago

lucassimines started a new conversation Is It Possible To Check A Radio Button And Call A Function?

Here is my code:

<input type="radio" :name="'shipment['+sKey+']'" :id="'m'+sKey+oKey"
                                           v-on:click="updateProductCondition(s.Products,o)"
                                           :checked="cart.shipping.options[o.Description] == true"
                                    >

This input is inside two v-for and I pass two parameter to the function updateProductCondition, so it's not possible to call on a Vue method.

All I want is to call the function if the input is checked, but on my blade file. Is it possible? Thanks.

04 Oct
1 year ago

lucassimines left a reply on Laravel-mix Not Working Fine On MacOS High Sierra

Solved by deleting public/mix-manifest.json file.

lucassimines started a new conversation Laravel-mix Not Working Fine On MacOS High Sierra

Hello guys, I'm having some issues when trying to run npm run production or npm run watch.

Ive updated the xcode usingxcode-select –-install` and it stills doens't work, how can I solve that?

Errors:

> @ watch /Users/lucassimines/Laravel/E-Commerce
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

undefined:1



SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at Manifest.read (/Users/lucassimines/Laravel/E-Commerce/node_modules/laravel-mix/src/Manifest.js:132:21)
    at new Manifest (/Users/lucassimines/Laravel/E-Commerce/node_modules/laravel-mix/src/Manifest.js:14:43)
    at Mix.initialize (/Users/lucassimines/Laravel/E-Commerce/node_modules/laravel-mix/src/Mix.js:49:25)
    at Object.<anonymous> (/Users/lucassimines/Laravel/E-Commerce/node_modules/laravel-mix/setup/webpack.config.js:18:5)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at requireConfig (/Users/lucassimines/Laravel/E-Commerce/node_modules/webpack/bin/convert-argv.js:96:18)
    at /Users/lucassimines/Laravel/E-Commerce/node_modules/webpack/bin/convert-argv.js:109:17
    at Array.forEach (native)
    at module.exports (/Users/lucassimines/Laravel/E-Commerce/node_modules/webpack/bin/convert-argv.js:107:15)

npm ERR! Darwin 17.0.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "watch"
npm ERR! node v7.9.0
npm ERR! npm  v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ watch: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @ watch script 'cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the  package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs 
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls 
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/lucassimines/.npm/_logs/2017-10-04T13_47_30_699Z-debug.log
➜  E-Commerce git:(master) ✗ 
03 Oct
1 year ago
21 Sep
1 year ago

lucassimines left a reply on How Do I Pass A Variable Of Data From One File To Another File?

the same between components.. I have a shopping cart on header that shows the cart quantity, but when I'm on the cart page and change the quantity of a product, the header cart quantity won't update, just if I reload the page.

lucassimines started a new conversation How Do I Pass A Variable Of Data From One File To Another File?

new Vue({
    data: {
        cart: cart,
    }
});

I want that the cart variable value to be the same as other file data cart value.. how it's possible?

20 Sep
1 year ago

lucassimines left a reply on How Can I Return A Single Data Value For Each Input

@tanmay_das yea, it is, just forgot to write there

lucassimines started a new conversation How Can I Return A Single Data Value For Each Input

Hello guys, I have an updateCart method and I need to return the qty when clicking on - or +, but the data: {qty} returns the same qty to all my cart qty inputs, how can I return the right qty for the only clicked input?

new Vue({
    el: '#cart',
    data: {
        qty: 1,
    },
updateCart: function (id, action) {
            var vm = this;
            var qty = 1;
            var sum = null;
            if (action == 'remove') {
                if (qty > 1) {
                    sum += parseInt(qty) - 1;
                    vm.qty = sum;
                } else {
                    sum = 1;
                }
            } else {
                sum += parseInt(qty) + 1;
                vm.qty = sum;
            }
            this.getCartInfo();
            this.$http.get('/cart/update', {params: {id: id, qty: sum}});
        }
});
05 Sep
1 year ago

lucassimines left a reply on Eloquent Collection Filter Not Working With First()

Yea, just one is not null in my list. What I'm trying to do is to get only the first product of my ConfigurableProducts instead of all products, how can I do this?

lucassimines started a new conversation Eloquent Collection Filter Not Working With First()

Hello, I'm doing the following:

Route::get('list', function (\App\ConfigurableProduct $cp) {
        $p = $cp::with(['products' => function ($q) {
            $q->where('available', true)->first();
        }])->get();
        return $p;
    });

But the relationship products is returning null, it only just works if I change first() to get() method, does anyone knows what`s happening?

30 Aug
1 year ago

lucassimines started a new conversation Vue Lists (v-for) Using Vue-resource Returns Nothing In Ie11

Hello guys, I'm testing my application on ie11 and all vue lists seems not to render on ie11, all the other simple methods works fine, except the json lists using vue-resource. How can I solve this? Thanks in advance.

03 Jul
2 years ago

lucassimines started a new conversation Can't Find The Subject "Reset Password" On Reset Password Email In L5.4

Where can I change the reset email password subject in Laravel 5.4? Can't find this... Thanks!

02 Jun
2 years ago

lucassimines left a reply on Why My Custom Package Class Just Works If I Add It Into The Root Composer.json?

@rawfan thanks for the answer, but my package won't run composer because it is not in packagist, it's private. I changed it's folder from vendor to packages, is there any way I can run it's packages folder composer.json ?

30 May
2 years ago

lucassimines left a reply on Why My Custom Package Class Just Works If I Add It Into The Root Composer.json?

Thanks a lot sir, didn't now that thing about composer. ;)!

lucassimines left a reply on Why My Custom Package Class Just Works If I Add It Into The Root Composer.json?

I'll just able to use the autoload inside my package's composer.json If I put it on packagist? Just want to know this doubt.

lucassimines left a reply on Why My Custom Package Class Just Works If I Add It Into The Root Composer.json?

Publishing my package or use Satis then I will be able to use my own packages composer?

lucassimines left a reply on Why My Custom Package Class Just Works If I Add It Into The Root Composer.json?

Yea.. it's my companies package.

Will my package only works with it's composer file if I submit on Composer?

lucassimines left a reply on Why My Custom Package Class Just Works If I Add It Into The Root Composer.json?

Yea..

What I want to do is to use autoload on my packages composer.json and not in the main composer.json.

Like this:

"autoload": {
    "psr-4": {
      "Fmcdigital\\EmailSignature\\": "src/"
    }
  },

lucassimines left a reply on Why My Custom Package Class Just Works If I Add It Into The Root Composer.json?

Ok, I removed and created a packages folder, but I still need to put the autoload on the main composer.json file...

      "Fmcdigital\\EmailSignature\\": "packages/fmcdigital/emailsignature/src/"

lucassimines left a reply on Why My Custom Package Class Just Works If I Add It Into The Root Composer.json?

Yea.. got it.

Well my package is required on composer "fmcdigital/emailsignature": "*" but it installs from my git repo, I'll try to move it into another folder outside vendor than.

lucassimines left a reply on Why My Custom Package Class Just Works If I Add It Into The Root Composer.json?

I mean to the main composer.json file that is located inside that starts with "name": "laravel/laravel"

lucassimines left a reply on Why My Custom Package Class Just Works If I Add It Into The Root Composer.json?

Yea, I know that difference.

But my Class is just recognized if I put the autoload it on the root App composer.json, do you get that?

On the root composer:

"autoload": {
    "psr-4": {
      "Fmcdigital\\EmailSignature\\": "vendor/fmcdigital/emailsignature/src/"
  }
  },

When I add to the root App composer.json my service provider is added to cache/services.php and cache/config.php.

What I don't understand is why when I simply put my autoload on my packages composer file it doesnt add into the cache/services.php and cache/config.php files, making my class not being found.

lucassimines left a reply on Why My Custom Package Class Just Works If I Add It Into The Root Composer.json?

the structure is vendor/fmcdigital/emailsignature/src

lucassimines left a reply on Why My Custom Package Class Just Works If I Add It Into The Root Composer.json?

My autoload is:

"autoload": {
    "psr-4": {
      "Fmcdigital\\EmailSignature\\": "src/"
    }
},

and the EmailSignatureServiceProvider is inside vendor/fmcdigital/emailsignature/src

It seems that composer is not reading my package autoload, because it only reads if I put inside the Application Folder/composer.json

lucassimines left a reply on Why My Custom Package Class Just Works If I Add It Into The Root Composer.json?

It seems that my package composer.json is not being read.

And yes, I did composer dump-autoload many times, but no success..

lucassimines started a new conversation Why My Custom Package Class Just Works If I Add It Into The Root Composer.json?

Hello guys, I created a package but it just works I if add the packaged src directory to the root package.json file.. Why doesn't it just work with my package composer.json file like all other packages?

Thanks.

lucassimines left a reply on Code My Header For All The Pages

Use AppServiceProvider to make global variables.

view()->composer('*', function () {
            $pages = \App\Page::get();
            view()->share('pages', $pages);
});
29 May
2 years ago

lucassimines started a new conversation AppServiceProvider Variables Not Working With Custom Package

Hello guys, I created a package, but when I call my view that extends my dashboard layout, it gives an error that tries to get some AppServiceProvider.php functions. Why does my package view that extends the dashboard layout doesn't recognize those variables? Thanks for the help!

18 May
2 years ago

lucassimines left a reply on How To Use Watch Production In The New Laravel Mix?

Thanks a lot @iak, it worked with the following entry:

    "watch-production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --watch --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"

lucassimines started a new conversation How To Use Watch Production In The New Laravel Mix?

Hello guys, I'm missing the gulp watch --production command on Laravel Mix, can I do something like npm watch production instead on npm run production only? Thanks.

05 May
2 years ago

lucassimines left a reply on How To Search Json Columns In The Right Way?

Thanks @bunnypro I'll lookup those methods.