bugsysha

bugsysha

Member Since 5 Years Ago

Experience Points
333,585
Total
Experience

0 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
1715
Lessons
Completed
Best Reply Awards
227
Best Reply
Awards
  • start your 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-in-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 Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist 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 50
333,585 XP
Jul
15
21 hours ago
Activity icon

Replied to Log When A User Logs In

Can you mark best answer?

Activity icon

Replied to Storing All Values From Foreach In A String

You are overriding value.

Have no idea what your code is doing but try replacing with one of following

$myPpe[] = array_values($ppeWorn);

Or

$myPpe = array_merge($myPpe, $ppeWorn);
Activity icon

Replied to Is Brittle Code Necessary Concern About In Testing ?

Sometimes I have to change test code after change product code.

You should do the other way around just to build a habit of proper TDD workflow.

In reality, if the requirements change then the feature tests should be changed too. As a result, it should need product code to be changed. It cannot avoid brittle code anyway.

True, you can not avoid changing business requirements. You can write tests in such a way that it is not too coupled to the implementation. But as you said, sometimes it can not be avoided for a test to fail. Like you were sending notifications before, but now you do not. Or some events were not dispatched and now they are.

So, Is it necessary to be concerned about brittle code when doing TDD?

Yes, you definitely need to be concerned about brittle tests, just don't worry about that too much. The experience will come with practice. A lot of practice.

Activity icon

Replied to Launch The Site For Specific Users Only

You can create a middleware and restrict access based on IP and/or email.

Activity icon

Replied to Video About How Laracast Handling Videos

I assume videos are directly uploaded to Vimeo.

Jul
14
1 day ago
Activity icon

Replied to Do You Move Controller Methods To Models Or Not?

I only use model approach. Check this out https://youtu.be/dfgtKb-VpRk

Activity icon

Replied to Log When A User Logs In

And Adam Wathan is a very practical guy who values productivity so if someone with his level of experience takes that approach then I don't see a reason why someone would skip on the opportunity to create a single listener class for already existing event and do himself a favor down the road. As Michael Jordan says in that Nike commercial, "or maybe your just making excuses" to write crappy code.

Activity icon

Replied to Log When A User Logs In

If creating one class is overkill then I don't know what to say. Jeffrey Way once said that only inexperienced software engineers are reluctant to create new classes.

Activity icon

Replied to Log When A User Logs In

If you Google for a term like scalable software you will see that the definition is something like "maintaining performance during a huge increase in load".

What if you need to log to some external CRM also and request lasts for 250ms. Then you need to send an email and that also takes another 250ms. And so on, add another 5-10 services that you need to notify, or things that need to happen during some event like login. Your solution will become a bottleneck.

In that case, scalability will not be possible. Not to mention that you are violating the core principles of good software architecture.

Activity icon

Replied to Log When A User Logs In

I think that you are missing. I do not know any other way to create truly scalable, decoupled and polymorphic architecture without events. In my mind it is the only way, but maybe I'm just too old 🤣

Activity icon

Replied to Log When A User Logs In

Have you tried listening to \Illuminate\Auth\Events\Login event?

Jul
13
2 days ago
Activity icon

Replied to $collection->chunk With Call Back

Still confused why do you need variable chunking. Is there a screenshot or something that can help visualize the problem?

Activity icon

Replied to $collection->chunk With Call Back

In my mind that does not make sense. Having different sizes chunks is something I've never reached for. Why would you need such a thing?

Activity icon

Replied to Laradock And Phpunit Tests.

Did you install all dev dependencies?

Activity icon

Replied to Laradock And Phpunit Tests.

I'm using docker. PhpStorm is running them for me. Just had to specify a remote interpreter.

Jul
11
4 days ago
Activity icon

Replied to Shell Command Schedule ?

Install new Laravel app and try the same. That way you'll figure out if it is due to your OS or your Laravel app.

Jul
10
5 days ago
Activity icon

Awarded Best Reply on Is This Secure? Why?

Is this something can happen?

No. Emails are unique. Either your user was completely hacked and does not have any access to own online accounts or it is the same person you have in your system. So that case you've described does not make sense.

Activity icon

Replied to Is This Secure? Why?

Is this something can happen?

No. Emails are unique. Either your user was completely hacked and does not have any access to own online accounts or it is the same person you have in your system. So that case you've described does not make sense.

Activity icon

Replied to Shell Command Schedule ?

And what happens when you run that command from terminal from the Laravel root folder?

Activity icon

Replied to Is This Secure? Why?

What's happening here?

Just a simple query SELECT * FROM users WHERE email = '[email protected]' LIMIT 1.

Is this secure against a malicious user?

Yes.

Activity icon

Replied to Shell Command Schedule ?

Where did you find an example of such syntax? I do not recall seeing it in the docs. You have to use terminal commands to generate a command php artisan make:command NameOfTheCommand and then edit the generated file, and then in Kernel you can schedule it.

Jul
09
6 days ago
Activity icon

Replied to How To Structure Tables So Related Tables Id Numbers Stay Secuential?

Just add some column and fill it when creating the record based on previous records for that specific user.

Activity icon

Awarded Best Reply on Chronological List Of Laracasts Videos

https://laracasts.com/search?refinement=type&name=episode
Activity icon

Replied to Auto Increment ID For Each Client Of The User

@stonecold first of all congrats on using search. That is powerful feature that no one uses on forums. Everybody just creates new discussion with answers under their nose.

Can you describe in bit more detail your problem?

Jul
08
1 week ago
Activity icon

Replied to DB Design Best Practice

No. Just have users table with type column.

Activity icon

Replied to Read Data From LDAP Server In Laravel

Just put everything you did in PHP into Laravel controller and start refactoring.

Activity icon

Replied to Query Builder: Multiple Joins Based On Array

@jank if that is solution, please mark it as best answer. Thanks.

Activity icon

Replied to Best Solution To Optimize Page Loding With Laravel

Caleb is talking there about gotchas that you should be aware. Probably you can find all those on internet.

Activity icon

Awarded Best Reply on Retroactively Add Migrations To A Project

  1. Create migrations
  2. Run php artisan migrate on your local machine
  3. Copy data from migrations table as SQL insert statement
  4. Execute that statement on production
  5. Deploy code with migrations on production

That way no migrations will be executed on production since it will have them in migrations table.

Activity icon

Replied to Best Solution To Optimize Page Loding With Laravel

@celotrovi have you watched that video that I've posted in my first reply in this thread? Maybe that can give you better idea of what you are doing wrong.

Activity icon

Replied to Read Data From LDAP Server In Laravel

Laravel is PHP, so what you can do in PHP you can do in Laravel.

Activity icon

Replied to Query Builder: Multiple Joins Based On Array

You can create some function for that to avoid repetition.

Activity icon

Replied to Query Builder: Multiple Joins Based On Array

You have to loop over $leftJoins and add statements to the builder.

$builder = DB::table($table);

foreach($leftJoins as $leftJoin) {
	$builder->leftJoin(...$jeftJoin);
}

$results = $builder->get();
Activity icon

Replied to Load More Data On Scroll With Vue And Vuex

Create an action in Vuex that you call on a scroll, and push result to the state property that contains your data.

Activity icon

Replied to Problem With Relations

Why do you need composite index to be your primary key? I think that you must provide string, not array.

Activity icon

Replied to Query Builder: Multiple Joins Based On Array

If I understand the question, then the answer is, Yes.

Jul
07
1 week ago
Activity icon

Replied to Use Vimeo For Storaging Private Video?

Not sure how it is a generalized comment? It is very specific. I wanted to embed those videos for my project and had same issue as I have here on Laracasts with Vimeo as a provider.

Activity icon

Replied to What Are Best Practices When Writing Tests With PHPUnit ?

@tray2 great article. I think I've been using it a bit longer. I would say from 2017-2018, but maybe I'm mistaking since I've read it in some article also.

Activity icon

Replied to What Are Best Practices When Writing Tests With PHPUnit ?

@tray2 I didn't want to mention data providers since people do not use them in an organized way. But I see you've nailed that one same as me with keys and values.

Activity icon

Replied to Use Vimeo For Storaging Private Video?

Whenever I use my old laptop to watch Laracasts videos it spins up the fans.

Activity icon

Replied to Testing Artisan Command Fails To Resolve Mocks

No need for kissing. Just remember that commands and jobs resolve dependencies from the handle method.

Activity icon

Replied to Use Vimeo For Storaging Private Video?

I know that was an issue years ago, and then an article showed up explaining how to upload longer videos, but I have no idea if that is still an issue.

The only issue I've came across was that you can not upload more than 100 videos per day.

Activity icon

Awarded Best Reply on Testing Artisan Command Fails To Resolve Mocks

Commands resolve dependencies type hinted in the handle method, not in the constructor. Try that.

Activity icon

Replied to Use Vimeo For Storaging Private Video?

For me, Vimeo is not good enough. Especially when users have older laptops, when they watch a video it spins up the fans like crazy. Not sure if there is anything better. I've ended up using YouTube.

Activity icon

Replied to Testing Artisan Command Fails To Resolve Mocks

Commands resolve dependencies type hinted in the handle method, not in the constructor. Try that.

Activity icon

Replied to Getting SQL Query In A Variable

$bindings = $builder->getBindings();
Activity icon

Awarded Best Reply on Getting SQL Query In A Variable

$builder = Vacancy::statusId($request->query('status'))
            ->sellerId($request->query('seller'))
            ->categoryId($request->query('category'))
            ->locationId($selectedLocationId);

$query = $builder->toSql();

$products = $builder->get();