4,515 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 Search Input And JWT Token
The logout issue is theoretical but i'm pretty sure it gonna happens this way.
I'm gonna try this solution and give a feedback, thanks for that ^^
Replied to Search Input And JWT Token
Yes I use this package and no, I use the middleware this way and the token is automatically set in the response as authorization header.
Route::group(['middleware' => ['jwt.auth', 'jwt.refresh', 'api']], function () {});
In my front I have interceptors that update the token after each call. The TTL is indeed set on 20 minutes. But I don't want my user to be disconnected after 20 minutes if he's active on the app.
Replied to Search Input And JWT Token
@niush The token has a 20 minutes lifetime when there is no activities on the account. It refresh it each time a request is made to avoid the user to be disconnected after 20 minutes.
To be honest, this is JWT package which manage that and I have not look further for other solutions to manage but i'm open to any idea.
Started a new Conversation Search Input And JWT Token
Hi ,
I'm facing a problem one of you may already have encountered. For the context i'm using laravel 7 as REST API and Vue2 CLI as an SPA for my front .
Both are different project in different folders. I use JWT auth to auth my client into the back. At each call of the back, I refresh the token, which comes back as a header in the response and I update it with interceptors.
My question is, on a page where you can manage some uploaded documents, there is a search bar (searching by document name). When I type in this input, it should trigger an XHR to my API. But, the problem is if the request takes more time to answer than the user to type the next letter on the search, it gonna log out my user (Token is gonna be blacklisted in api side). I've thought about using a debounce time but same, this is a static time of delay i'm entering, but what if my request needs more time than the debounce time ?
I'm sure one of you must have met this problem once, no ?
Started a new Conversation Valet Requires Homebrew To Be Installed On Your Mac
I'm working on a project which use nextcloud as a document manager and when i'm upload a file, I want to launch nextcloud files sync so I use envoy to manage my command.
My command works when i type it in the CLI, it works when i'm running a test of my store
new document. But when I use it the normal way through the interface and add a document, the buffer logs me : Valet requires Homebrew to be installed on your Mac
.
Of course I have homebrew on my Mac and i'm running anything related to valet in my task.
@servers(['localhost' => '127.0.0.1'])
@task('synchronize', ['on' => 'localhost'])
cd {{ $path }}
docker-compose exec -T --user www-data app php occ files:scan {{ $user }}
@endtask
As I said, it work manually and through a unit test but not when i'm using it from my interface... Any Idea ?
EDIT: Here are my logs
[2020-09-09 07:41:33] local.DEBUG: Nextcloud Syncronized
[2020-09-09 07:41:33] local.DEBUG: ["Valet requires Homebrew to be installed on your Mac."]
[2020-09-09 07:47:06] testing.DEBUG: Nextcloud Syncronized
[2020-09-09 07:47:06] testing.DEBUG: ["Starting scan for user 1 out of 1 (admin)\n","+---------+-------+--------------+\n| Folders | Files | Elapsed time |\n+---------+-------+--------------+\n","| 28 | 13 | 00:00:01 |\n+---------+-------+--------------+\n"]
testing env is my unit test and local is my normal env for dev. nothing changes between the 2 except DB credentials
Started a new Conversation Symfony Process: No Such File Or Directory
Hi fellow developers,
I experienced Envoy and Laravel this afternoon and everything work fine until i'm trying to exec the command from the code.
$command = ["~/.composer/vendor/bin/envoy run synchronize", " --path={$path} --user={$user}"];
$process = new Process($command);
$process->run(
function ($type, $buffer) use ($result) {
dd($buffer);
$buffer = str_replace('[127.0.0.1]: ', '', $buffer);
$result[] = $buffer;
}
);
Here is the code i'm trying to run. the dd I got in $buffer
returns me this :
sh: /Users/David/.composer/vendor/bin/envoy run synchronize: No such file or directory\n
sh: line 0: exec: /Users/David/.composer/vendor/bin/envoy run synchronize: cannot execute: No such file or directory
I've tried to execute ~/.composer/vendor/bin/envoy run synchronize --path=myPath --user=myUser
manually and it works just fine. But no way to get it working from my function.
The function is in a class i'm just calling from a unit test :
/** @test */
public function files_are_scanned() {
dd((new NextCloud())->synchronize(true));
}
EDIT: the problem is that Process
escape my arguments and add a '
on my command so it doesn't work.
I don't know how to avoid that. This function is modifying my command:
private function escapeArgument(?string $argument): string
{
if ('' === $argument || null === $argument) {
return '""';
}
if ('\' !== \DIRECTORY_SEPARATOR) {
return $argument;
return "'".str_replace("'", "'\''", $argument)."'";
}
if (false !== strpos($argument, "LARACASTS_SNIPPET_PLACEHOLDER")) {
$argument = str_replace("LARACASTS_SNIPPET_PLACEHOLDER", '?', $argument);
}
if (!preg_match('/[\/()%!^"<>&|\s]/', $argument)) {
return $argument;
}
$argument = preg_replace('/(\\+)$/', '', $argument);
return '"'.str_replace(['"', '^', '%', '!', "\n"], ['""', '"^^"', '"^%"', '"^!"', '!LF!'], $argument).'"';
}
I've tried to return the argument without modifying it and it works.