Search code examples
laraveleloquentlaravel-8inertiajs

Getting 403 error on store method in Laravel


I am learning laravel. Right now working on a project with inertia. Have created a model, controller and view in default settings.

I am able to create user with the built-in user manager.

But getting 403 error while creating records for my custom models.

Can anyone help me as to what could be causing this?

store method on user-creation works. But store method on my custom model throws 403.


Solution

  • Answering my own question.

    Issue was with authorize method of requests. That check was returning false.

    As I am using middleware for validation.

    More info for future readers.

    What is the purpose of the authorize method in a Request class in Laravel?