Member Since 5 Years Ago
0 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.
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?
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.
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.
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
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
?
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.
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.
Replied to Connecting TablePlus To Localhost
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.
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.
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.
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.
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.
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.
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.
Replied to Discount For One Category
but this will not happen
What code did you write to make this happen?
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?
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
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.
Replied to Laravel Cookie Not Loading In Frontend
My request from Frontend
Your "frontend" request looks like backend request.
Replied to Analytics Dashboard - Visitors Country Without Many API Calls
Thank you!
You are very welcome.
Replied to Discount For One Category
What is the problem?
You need to tell us what is the problem, not the other way around.
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.
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.
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.
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?
I know, just kidding ;)
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.
Replied to IndexQuery In Laravel Nova For Many To Many Polymorphic Relationship
Show your database structure and relationships.
Replied to Php Service Extension Problem
Show the code. Error can be due to simple typo to who knows what reason.
Replied to How To Calculate Job Bandwidth Consumption?
$response = \Illuminate\Support\Facades\Http::get('google.com');
$size = strlen($response->body());
Awarded Best Reply on How To Land On A Named Anchor From A Redirect.
return redirect()->to('/something#1234');
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?
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]])
?
Thanks.
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.
Replied to Is It Possible To Upload A File With Other Data On The Same Request ?
Are you using enctype=multipart/form-data
?
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.
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
.
Replied to Can't Run Tests When Using Dependency In Command
Sure.
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.
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.
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
.
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.
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.