PHP code example of rdcstarr / superpower-query
1. Go to this page and download the library: Download rdcstarr/superpower-query 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/ */
rdcstarr / superpower-query example snippets
use Rdcstarr\SuperpowerQuery\Concerns\SuperPowerModel;
class Ticket extends Model
{
use SuperPowerModel;
}
// Then:
$tickets = Ticket::cache(scope: $user, key: 'tickets:index:list')
->query($search)
->where('user_id', $user->id)
->orderByDesc('last_message_at')
->paginate(30);