Skip to content

Question - How to handle auth and policy related validations? #14

@bobmulder

Description

@bobmulder

Hi there!

When I stumbled across Airwire, my developer-heart made a little jump of joy. This seems to be the library I've been thinking of so many times... Inertia.js seems to be too much, Livewire 'forces' me to use alpine (I know this aint completely true, but nevermind), but this library just does the wiring, and it lets me be in control of my js side and backend side. Awesome!

My current api-like controllers which can be seen as the soon-deprecated-pre-airwire-component-classes, always handle some business-like validation, and auth related validation. When something goes wrong on that endpoint, I return a 400 error or something, and that's it.

But.... How do we handle such cases in Airwire? To make things more specific:

  1. How do we handle Laravels policy validation in Airwire components?
  2. How do we handle authentication related validation in Airwire components?
  3. How do we handle custom business logic validation in Airwire components, and what should be returned when something goes wrong (the 400 status code)?

Thank you for reading and commenting :)

Bob

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions