You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
user_center/stubs/policy.stub

94 lines
2.2 KiB

<?php
namespace {{ namespace }};
use Illuminate\Auth\Access\HandlesAuthorization;
use {{ namespacedModel }};
use {{ namespacedUserModel }};
class {{ class }}
{
use HandlesAuthorization;
/**
* Determine whether the user can view any models.
*
* @param \{{ namespacedUserModel }} $user
* @return mixed
*/
public function viewAny({{ user }} $user)
{
//
}
/**
* Determine whether the user can view the model.
*
* @param \{{ namespacedUserModel }} $user
* @param \{{ namespacedModel }} ${{ modelVariable }}
* @return mixed
*/
public function view({{ user }} $user, {{ model }} ${{ modelVariable }})
{
//
}
/**
* Determine whether the user can create models.
*
* @param \{{ namespacedUserModel }} $user
* @return mixed
*/
public function create({{ user }} $user)
{
//
}
/**
* Determine whether the user can update the model.
*
* @param \{{ namespacedUserModel }} $user
* @param \{{ namespacedModel }} ${{ modelVariable }}
* @return mixed
*/
public function update({{ user }} $user, {{ model }} ${{ modelVariable }})
{
//
}
/**
* Determine whether the user can delete the model.
*
* @param \{{ namespacedUserModel }} $user
* @param \{{ namespacedModel }} ${{ modelVariable }}
* @return mixed
*/
public function delete({{ user }} $user, {{ model }} ${{ modelVariable }})
{
//
}
/**
* Determine whether the user can restore the model.
*
* @param \{{ namespacedUserModel }} $user
* @param \{{ namespacedModel }} ${{ modelVariable }}
* @return mixed
*/
public function restore({{ user }} $user, {{ model }} ${{ modelVariable }})
{
//
}
/**
* Determine whether the user can permanently delete the model.
*
* @param \{{ namespacedUserModel }} $user
* @param \{{ namespacedModel }} ${{ modelVariable }}
* @return mixed
*/
public function forceDelete({{ user }} $user, {{ model }} ${{ modelVariable }})
{
//
}
}