-
Notifications
You must be signed in to change notification settings - Fork 25
Extending Capabilities
Shashank Jain edited this page Oct 1, 2016
·
1 revision
Laravel Rest API plugin provides various ways to override/extend default functionality.
If you use form requests for validation and authorization, you can use them with the plugin by giving referenced to the request classes as follows:
$indexRequest = UserIndexRequest::class;
$storeRequest = UserStoreRequest::class;
Similarly, for show
, update
, and delete
methods.
You many want to modify queries for fetching and storing data, like, adding joins, inner queries, etc. You can to that by defining the corresponding modify
functions. For example, to modify index
request:
public function modifyIndex($query) {
return $query->where("status", "active");
}