PHP code example of devworkout / laravel-user-limits
1. Go to this page and download the library: Download devworkout/laravel-user-limits 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/ */
devworkout / laravel-user-limits example snippets
use HasLimits;
php
\DevWorkout\UserLimits\Limit::create([
'subject' => 'domains',
'allowed' => 3,
'period' => 'permanent'
]);
\DevWorkout\UserLimits\Limit::create([
'subject' => 'cards',
'package' => 'pro',
'allowed' => 100,
'period' => 'monthly'
]);
echo auth()->user()->usage('cards')->allowed();
echo auth()->user()->usage('cards')->used();
echo auth()->user()->usage('cards')->remaining();
echo auth()->user()->usage('cards','pro')->exceeded();
echo auth()->user()->usage('cards')->reset();
echo auth()->user()->usage('cards')->increment();
echo auth()->user()->usage('domains')->decrement();
echo auth()->user()->usage('cards')->refreshed_at();
echo auth()->user()->usage('cards')->next_refresh_at();