Skip to content

Instantly share code, notes, and snippets.

@abishekrsrikaanth
Last active March 12, 2020 10:30
Show Gist options
  • Save abishekrsrikaanth/80e76dc4c7eee6b693b482d70d363d39 to your computer and use it in GitHub Desktop.
Save abishekrsrikaanth/80e76dc4c7eee6b693b482d70d363d39 to your computer and use it in GitHub Desktop.
<?php
use Illuminate\Http\Request;
trait ResourceDoesNotRequireEditing
{
/**
* Determine if the current user can create new resources.
*
* @param Request $request
*
* @return bool
*/
public static function authorizedToCreate(Request $request)
{
return false;
}
/**
* Determine if the current user can update the given resource.
*
* @param Request $request
*
* @return bool
*/
public function authorizedToUpdate(Request $request)
{
return false;
}
/**
* Determine if the current user can delete the given resource or throw an exception.
*
* @param Request $request
*
* @return bool
*/
public function authorizedToDelete(Request $request)
{
return false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment