API Platform for Laravel: My First Impression

Поделиться
HTML-код
  • Опубликовано: 2 окт 2024
  • If you want to generate the API quickly from just Eloquent Model, there's a new tool for that. I've tried it out.
    Links mentioned in the video:
    Docs: api-platform.c...
    Homepage: api-platform.com/
    Official presentation of API Platform for Laravel: dunglas.dev/20...
    What is SwaggerUI: swagger.io/too...
    My course "How to Build Laravel 11 API From Scratch": laraveldaily.c...
    API Platform, not OpenAPI (I said OpenAPI 4 times)
    AGAIN: API Platform, not OpenAPI
    OpenAPI platform again
    - - - -
    Support the channel by checking out my products:
    My Laravel courses: laraveldaily.c...
    Filament examples: filamentexampl...
    Livewire Kit Components: livewirekit.com
    - - - -
    Other places to follow:
    My weekly Laravel newsletter: us11.campaign-...
    My personal Twitter: / povilaskorop

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

  • @shahsawoodshinwari
    @shahsawoodshinwari 8 часов назад +2

    Overall it looks good but fir advanced things we should dig deeper for it

  • @0xshaheen
    @0xshaheen 3 часа назад +1

    you can get the typical Laravel api response by uncommenting jsonapi in the formats key in api-platform.php in config

  • @JeffLiuth
    @JeffLiuth 10 часов назад +1

    engagement comment.

  • @stephenr85
    @stephenr85 9 часов назад +1

    Nice to know for the simple update/create. Although I'm using V1 in the path of my biggest API project...
    Are there any filters or relationship parameters for the index/list endpoint?

    • @LaravelDaily
      @LaravelDaily  7 часов назад

      I guess you should read the docs to find out, or try it out yourself.

  • @kengraversen6408
    @kengraversen6408 8 часов назад

    Great review. Could you mention alternative packages or approaches to update/enrich a current project with API features?

    • @virinom
      @virinom 7 часов назад +2

      most common way is to use l5-swagger package and manually write OpenApi annotations for controller methods, model resources etc. then it generates swagger ui.

  • @angga.studio
    @angga.studio 6 часов назад +1

    I have followed your Mini CRM tutorial, and of course I want to develop the API for the mobile app. But from this video, I think API Platform is not the good choice because of the limitation and "weird way" you mentioned. So, what are the other good choice to develop the API for Mini CRM?

    • @LaravelDaily
      @LaravelDaily  5 часов назад +1

      By manually coding it with Laravel?

  • @linasgutauskas5528
    @linasgutauskas5528 4 часа назад

    Looks nice, but in real life APIs usually contains way more complex logic...

  • @abelgetu4860
    @abelgetu4860 9 часов назад

    It looks good and great but can we add different methods? It only works for crud operation. Is it possible to add methods like getCustomerDetail or something? If it's possible, where do we write it? or did it detect from the controller methods?

    • @LaravelDaily
      @LaravelDaily  9 часов назад +1

      Good question, I didn't dig deeper, I guess you should read the docs to find the answer.

    • @abelgetu4860
      @abelgetu4860 8 часов назад

      @@LaravelDaily Ya I will check more into it.

    • @spicynoodle7419
      @spicynoodle7419 7 часов назад

      You should have a CustomerDetailController instead

  • @mamad-dev
    @mamad-dev 5 часов назад

    what is that mysql app that he's using ?

  • @WebDevMatics
    @WebDevMatics 7 часов назад

    Not much support for Laravel, if you look deep in docs it tells how to do for Symphony but not for Laravel.

  • @spicynoodle7419
    @spicynoodle7419 7 часов назад +1

    This entire project is an anti-pattern because it is a continuation of the mistaken philosophy that a REST resource is a DB table and that a model is just an interface for a DB table.
    Using models to describe endpoints instead of DTOs is really dumb. Using CRUD is simplistic to the point of being useless. Not using HyperMedia-based responses is dumb. Everything about it, at this release version, is useless

    • @MichalKuzmicki
      @MichalKuzmicki 6 часов назад

      You should also look at the code, for example in the main directory of api-platform/laravel there is a `ApiPlatformProvider`, that in the register mehtod binds a Laravel Singleton called `ResourceMetadataCollectionFactoryInterface` - that has over 15 levels of nesting.