Member Since 4 Months Ago
4,000 experience to go until the next level!
In case you were wondering, you earn Laracasts experience when you:
Earned once you have completed your first Laracasts lesson.
Earned once you have earned your first 1000 experience points.
Earned when you have been with Laracasts for 1 year.
Earned when you have been with Laracasts for 2 years.
Earned when you have been with Laracasts for 3 years.
Earned when you have been with Laracasts for 4 years.
Earned when you have been with Laracasts for 5 years.
Earned when at least one Laracasts series has been fully completed.
Earned after your first post on the Laracasts forum.
Earned once 100 Laracasts lessons have been completed.
Earned once you receive your first "Best Reply" award on the Laracasts forum.
Earned if you are a paying Laracasts subscriber.
Earned if you have a lifetime subscription to Laracasts.
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.
Earned once you have achieved 500 forum replies.
Earned once your experience points passes 100,000.
Earned once your experience points hits 10,000.
Earned once 1000 Laracasts lessons have been completed.
Earned once your "Best Reply" award count is 100 or more.
Earned once your experience points passes 1 million.
Earned once your experience points ranks in the top 50 of all Laracasts users.
Earned once your experience points ranks in the top 10 of all Laracasts users.
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?
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?
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!
I think I will have to do this, but how can I avoid
users relation being added to the expression variable?
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.
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.
Yeah, the problem is I'm using Lighthouse and a controller, so I need a more maintainable way to accomplish this.
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?
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?
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.
Replied to Laravel 8 CORS For Subdomain API
Yes, that was the solution. Thank you!
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'
'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?