PHP code example of chrisrhymes / policy-collect
1. Go to this page and download the library: Download chrisrhymes/policy-collect library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
chrisrhymes / policy-collect example snippets
composer
$orders = Order::paginate()->policy();
echo $orders[0]->can->view; // true
$orders[0]->can->view;
$orders[0]->can->update;
$orders[0]->can->delete;
$orders[0]->can->restore;
$orders[0]->can->forceDelete;
$orders = Order::paginate()->policy(['refund']);
echo $orders[0]->can->refund; // false