EmilMoe

Software Engineer at Online

Member Since 5 Years Ago

Phnom Penh

Experience Points
35,210
Total
Experience

4,790 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
164
Lessons
Completed
Best Reply Awards
11
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 8
35,210 XP
Jan
17
1 month ago
Activity icon

Replied to Npm Run Prod Fails With Bootstrap

Thanks @alexd I will select you as the best answer, however it seems to have fixed "itself" for me

Jan
15
1 month ago
Activity icon

Replied to Npm Run Prod Fails With Bootstrap

@alexd The only solution I have found myself was to downgrade a few things. I don't know exactly which one that does the trick:

"bootstrap": "^4.0.0",
"laravel-mix": "^4.0.7",
"sass": "^1.20.1",
"sass-loader": "7.*",
"cross-env": "^6.0.3",
Jan
07
1 month ago
Activity icon

Replied to Npm Run Prod Fails With Bootstrap

Yes I know, but that function is a part of Bootstrap and nothing I have made

Activity icon

Started a new Conversation Npm Run Prod Fails With Bootstrap

Can anyone explain to me what is going wrong here and how to fix it? The problem only occurs when I compile for production npm run prod never when I compile for development npm run dev, so it must be something to do with the minifications.

Screenshot 2020-01-07 at 08.35.08.png

As code:

ERROR in ./resources/sass/app.scss (./node_modules/css-loader??ref--5-2!./node_modules/postcss-loader/src??postcss0!./node_modules/resolve-url-loader??ref--5-4!./node_modules/sass-loader/dist/cjs.js??ref--5-5!./resources/sass/app.scss)
Module build failed (from ./node_modules/postcss-loader/src/index.js):
SyntaxError

(259:4) Unclosed block

  257 | 
  258 |   .navbar-toggler-icon {
> 259 |     background-image: escape-svg($navbar-light-toggler-icon-bg);
      |    ^
  260 |   }
  261 | 

 @ ./resources/sass/app.scss 2:14-253
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! @ production: `cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the @ production script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/emil/.npm/_logs/2020-01-06T22_26_52_993Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! @ prod: `npm run production`
npm ERR! Exit status 2
npm ERR! 
Jan
04
1 month ago
Activity icon

Awarded Best Reply on HasManyThrough But With Permissions..?

I found the error. It was in a query listing the domains with some orWhere's that violated the main filter. I grouped them together and now it works.

Activity icon

Replied to HasManyThrough But With Permissions..?

I found the error. It was in a query listing the domains with some orWhere's that violated the main filter. I grouped them together and now it works.

Activity icon

Started a new Conversation HasManyThrough But With Permissions..?

I came to realise that this maybe doesn't really check on permissions:

$this->hasManyThrough(Domain::class, Application::class);

It should only list domains that are belonging to domains where user_id matches auth()->id() (on Application), which I believe this code above doesn't check.

Are there any ways to enforce this check or another way to return a "many through many" as a result?

Activity icon

Replied to Subscription Plans

Thanks. Then at least I know the solution is to make it myself and there isn't a built in :-)

Dec
19
2 months ago
Activity icon

Replied to Laravel 6 Custom Package Development: How To Auto Publish The Package Config File?

I don't think you can, but you can use both merge and publish, so if it isn't published you just merge in the default config

Composer scripts will only be run on the root composer.json

Dec
18
2 months ago
Activity icon

Started a new Conversation Subscription Plans

For the payment part there is Cashier indeed.

But for the technical handling of what permissions each plan allows, how do you handle that? For example Plan1 allows 2 of X and Plan2 allows 5 of X and so on.

Nov
17
3 months ago
Activity icon

Started a new Conversation Stripe: It Seems I Always Need `->createAsStripeCustomer()`?

I'm creating a SaaS and it seems that it would work better if I call createAsStripeCustomer() in User boot method right after creating (created)? Otherwise methods suchs as this fails:

auth()->user()->subscribed('main')

However the documentation says the following, and that confuses me:

Occasionally, you may wish to create a Stripe customer without beginning a subscription. You may accomplish this using the createAsStripeCustomer method

So how do you handle it for SaaS? I thought about creating a ┬┤isValidStripeCustomer` method, but it's gonna be a lot of checks or maybe I should override the methods such assubscribed` or simply make every user a Stripe user?

And also would you create free users in Stripe under a free plan?

Nov
08
3 months ago
Activity icon

Started a new Conversation Npm Run Results In Many Lines: <s> [webpack.Progress]

I have lately had a problem when I run npm run dev or the other built-in commands, the output doesn't come as a progress bar but a line by line progress. Here's an example:

<s> [webpack.Progress] 70% building 776/776 modules 0 active
<s> [webpack.Progress] 78% after module and chunk tree optimization
<s> [webpack.Progress] 79% basic chunk modules optimization
<s> [webpack.Progress] 80% chunk modules optimization
<s> [webpack.Progress] 80% advanced chunk modules optimization
<s> [webpack.Progress] 81% after chunk modules optimization

Is this a failure in the setup of Laravel or something on my machine and can i fix it?

I'm using Windows 10 and Git Bash with MINGW64

Activity icon

Replied to Php Artisan Not Working

@nakov amazing!

Nov
06
3 months ago
Activity icon

Awarded Best Reply on Translator::trans Does Not Exist

Nevermind. It was a vendor that hasn't been updated to Laravel 6 and the error handler pointing at the wrong file.

Activity icon

Replied to Translator::trans Does Not Exist

Nevermind. It was a vendor that hasn't been updated to Laravel 6 and the error handler pointing at the wrong file.

Activity icon

Started a new Conversation Translator::trans Does Not Exist

When I use __() I get the following error referering to the old trans()

Method Illuminate\Translation\Translator::trans does not exist. (View: /var/www/html/resources/views/pages/dashboard.blade.php)

What can the problem be? __ must be referering to trans() somewhere.

I also tried to install laravel/helpers but with no luck.

Oct
12
4 months ago
Activity icon

Started a new Conversation Passport For A Package

I would like to create a package others can install in their Laravel, which will communicate with my app.

I thought I would do that by using Laravel Passport, but I feel the authorization step will be a problem here?

I know many developers will simply ask you to add secret and client_id to .env. Should I simply use skipsAuthorization and let my package gather a token and keep it up to date?

Oct
08
4 months ago
Activity icon

Replied to Multiple Databases

@martinbean

I agree that is a better approach, unfortunately the setup has been developed for 1 client and it will require a lot of work and testing to ensure that the database works for multiple clients. It might be good to migrate towards this in the long run, but it's also a time consuming migration unfortauntely.

Activity icon

Started a new Conversation Multiple Databases

How would you handle multiple databases in Laravel?

I want to use the same codebase for several clients, but they will be on different databases. I thought first I could override the env from Apache, but then I don't see how I can run migrations? So I need to be able to set up different databases for different clients (they can be identified by the domain they access from, as they will be on different subdomains), and it must also work with migrations.

I could add DB_CONNECTION=mysql_client1, DB_CONNECTION=mysql_client2 and so on, but that would give a lot of repetitive code and some maintenance when clients are created or removed. Could I maybe have an initial database and retrieve the client data from there or how would you solve this?