PHP code example of memdev / laravel-frontend-policy
1. Go to this page and download the library: Download memdev/laravel-frontend-policy 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/ */
memdev / laravel-frontend-policy example snippets
use Pine\Policy\UsesModelName;
use Illuminate\Database\Eloquent\Model;
class Comment extends Model
{
use UsesModelName;
protected $appends = ['model_name'];
}
html
@currentUser
<!-- Result -->
<script>window['user'] = { ... };</script>
html
@currentUser ('admin')
<!-- Result -->
<script>window['admin'] = { ... };</script>