My Three New Favorite things in Laravel

Поделиться
HTML-код
  • Опубликовано: 4 ноя 2024

Комментарии • 18

  • @TheCodeholic
    @TheCodeholic Месяц назад

    The fact that PHP allows to start a new process in the background is game changer.
    defer, Concurrency facade and Cache::flexible are my favourite additions.

  • @alexandersix_
    @alexandersix_ Месяц назад +1

    Really, really awesome example of deferring with + when blade helper. Definitely bookmarking this one to send to folks if they need help understanding the new features! 🙌

    • @joshcirre
      @joshcirre  Месяц назад

      Thank you Alex! I think the more people understand what defer() can do the better people can use it instead of throwing it on everything. 🫣

  • @FatehDris96
    @FatehDris96 Месяц назад

    hey Josh , great content by the way , we need a livewire volt spa demo , thanx in advance

  • @KouadioStephane-FabienBrou
    @KouadioStephane-FabienBrou Месяц назад

    I'm new in Laravel and i love all you stuff... Good job!🔥🔥

    • @joshcirre
      @joshcirre  Месяц назад

      Wow. Thank you so much. :)

  • @elijahcruz8895
    @elijahcruz8895 Месяц назад +1

    I feel like I'm gonna use defer in one of my projects for activity logs. Like if I CRUD action happens, add it to the activity log.

  • @itsmill3rtime
    @itsmill3rtime Месяц назад +4

    Josh, does the defer just launch another process? or does it send the response back to the browser and flush, but still require the browser be connected to be able to process? if you defer something that takes 10 seconds but you close the browser after 3 seconds will it still finish?

    • @Xavi7th
      @Xavi7th Месяц назад

      I have been wondering about this and nobody is talking about this.

    • @felr1b
      @felr1b Месяц назад +6

      defer forks a new process and executes the closure. if you close the browser, the "job" will finish the same way (just like a queue job)

    • @Xavi7th
      @Xavi7th Месяц назад

      @felr1b oh I see. That makes a lot of sense.
      But does this deferred process block the next request from that same user's browser, supposing they make the next request before the "job" is done?

    • @renatofrota
      @renatofrota Месяц назад +1

      Laravel is still "alive" after the response is sent (to gather some information for logs, statistics, debug, etc. - search for tutorials related to the Response class and the response() helper). defer() just postpone closures to run at that point (after response is sent but Laravel is still loaded). There's no process fork involved, the closures passed to defer will run on the same process. There's no way to interrupt the process from "external" side as well (unless your closure itself intentionally watch for new requests or any signal that should interrupt it) and it doesn't block new requests from the same user (unless there's a limit on the number of concurrent requests/php processes on your environment which would result in a limitation to run simultaneous requests without defer() already).

    • @felr1b
      @felr1b Месяц назад +1

      @@Xavi7th no, it doesnt block the next request. the "job" has no knowledge of the request context.

  • @bazbaz
    @bazbaz Месяц назад

    Win method 😀

  • @trevormanhuwa
    @trevormanhuwa Месяц назад

    Hey josh, i like your stuff, i would like to collab on a little idea can we chat?

  • @33sprog5min2
    @33sprog5min2 8 дней назад

    after using laravel octane on my new projects
    i think no need for this one