astersnake

Member Since 4 Months Ago

Experience Points
1,000
Total
Experience

4,000 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
6
Lessons
Completed
Best Reply Awards
0
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 1
1,000 XP
Jan
12
3 days ago
Activity icon

Started a new Conversation Delay Between Retries In Failed Jobs Using Laravel Horizon

Hi, is there any way to add a delay between retries in Horizon?

This is my worker configuration:

        'supervisor-1' => [
            'connection' => 'redis',
            'queue' => ['default'],
            'balance' => 'auto',
            'maxProcesses' => 1,
            'memory' => 128,
            'tries' => 10,
            'timeout' => 50,
            'nice' => 0,
        ],

So far, I have to do it in every job using backoff, but is possible in Horizon for all jobs?

Jan
04
1 week ago
Activity icon

Started a new Conversation Check Why Job Attempt Failed

Is there any chance to check why a job failed when there still attempts remaining?

Now, I have to wait until the job fails because exceeds the maximum number of attempts, but I can't figure out how to check if is currently failing. Is there any event fired?

Dec
10
1 month ago
Activity icon

Replied to With Eloquent Return True Or False If User Has Shared A Post

Yeah sorry, I didn't use the correct term. Even if I remove with('users') from my query I still get users added after $expression->users->contains($user) line. Anyway, I will unset it, due is only used one time. Thank you!

Activity icon

Replied to With Eloquent Return True Or False If User Has Shared A Post

I think I will have to do this, but how can I avoid users relation being added to the expression variable?

Activity icon

Replied to With Eloquent Return True Or False If User Has Shared A Post

The problem is I need to do this with every post. When I get all the posts from the database I need to know for every post if it's shared by the user or no.

Activity icon

Started a new Conversation With Eloquent Return True Or False If User Has Shared A Post

I have posts and users. Users can share posts. With $post->users() I can check all users that have shared the post. Also, I have a table for the Many to many relationship.

I want to return true or false if a User has shared a Post, how can accomplish that?

So long this is my current code:

$posts = Post::with('labels:id')
            ->with('users:id')
            ->paginate(15);

So currently I return every user has shared the post. I want to avoid this, an check if a post has been share by a particular user.

Thanks!

Nov
23
1 month ago
Activity icon

Replied to Limit The Number Of Records Created Per Day In A Model

Yeah, the problem is I'm using Lighthouse and a controller, so I need a more maintainable way to accomplish this.

Activity icon

Started a new Conversation Limit The Number Of Records Created Per Day In A Model

For example, I have 'posts' and I want to limit the numbers of posts that can be created per day, what is the best way to accomplish this? Anyway to it at model level?

Oct
28
2 months ago
Activity icon

Started a new Conversation Can't Run Laravel Horizon, Error In Laravel\Horizon\ProvisioningPlan::__construct()

I'm getting the following error:

Argument 2 passed to Laravel\Horizon\ProvisioningPlan::__construct() must be of the type array, null given, called in /Users/camilo/Documents/development/laravel/via-express/vendor/laravel/horizon/src/ProvisioningPlan.php on line 58

I don't know why, the horizon installation is fresh. I ran the following commands:

composer require laravel/horizon
php artisan vendor:publish
php artisan horizon

Also, can't find anything related to this error on the internet. Any ideas?

Oct
07
3 months ago
Activity icon

Started a new Conversation Receive A Non GraphQL Post Request In A GraphQL

I am using sends back a POST request to an URL specified by me. The problem is that I am using GraphQL and I don't feel like it's a very nice thing to do a REST API just for that. Any elegant way to resolve this?

I'm using Laravel 8.x and Laravel Lighthouse.

Sep
14
4 months ago
Activity icon

Replied to Laravel 8 CORS For Subdomain API

Yes, that was the solution. Thank you!

Activity icon

Started a new Conversation Laravel 8 CORS For Subdomain API

I'm using Laravel to serve a GraphQL API, using Lighthouse. Everything works fine when I use grapqhl as a URI in the main domain, but when I use it in a subdomain eg. grapql.app.test I get the next error:

Access to fetch at 'http://graphql.app.test/' from origin 'http://app.test' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin'

My config\cors:

'paths' => ['api/*','graphql'],
'allowed_methods' => ['*'],
'allowed_origins' => ['*'],
'allowed_origins_patterns' => [],
'allowed_headers' => ['*'],
'exposed_headers' => [],
'max_age' => 0,
'supports_credentials' => false,

How can I solve this?