lucassimines

lucassimines

Member Since 3 Years Ago

São Paulo

Experience Points
11,110
Total
Experience

3,890 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.

Level 3
11,110 XP
Oct
10
1 week ago
Activity icon

Replied to How Can I Have A Token For Each Guard?

I'm using Basic Token.

Yea I have two different guards

'guards' => [
        'web' => [
            'driver' => 'session',
            'provider' => 'users',
        ],

        'realtor' => [
            'driver' => 'session',
            'provider' => 'realtors',
        ],

        'api' => [
            'driver' => 'token',
            'provider' => 'users',
        ],
    ],


'providers' => [
        'users' => [
            'driver' => 'eloquent',
            'model' => App\User::class,
        ],

        'realtors' => [
            'driver' => 'eloquent',
            'model' => App\Realtor::class,
        ],
        
    ],

Oct
09
1 week ago
Activity icon

Started a new Conversation How Can I Have A Token For Each Guard?

Hello guys, I have two guards, being Admin Users and Realtors.

If I'm logged with Admin User in the Admin Panel and then I log with the Realtor on the frontend, and then go back to the Admin Panel and try to make an api post without refreshing the page, it gets an error because of the Token.

How can I solve this problem?

Oct
23
11 months ago
Sep
12
1 year ago
Activity icon

Replied to 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

Activity icon

Replied to 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`
Activity icon

Started a new Conversation 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

I wish I could do something like this:

public function book()
    {
        return $this->where('related_model','book')->belongsTo('App\Book', 'related_id');
    }
Jul
09
1 year ago
Activity icon

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 unicode hex characters like '\u00e3' but I cant find them using Laravel's where methods.

How can I solve that?

Feb
01
1 year ago
Activity icon

Replied to How Can I Get The Parameter From Route Group Before Using Get Method?

The code down below works fine:

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;
                }
            });
});
Activity icon

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);
 });
Nov
09
1 year ago
Activity icon

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 parameters 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.

Oct
04
2 years ago
Activity icon

Replied to Laravel-mix Not Working Fine On MacOS High Sierra

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

Activity icon

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.

I've updated the xcode using xcode-select –-installand it stills doesn'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) ✗ 
Oct
03
2 years ago
Sep
22
2 years ago
Sep
21
2 years ago
Activity icon

Replied to How Do I Pass A Variable Of Data From One File To Another File?

@sutherland 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.

Activity icon

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?

Sep
20
2 years ago
Activity icon

Replied to How Can I Return A Single Data Value For Each Input

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

Activity icon

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,
    },
    methods: {
    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}});
        }
    },
});
Sep
06
2 years ago
Sep
05
2 years ago
Activity icon

Replied to Eloquent Collection Filter Not Working With First()

@Snapey thanks for answering. 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?

Activity icon

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?

Aug
30
2 years ago
Activity icon

Started a new Conversation Vue Json Parse Using Vue-resource Not Working On 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.

Jul
03
2 years ago
Activity icon

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!

Jun
02
2 years ago
Activity icon

Replied to 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 ?

Activity icon

Replied to Running Package's Composer.json File

I also need that

May
30
2 years ago
Activity icon

Replied to 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. ;)!

Activity icon

Replied to 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.

Activity icon

Replied to 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?

Activity icon

Replied to 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?

Activity icon

Replied to 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/"
    }
  },
Activity icon

Replied to 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/"

Activity icon

Replied to 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 then.

Activity icon

Replied to Why My Custom Package Class Just Works If I Add It Into The Root Composer.json?

Yeap, I did it, my package is inside vendor

Activity icon

Replied to 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"

Activity icon

Replied to 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.

Activity icon

Replied to Why My Custom Package Class Just Works If I Add It Into The Root Composer.json?

the structure is vendor/fmcdigital/emailsignature/src

and the composer.json file is inside vendor/fmcdigital/emailsignature

the EmailSignatureServiceProvider.php is inside vendor/fmcdigital/emailsignature/src

Activity icon

Replied to 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

Activity icon

Replied to 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..

Activity icon

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?

I added it into my package composer.json file:

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

But to make it work, I also need to put on root composer.json.

Thanks.

Activity icon

Replied to Code My Header For All The Pages

Use AppServiceProvider to make global variables.

Put inside boot function.

E.g. share pages:

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

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 global variables. Why does my package view that extends the dashboard layout doesn't recognize those variables? Thanks for the help!

May
18
2 years ago
Activity icon

Replied to 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"
Activity icon

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.