zak

zak

Member Since 2 Years Ago

Experience Points 37,450
Experience
Level
Lessons Completed 359
Lessons
Completed
Best Reply Awards 2
Best Answer
Awards
  • Start Your Engines Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    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 Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

16 Dec
10 hours ago

zak left a reply on How Does The Laravel Code Example Send Email To Many Recipients

If you are referring to sending emails in bulk, I'd take a look at these two lessons: part 1 part 2

14 Dec
2 days 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 possible 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
3 days 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 URI 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
4 days 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
5 days 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
1 week 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. Carbon has some awesome helpers for this.

// Pseudocode

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 don'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.

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 global temporary middleware to log the $request to the console so you can see the data there, though it may not be very elegant.