Certified laravel developer at LASE PeCo Systemtechnik GmbH
Member Since 4 Years Ago
Wesel
330 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 Render()
It is a user-defined method, without the source code no one will be able to tell what it does.
Replied to Let's Encrypt With Nginx : Challenge Failed For Domain
Change the well-known section of the config to:
location ~ /.well-known {
allow all;
}
Then you should use the following command, it will take care of nginx for you.
sudo certbot --nginx -d example.com -d www.example.com
For more info read this digitalocean answer.
Awarded Best Reply on Help Converting CURL Request Into Guzzle Request
You are not sending the headers with the get request.
$client = new Client();
$response = $client->get("https://xxxxxxx.xx.auth0.com/api/v2/users/{$userId}" ,[
'headers' => [
"Authorization" => "Bearer {$temp_token}",
"Cache-Control" => "no-cache",
"Accept" => "application/json",
]
]);
echo $response->getBody()->getContents();
Awarded Best Reply on Create An Apache Virtualhost For REST Laravel API
This should work, notice the ServerName
and the ServerAlias
//example.com.conf
<VirtualHost *:80>
ServerName example.local
ServerAlias www.example.local
DocumentRoot /var/www/example/public
<Directory "/var/www/example/public">
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
//api.example.com.conf
<VirtualHost *:80>
ServerName api.example.local
ServerAlias www.api.example.local
DocumentRoot /var/www/api
<Directory "/var/www/api">
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Awarded Best Reply on Why I Have To Use ".default" When Require Some Vue Component To Work?
When using ES6 imports export default Sidebar
, the exported module is of the format {"default" : Sidebar}
.
The import statement import * from Sidebar
handles this assignment for you, however, you have to do the require("./components/Sidebar").default
conversion yourself.
If you want to avoid that, use module.exports
instead of export default
.
Replied to How To Best Handel 1500 Requests A Second
Many thanks for your time and advice, we will start testing with laravel vapor starting tomorrow.
Replied to How To Best Handel 1500 Requests A Second
You are right, any other suggestions on how to handle all these requests in the code
Replied to How To Best Handel 1500 Requests A Second
So if we wanted to manage the server our self, your suggestion would be Amazon aws lambada.
Started a new Conversation How To Best Handel 1500 Requests A Second
In our company, we developed our own cloud web application to gather data from sensors in real-time.
We have the following components:
Laravel 8, PHP 7.4, MySQL 8, Redis 5 used for the queues with horizon, laravel-websockets from beyondcode used to update displays in real-time
Currently, the whole application is hosted on a single droplet on digitalocean, which was not a problem till now, as we currently only receive 16 requests a second from about 40 sensors.
The problem is we need to add another 1000 sensors in December, and we estimate about 1500 requests a second.
We started optimizing our cloud for this high traffic, by hitting the database only when it is really necessary, and using caching when possible, we have also moved all the logic to handle the request from a sensor to a job so that we can queue it and return as soon as possible.
But I wanted to ask the experts here what would they suggest to do, first we want to switch to better infrastructure, like digital ocean kubernetes , or the new app platform, or even something else like amazon aws.
So many options and zero experience with high traffic, what would you suggest.
Replied to Why I Have To Use ".default" When Require Some Vue Component To Work?
When using ES6 imports export default Sidebar
, the exported module is of the format {"default" : Sidebar}
.
The import statement import * from Sidebar
handles this assignment for you, however, you have to do the require("./components/Sidebar").default
conversion yourself.
If you want to avoid that, use module.exports
instead of export default
.
Replied to Create An Apache Virtualhost For REST Laravel API
This should work, notice the ServerName
and the ServerAlias
//example.com.conf
<VirtualHost *:80>
ServerName example.local
ServerAlias www.example.local
DocumentRoot /var/www/example/public
<Directory "/var/www/example/public">
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
//api.example.com.conf
<VirtualHost *:80>
ServerName api.example.local
ServerAlias www.api.example.local
DocumentRoot /var/www/api
<Directory "/var/www/api">
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Replied to PHPStorm Marking Closure As An Error
Try resetting the cache of Phpstorm from the menu:
File Menu -> Invalidate Caches / Restart -> Invalidate and Restart
Awarded Best Reply on Laravel Validation Problem
$request = [
['age' => 25,],
['age' => 15, 'father' => "John Doe"],
['age' => 40,],
];
for ($i = 0; $i < count($request); $i++) {
$validator->sometimes("items.{$i}.father", 'required|min:5', function($data) {
//logic here for $request[$i]['age']
});
}