Laravel HTTP Client + Alpine.js: External Weather API Demo

Поділитися
Вставка
  • Опубліковано 18 жов 2024

КОМЕНТАРІ • 27

  • @KastsEcho
    @KastsEcho 3 роки тому +7

    @2:16 Actually...Laravel's HTTP client is a wrapper for Guzzle, which is in the dependency list by default in a fresh Laravel installation.

  • @william254
    @william254 3 роки тому +1

    Thank you so much. You really make a difference in the developer community

  • @thebigx99
    @thebigx99 3 роки тому +2

    Very good, please continue to record video's like this

  • @jugibur2117
    @jugibur2117 Рік тому

    Great stuff, thanks for sharing!

  • @belce1982
    @belce1982 3 роки тому

    Thanks as always! I'll see it later! Keep working!

  • @soniablanche5672
    @soniablanche5672 3 роки тому +4

    Since there are no api keys you might as well call the api directly from the client. (Unless they have CORS, but I doubt it. It's an API)

  • @nicolasromero6144
    @nicolasromero6144 3 роки тому

    nice explanation. Thank you

  • @leslysuarez9686
    @leslysuarez9686 3 роки тому

    Povilas, the js code that you have at the end of the app.blame, can I separate it into my own JS and then add the script? or does it not work like that?

    • @LaravelDaily
      @LaravelDaily  3 роки тому +1

      Yes, should be possible. But that kinda goes against the whole philosophy of Alpine.js, it's mostly used for small almost-inline snippets.

  • @majidkadi
    @majidkadi 3 роки тому

    Thank you too much for this video.
    Is there a way to fetch cities from database?
    If yes, how can we do that?

    • @majidkadi
      @majidkadi 3 роки тому

      Thanks again.
      I found how to do it.

  • @offerszonebr
    @offerszonebr 3 роки тому

    Hello sir, Please make a video on how to setup supervisor or run queue in shared hosting

    • @LaravelDaily
      @LaravelDaily  3 роки тому

      I don't recommend to use shared hosting for such operations

  • @pavelkostetskiy7561
    @pavelkostetskiy7561 3 роки тому

    Hi Povilas! Is there a way to build a client-server web-socket app with two-way communication? Does Laravel allow to build this kind of applications? Thank you!

    • @LaravelDaily
      @LaravelDaily  3 роки тому +1

      If I understand correctly what you want to achieve, then yes, Laravel Echo and Socket.io/Pusher are the tools. Planning to shoot a course about them, in late 2021.

    • @pavelkostetskiy7561
      @pavelkostetskiy7561 3 роки тому +1

      @@LaravelDaily thank you very much for your answer!
      I could be wrong but investigating this topic I figured out that Pusher works well only for sending messages from server to clients. Sending backward from client to server is not that clear and straightforward.

  • @robertwayne3567
    @robertwayne3567 3 роки тому +1

    The only problem with this way of caching is if the response isn’t good. It’s cached with the bad response.

  • @majidkadi
    @majidkadi 3 роки тому

    After instaling it and run it I get that error:
    Error happened when fetching the API

  • @ironspider9026
    @ironspider9026 3 роки тому

    Do you recommend learning Alpine over Vue??

  • @aplokhy
    @aplokhy 3 роки тому

    What storm theme do you use?

  • @intipontt7490
    @intipontt7490 3 роки тому +2

    $coordinates = config('app.cities.'.$city) should be inside the Cache::remember() Closure. It is not used anywhere else in the __invoke method.

    • @ОлегКнязев-ж8э
      @ОлегКнязев-ж8э 3 роки тому

      It's doesn't change anything in this case, and since it refers to the global config, when you mentally parse the code in practice, you tend to treat these variables as constants. For example, in JS, when you declare const, it's a good practice to keep them grouped together at the top of a method. Same applies here. Again, in practice, not in theory with pinch-perfect SOLID compliance everywhere, fairies and magic wands. It just makes it more readable and easy to parse on the eye.

  • @stefanilic4178
    @stefanilic4178 3 роки тому

    Uncaught TypeError: Cannot read properties of undefined (reading 'forEach')
    What is the problem?