bugsysha

bugsysha

Member Since 4 Years Ago

Experience Points
264,525
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
1644
Lessons
Completed
Best Reply Awards
137
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
264,525 XP
Mar
26
3 days ago
Activity icon

Replied to UUID Foreign Key - Unable To Add Constraint

With Laravel 7 there is no need to do it that way unless you have a specific reason for it which you haven't mentioned. Check this out https://laravel.com/docs/7.x/routing#implicit-binding

Route::get('api/posts/{post:slug}', function (App\Post $post) {
    return $post;
});

Route::get('api/users/{user}/posts/{post:slug}', function (User $user, Post $post) {
    return $post;
});
Mar
25
4 days ago
Activity icon

Replied to Laravel Complex App Structure Following Solid Principles

I think I didn't explain myself well.

Yes, you did explain everything thoroughly. I've just tried to avoid answering that question since there is no consensus on that topic, and you should try to develop your own opinion on it.

But since you are asking politely again, let me give you my idea of how it should work, but take it with a grain of salt.

Should service class make calls to a repository?

If you can avoid it, it would be better. Check out this article since it probably can better explain than I can in few sentences https://reinink.ca/articles/optimize-database-queries-in-the-perimeter-of-your-laravel-apps

It is good practice to put queries logic in the repository?

If you are thinking of Eloquent queries, then yes, with repositories, you force people to give more meaningful names, especially on large projects/teams. If someone is not using repositories, then they might create few scopes to do a specific query, but other developers might miss to include all of those scopes when they try to fetch the same data. And for me, it is more meaningful to test those repositories than separate scopes.

As I do not plan to switch between ORMs, should I put queries logic in my model or create a repository and store my queries logic there?

I think I've answered this one with the previous question.

Mar
24
5 days ago
Activity icon

Replied to Login Throttle - Wrong Http Error

Which auth package? Have you seen a lesson here on Laracasts on throttling? Check that out, maybe it can help you figure out what you've missed. I do not use it that often but whenever I've used it, it worked.

Activity icon

Replied to Laravel Complex App Structure Following Solid Principles

You will not see any common opinions on this topic. Check this link out, maybe it will help you with your structure.

https://dev.mysql.com/doc/sakila/en/sakila-installation.html

Activity icon

Replied to View Count On Forum

For me, Laracasts is almost a few times per day, unable to load content. And post times still have issues.

Mar
23
6 days ago
Activity icon

Replied to API And Route Model Binding

Try to reproduce that bug without changing anything in a fresh Laravel install and you should see that everything is working. That would be such a huge bug that everyone would notice it and it would be fixed very fast.

Mar
21
1 week ago
Activity icon

Replied to How To Use Newly Created Column In Query And Compare It Using Having?

@drewlim7 just register new account every day and like all replies that helped for the next 20-30 years. That should be enough.

😂😂😂

Mar
20
1 week ago
Activity icon

Replied to API For Social Social Listening.

What is social listening?

Activity icon

Replied to I Try To Recreate Jeffrey WayReports-and-Graphs

@ivanradojevic

["2020-03-16T14:44:02.000000Z","2020-03-18T09:07:25.000000Z"],

This looks like you are doing something like {{ $dates }}? If I'm right then you should resolve this with {!! $dates !!}.

Activity icon

Replied to Best Dashboard

The one which you've built and others pay you to use :D

Activity icon

Replied to How To Use Newly Created Column In Query And Compare It Using Having?

Yeah. I'm confused about how people miss noticing that.

Activity icon

Replied to Append Custom Attribute That Comes From Merging Columns Of Related Models Without Appending Entire Objects

@jjk I'm saying that you should not return contact name also. Just contact ID if you care about data size. But never mind. Point is do not fetch from objects properties on other objects.

Activity icon

Replied to Append Custom Attribute That Comes From Merging Columns Of Related Models Without Appending Entire Objects

@jjk

If you are so worried about data size then you should not return anything from contact object except ID.

Activity icon

Replied to How To Use Newly Created Column In Query And Compare It Using Having?

@drewlim7 one note. If those columns likes and comments are on that other database then just replace with with join.

Report::query()
        ->selectRaw('report_id, influencer.u_id, likes + comments as total')
        ->join('influencer', 'influencer.u_id', '=', 'report.u_id')
        ->whereBetween('total', [0, 20000])
        ->get();
Activity icon

Replied to Append Custom Attribute That Comes From Merging Columns Of Related Models Without Appending Entire Objects

I'm saying that you should not break encapsulation. If you have something on one object (Contact), do not fetch it from other object (Order). Your app will face a rock bottom if you continue down that path.

Activity icon

Replied to How To Use Newly Created Column In Query And Compare It Using Having?

@drewlim7

This should work unless you have some hidden gotchas that we can not know of.

Report::query()
        ->selectRaw('report_id, influencer.u_id, likes + comments as total')
        ->with('relationshipName')
        ->whereBetween('total', [0, 20000])
        ->get();
Activity icon

Replied to Take Login Web Routes And Convert To Api

It provides you a simpler way to handle auth via API. You would not have to bother with many things that you would have to think about and implement with Passport.

Activity icon

Replied to Append Custom Attribute That Comes From Merging Columns Of Related Models Without Appending Entire Objects

return $this->contact->name;

This is not appending. It is first doing $this->contact which fetches full Contact object and then you are just getting name from that object.

Activity icon

Replied to HasOne Not Show Anything

As I see it DigitalOcean is a provider and Server is one of their Droplets. So with one2one relationship, it turns out that DigitalOcean can provide only one Droplet to whoever comes first to their site and creates a server.

Activity icon

Replied to Laravel Disable Loading Any Subdomain

Do you know how to disable access using htaccess ?

No. I haven't used Apache for decades.

Ex: if someone tries to access a subdomain to redirect to the /

You can redirect inside Laravel if you want to go down that path.

Just create a route and redirect to that domain without subdomain.

Activity icon

Replied to API And Route Model Binding

What have you changed in Http kernel? Or are you doing something with middleware in Service providers? Or maybe some package you've installed?

Activity icon

Replied to 2 Tables LeftJoin And Get Inverse Relationship Eager Loading Not Working

That is such a bad architecture design that I would make you do a million pushups for it 🤣

Activity icon

Replied to Take Login Web Routes And Convert To Api

Use Laravel Airlock (at least that is what it's called at the moment) for that.

Activity icon

Replied to Searching For Projekt Helpers In Germany

Why is German a requirement?

Activity icon

Replied to Laravel Disable Loading Any Subdomain

Have you configured the HTTP server and DNS for that VPS? It looks like your configuration is not correct.

Activity icon

Replied to HasOne Not Show Anything

Also having one2one relationship there does not make sense to me. I think that Provider can have many Servers.

Activity icon

Replied to HasOne Not Show Anything

Table providers has a provider_id column.

Is this a typo or not? Cause providers table should not have reference to itself.

Activity icon

Replied to 2 Tables LeftJoin And Get Inverse Relationship Eager Loading Not Working

The LEFT JOIN keyword returns all records from the left table, even if there are no matches in the right table.

Activity icon

Replied to API And Route Model Binding

Your problem is caused by using web and auth:api middleware on same route. Split it into two routes. One prefix with api and other without it.

Activity icon

Replied to Laravel Valet Issues Working With WordPress

For those things I use builtin php server. It is great that all my projects are under same URL http://127.0.0.1:8000 😌

Activity icon

Replied to Append Custom Attribute That Comes From Merging Columns Of Related Models Without Appending Entire Objects

You can not get an attribute of some related object which is on separate database table without getting that object from the database.

Mar
18
1 week ago
Activity icon

Replied to Running Downloaded Project

Probably those two files have the same class names. Rename wrongly named one or remove which is appropriate.

Activity icon

Replied to How To Send Different Notifications To Different People In Laravel Notification

If it relates only to that notification you are sending, then put it inside of that notification class.

Mar
17
1 week ago
Activity icon

Replied to Running Downloaded Project

The project is in Laravel 5.6 and I have PHP 7.4 installed, maybe that's the problem or part of it.

That should not be a problem.

Activity icon

Replied to Running Downloaded Project

Hard to help without insight into code. I had a similar issue and I fixed error by error.

Activity icon

Replied to How To Send Different Notifications To Different People In Laravel Notification

  public function toMail($notifiable)
  {
     $message = new MailMessage;
	$message
        ->subject($this->details['subject'])
        ->greeting($this->details['greeting']);

	if (/* condition */) {
		$message->line($this->details['line1']);
	}

	$message
        ->line($this->details['line2'])
        ->line($this->details['line3'])
        ->line($this->details['thanks']);
  }
Activity icon

Replied to Generating A Random Hex Color For Each New User

You can use the cache for that if you do not want to store it in the database.

cache()->forever('user-color' . $user->id, $color);
Activity icon

Awarded Best Reply on Returning An Error

I guess you can replace Error Handler and do whatever you like https://laravel.com/docs/7.x/errors

Mar
16
1 week ago
Activity icon

Replied to HTML U.I For Smart TV

That smart TV does not feel smart at all :D

Mar
14
2 weeks ago
Activity icon

Replied to HTML U.I For Smart TV

Every larger TV manufacturer has either it's own app store, or it is using something that provides such a feature to it. I guess that it all comes down to publishing an app to it, and after they approve it (if there is QA), then you are all set.

Activity icon

Awarded Best Reply on User Role Based Model Functionality

Should I add all relations to the User model, even if they're not applicable to some user roles?

Yes, add them.

Just do not overcomplicate it. Go with the simplest solution. If you want to clean up the User model, then add simple traits to encapsulate common logic for specific user types.

Mar
13
2 weeks ago
Activity icon

Replied to Computed Setter And Getter For Array

Showing me a broken example without an explanation of what you are trying to achieve does not help. Use words to describe the desired behavior.

Activity icon

Replied to Any Equivalents To Laracasts But For Node?

I am looking for a good website or resource to kick-start my learning with NodeJS specifically Express

I'm not aware that something like that exists.

Also, I am curious if JavaScript back-ends have proven themselves to be good alternatives to something like Laravel, or Rails.

Yes, but no. They are used by "smart" companies, but still not that common in lower-tier market companies. Not sure if there is some specific reason for it.

Activity icon

Replied to User Role Based Model Functionality

Should I add all relations to the User model, even if they're not applicable to some user roles?

Yes, add them.

Just do not overcomplicate it. Go with the simplest solution. If you want to clean up the User model, then add simple traits to encapsulate common logic for specific user types.

Activity icon

Replied to Computed Setter And Getter For Array

I'm not sure I understand what you are doing here. If you are looping through arr then why do you need getter and setter for it? Operate directly on it.