Zak

Zak

Member Since 3 Years Ago

Experience Points 40,650
Experience Level 9

4,350 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 391
Lessons
Completed
Best Reply Awards 2
Best Reply
Awards
  • start-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-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-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist 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.

14 Dec
9 months ago

Zak left a reply on How Can I Share An Object Instance Between Two Controllers?

@DIGITALIZED - Sweet! Haha believe me, it took me quite some time before I was able to become comfortable with the service container; it's very daunting but incredibly powerful! Good luck!

Zak left a reply on How Can I Share An Object Instance Between Two Controllers?

@DIGITALIZED - Okay I figured, being that you cannot call two separate methods on two separate controllers from a single request.

On each request, the entire application is run again, meaning that any data you bound to the container will not be available in any subsequent requests. You can possibly save the assessment in a persistence-layer (the database) and save the assessment identifier in the session.

Alternatively, you might be able to create the assessment and have an assessment id in the URI, where it may be accessed from any other request, including in any other methods where you may need access to the data.

Zak left a reply on How Can I Share An Object Instance Between Two Controllers?

How exactly are these two controllers being used? Are you referring to the "show" method on controller 1 being called on one request, and the "assess" method on controller 2 being called on a subsequent request?

13 Dec
9 months ago

Zak left a reply on Why Is A Function Necessary In Route::get?

That is an anonymous function, and you can do whatever you'd like in there. The reason it's like that by default is because it may be a handy starting point to test stuff out.

Laravel also has a view() method on the Route facade, so you can clean it up by doing something like this:

// Register a GET endpoint at '/' that returns the 'welcome' view
Route::view('/', 'welcome');

It is also worth mentioning that most IDEs will not be able to index Laravel methods and classes, simply because the framework resorts to a lot of magic methods. I do however believe there are Laravel plugins that you can get for PHPStorm that will let you do stuff like this.

12 Dec
9 months ago

Zak left a reply on TemporarySignedRoute, Expiry

Since the expiration date is baked into the URL, you cannot manually make a link expire. Can't you perform this logic in the controller?

Say, when a user submits a comment, check if they have previously submitted one before creating a new one, then just return back with an error or something. Or, better yet, have this logic in a middleware or in an authorization policy on the create page, so that a user who has already left a comment won't even be able to see the comment create form.

If the comment form is on the page as something else, have an @if block in blade that checks if a comment was left on a particular project by a particular user, if so, don't show the create form.

11 Dec
9 months ago

Zak left a reply on Why Is My Ajax Response JS Redirect Not Working?

Try instead using window.location.href = '/checkout'. It is also worth mentioning that replacing the window's location disables the ability for the user to go back, as well.

Zak left a reply on Laravel Does Not Display Images In The View From Storage Folder

So you're editing the repository but you each have it installed on your machine?

Are you trying to upload something to commit it to the repository? Laravel by default ignores the storage directory when using version control. Is this what you are talking about?

06 Dec
9 months ago

Zak left a reply on Best Way To Handle Passport Expirations

@ERIKVERBEEK - Awesome, thank you for this!

Zak left a reply on Can't Integrate Tailwindcss Within Electron-Vue

@ADAMKEEN - I'm sad I didn't notice that haha. Good to hear!

Zak left a reply on Can't Integrate Tailwindcss Within Electron-Vue

This seems to have been a problem for others, as well. There is this answer on the GitHub issues page, and a seemingly good starter kit that has Tailwind installed by default.

Zak left a reply on Best Way To Handle Passport Expirations

You can schedule an artisan command to do this for you.

The command can iterate through the passport tokens and check their expiration dates, chunking through the records 250 at a time, using Carbon's awesome helpers. I haven't tested the following code myself, but it might look something like this:

Token::chunk(250, function ($tokens) {
    $tokens->each(function ($token) {
        if ($token->expires_at->gt(now()) && $token->expires_at->lt(now()->addDays(2))) {
            // Token about to expire
        }

        if ($token->expires_at->lte(now()) {
            // Token expired
        }
    });
});

Zak left a reply on Building An SDK For An API

I can't recall any instances where Jeffrey did this, but you can take a look at the Laravel Forge SDK and see if there's enough there to give you a good starting point.

Zak left a reply on Settings Package

@PACKY - That looks promising! Good luck!

Zak left a reply on Settings Package

You mentioned that you're using Nova, correct? You can reach for another Spatie package called media library to handle image uploading. Someone already made a Nova package for handling uploads and such using this package.

I've never used Nova but I am sure you can hook into some upload event and set an image settings through that. That's what I might do at least; not sure how much you want to write yourself.

Zak left a reply on Trying To Log Request From Webhook Post

I hope I am wrong about this, but as far as I am aware you cannot dump all of the request data (not just request queries or parameters) to the log.

You can take a look at the Telescope request logger to see how to get a decent amount of information into the log.

For example, if you are just interested in the headers, you can log request()->headers and see if something is missing there.

Zak left a reply on Settings Package

You can update the settings in the file the same as you'd update it in the database. The only difference is you're not storing it in a database.

Zak left a reply on Settings Package

May I recommend Spatie's valuestore? It does not store the data in the database, but rather in a file, which may even be a better solution.

There is also this article that may help in this particular case. It even includes a handy helper function.

Zak left a reply on Trying To Log Request From Webhook Post

Have you tried using Laravel Telescope? It shows headers, session data, and of course any data coming through the payload. It might be fairly useful in a situation like this.

If you don't want to use Telescope, you can create a temporary middleware to log the contents of $request to the console so you can see the data there, though it may not be very elegant.