cloudcreativity / laravel-json-api

JSON API (jsonapi.org) package for Laravel applications.
http://laravel-json-api.readthedocs.io/en/latest/
Apache License 2.0
780 stars 109 forks source link

Question: How to do some action before delete method? #398

Closed ijalalfrz closed 5 years ago

ijalalfrz commented 5 years ago

Hi , I really appreciate your work for this package and i'm wondering how to do some action before delete method? I have added delete method in adapter but it's still not working, this is what i've tried.

    public function delete($record,EncodingParametersInterface $parameters)
    {
        //some action here
        return parent::delete($record, $parameters);
    }
lindyhopchris commented 5 years ago

Hi!

Have you tried using the deleting adapter hook: https://laravel-json-api.readthedocs.io/en/latest/basics/adapters/#adapter-hooks

lindyhopchris commented 5 years ago

Closing this as the answer above should be sufficient. Please re-open with additional information if not.