bugsysha

Member Since 5 Years Ago

Experience Points
449,715
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
1913
Lessons
Completed
Best Reply Awards
364
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.

  • Community Pillar

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

Level 50
449,715 XP
Mar
05
1 day ago
Activity icon

Replied to 27 Statements Were Executed, 26 Of Which Were Duplicated, 1 Unique

Doesn't debugbar tell you what initiated those queries? Exact file and line?

Activity icon

Replied to Load More Instead Of Pagination

Initial response is stored in some array on the React component. You remember what the next URL is from initial paginated response and when you load more, then just append to that same array you have on the React component new data you got from response. Nothing complicated.

Mar
04
2 days ago
Activity icon

Awarded Best Reply on Looking For Laravel CI/CD Premium Tutorials On Aws K8s Or Ecs

On this site there is a link for GitHub actions tutorial with Laravel. Also based on that video it looks like this course will be nice for that topic. Maybe that is enough for you to figure out the rest. Give it a try.

Mar
03
3 days ago
Activity icon

Replied to Dusk Testing

How did you forget to say that you are running it in Sail? Have you tried everything from the docs regarded to Sail and Dusk? https://laravel.com/docs/8.x/sail#laravel-dusk

Activity icon

Replied to Dusk Testing

And what happens in the browser when you go to that URL? http://0.0.0.0:88/

Does it work if you run php artisan serve?

Activity icon

Replied to How To Check Laravel CPU Usage In Shared Host?

Laravel is not the best choice for shared hosting. Laravel doesn't abuse CPU so if it is related to your Laravel site it is caused by your code or some package you are using. You should profile your Laravel app locally with XDebug and figure out if there are any issues.

Mar
02
4 days ago
Activity icon

Replied to Analytics Dashboard - Visitors Country Without Many API Calls

Nobody is blaming you. It is just no useful and hard to figure out from given info. That is just another thing we need to master in order to communicate well with other developers.

Activity icon

Replied to Connecting TablePlus To Localhost

@xtremer360

This way in case I'm working on multiple apps at the same time I can have their database names to be different.

I shutdown the current "sail" and start a different/new one. That way I never have to think about which port I need to use to access the database or any of services running in containers.

Activity icon

Replied to Filter Pivot Table Of Product_categories

Yeah, that will do also.

Activity icon

Awarded Best Reply on Are Livewire Components Secure If They Are Not Shown?

But I was wondering, if I place a component inside a if/else or can. Will anyone be able to use/tinker with them, or will it only work if it's displayed?

It will only work if displayed/rendered.

Activity icon

Replied to Best Coding Practice: URI Vs Action() ?

I think that most developers use route() helper function, but I like action() more. If I'm sole developer I use actions. If I join the team with existing project then I use what was most used in that project.

If you have a huge project I advise that you use full path (literal URI as you call it) cause it will make life easier for everyone since if you have more routes with similar names you will have problems tracking them down.

Activity icon

Replied to Is It A Good Idea To Mix A Lot Of Files?

Depends on their use. If you need all of them all the time then mix them and set not to expire that often. If you need only few of them then leave them separated.

Activity icon

Replied to Filter Pivot Table Of Product_categories

Ex: i want to get events which has category slug "entertainment" . How to do that dynamically?

Product::with('Categories')->whereHas('categories', function ($query) use ($categoryName) {
  $query->where('category_name', $categoryName);
})->orderBy('id','DESC')->get();

if i use whereHas it will scan full table. will it affect the performance if my table has 10000 records for each category?

Affect performance compared to what? More complex queries are slower, but there is no faster way to do it if that is what you are asking.

Activity icon

Replied to Are Livewire Components Secure If They Are Not Shown?

But I was wondering, if I place a component inside a if/else or can. Will anyone be able to use/tinker with them, or will it only work if it's displayed?

It will only work if displayed/rendered.

Activity icon

Replied to Analytics Dashboard - Visitors Country Without Many API Calls

Yeah I was trying to be funny so I don't insult you. The reason why nobody replied besides me is cause your description of a problem is very confusing and there is no real question there.

Mar
01
5 days ago
Activity icon

Replied to Discount For One Category

but this will not happen

What code did you write to make this happen?

Activity icon

Replied to Autofocus On Field In Jetstream Dialog-modal Using Livewire

I don't see autofocus attribute anywhere in your code. What have you tried?

Activity icon

Replied to Redirect Domain With Params To Addon Domain

Visit your site page and click on redirects and add the rule.

https://forge.laravel.com/servers/123456/sites/654321#/redirect-rules
Activity icon

Replied to How To Protect Axios Api Requests, With Basic Laravel Authentication?

What do you consider as "Laravel basic authentication"? Cause JWT is not basic auth for Laravel.

Activity icon

Replied to Laravel Cookie Not Loading In Frontend

My request from Frontend

Your "frontend" request looks like backend request.

Activity icon

Replied to Analytics Dashboard - Visitors Country Without Many API Calls

Thank you!

You are very welcome.

Activity icon

Replied to Discount For One Category

What is the problem?

You need to tell us what is the problem, not the other way around.

Feb
28
6 days ago
Activity icon

Replied to How To Place Order Evenly To Managers On Laravel?

If you have 10 managers then track order count (or use ID) and use % operator. You don't need a package for such a simple thing.

Activity icon

Replied to Connecting TablePlus To Localhost

Post a screenshot of your TablePlus connection.

Activity icon

Replied to Looking For Laravel CI/CD Premium Tutorials On Aws K8s Or Ecs

On this site there is a link for GitHub actions tutorial with Laravel. Also based on that video it looks like this course will be nice for that topic. Maybe that is enough for you to figure out the rest. Give it a try.

Feb
27
1 week ago
Activity icon

Replied to Policies: Add Global Filter

Maybe you should just create a simple middleware that ensures your clients meet the required criteria to access the pages.

Activity icon

Replied to Where To Learn? ... Tried Laracasts!

Does anyone have a good resource of modern Laravel tutorials please, preferably if they are building a project too.

Have you watched Let's Build A Forum with Laravel and TDD?

Feb
25
1 week ago
Activity icon

Replied to Is It A Good Practice To Add Custom Verbs To Policies?

Is it a good practice to add custom verbs to Policies?

Yes. I usually try to break down those verbs since they tend to be same as some other rule from basic verbs. But when that is not the case then I create custom ones.

Feb
24
1 week ago
Activity icon

Replied to IndexQuery In Laravel Nova For Many To Many Polymorphic Relationship

Show your database structure and relationships.

Activity icon

Replied to Php Service Extension Problem

Show the code. Error can be due to simple typo to who knows what reason.

Activity icon

Replied to How To Calculate Job Bandwidth Consumption?

$response = \Illuminate\Support\Facades\Http::get('google.com');
$size = strlen($response->body());
Activity icon

Awarded Best Reply on How To Land On A Named Anchor From A Redirect.

return redirect()->to('/something#1234');
Activity icon

Replied to Is It Possible To Upload A File With Other Data On The Same Request ?

I mentioned to @godzilaravel yesterday that the only option here is to put the JSON content in a Blob, allow the original types to be maintained whenever there is an image in the request.

@tykus thanks for letting us know.

@godzilaravel if I understand the situation correctly, why don't you listen to given advice, but instead you create another topic?

Activity icon

Replied to Is It Possible To Upload A File With Other Data On The Same Request ?

@godzilaravel I don't see anything wrong there. Did you try using full syntax axios.patch(url[, data[, config]])?

Activity icon

Replied to What Is Best Practice For Table Deleting ? OnDelete('restrict') Or OnDelete('null') Or OnDelete('cascade')

In my opinion it is a lazy developer way. Proper way would be to implement that into your codebase. So if it ever happens for you to switch to some database that does not support that feature you will not have a thing to worry about. I really don't see why the database should contain any business rules and everything should be explicit in the code.

Activity icon

Replied to How To Land On A Named Anchor From A Redirect.

return redirect()->to('/something#1234');
Activity icon

Replied to Is It Possible To Upload A File With Other Data On The Same Request ?

Are you using enctype=multipart/form-data?

Activity icon

Replied to Laravel Docker Hosting

With Vapor I wouldn't think about anything else. Reason for it is I've tried a bunch of services for hosting Laravel apps and none of them was as seamless as Forge. I'm pretty sure same thing goes for Vapor.

Activity icon

Replied to Homebrew PHP

I do not have it installed locally cause I'm using docker, but you can check nginx and php logs. They should be somewhere in /usr/local/var/log.

Feb
23
1 week ago
Activity icon

Replied to Can't Run Tests When Using Dependency In Command

Sure.

  1. It causes problems with testing.
  2. If you type hint that class in some other class that is resolved out of the container you increase framework boot time, and that might happen on every request.
  3. If you have multiple instances of that class you will query the database each time but you probably need to do it only once.
  4. Your database calls should be peripheral and not coupled to core business domain logic.
  5. What if the business rules change and you need to fetch the data at later stage, you would have to do it twice or to move it. Colleague of mine who was supposed to be promoted to lead position over me made this mistake and I've nagged him for weeks about it and he ignored me until the business logic change was requested which prove that I was right about the concerns of having that stuff inside of constructor.
  6. Query can fail.
  7. Constructor shouldn't do any work.
  8. When the class is extended it will do additional queries.

And so on... I'm sure that the internet is full of reasons why you shouldn't do it in the constructor so just Google a bit cause it is a bit fat no-no.

Hope this was clear enough and I didn't just confuse you further.

Activity icon

Replied to Homebrew PHP

Any suggestions?

Reboot.

Activity icon

Replied to Can't Run Tests When Using Dependency In Command

I have a service class VideosHandler in which constructor I get database records for further usage in this service class.

You should avoid doing that. Numerous problems can happen from that kind of implementation. Move that outside of the __construct method and do not call it on object construction.

Activity icon

Replied to What's The True Benefit Of Using SaveOrFail() Instead Of Save()?

Then when should we use saveOrFail()??

I usually do not use it. From those *OrFail methods I think I only use firstOrFail.

Activity icon

Awarded Best Reply on Difference Between ActingAs($user) And Auth::login($user)?

$this->actingAs() is just setting the user to current guard. Auth::login() is updating the session, remembering the user by setting the token and cookie, and it is firing the events and setting the user to the guard.

For tests you should only use $this->actingAs() or $this->be().

Also, you should not assert that the resource is not found, you should assert that it is forbidden to access that resource.

Activity icon

Replied to Difference Between ActingAs($user) And Auth::login($user)?

Could you please elaborate on this?

Sure. There is nothing smart about it. If you use single database and that record exists then you found it but just do not allow the user to see it since that specific user is not the "owner" of that record. If you are using multiple databases and you try to access a record which does not exist in that database then it is OK to respond with not found.

From your code I would say that you have the first scenario and you should send forbidden response.