Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Sphinx Laravel Package

hans-thomas/sphinx

View on GitHub
Deep Wiki
Context7

+++ date = "2023-06-26" draft = false weight = 20 description = "A bunch of useful and handy methods." title = "Trait" bref= "Sphinx adds some useful and necessary methods through the trait. there is the list of available methods" toc = false +++

Available methods

{{< rawhtml >}}

can

Determine if the entity has the given abilities.

$user->can('has-ability'); // ture
$user->can('hasnt-ability'); // false

canAny

Determine if the entity has any of the given abilities.

$user->canAny( ['has-ability','hasnt-ability'] ); // true
$user->canAny( ['hasnt-ability','hasnt-other-ability'] ); // false

cant

Determine if the entity does not have the given abilities.

$user->cant('hasnt-ability'); // true
$user->cant('has-ability'); // false

cannot

Alias for cant method.

getDeviceLimit

Determine the limitation of logged-in devices using one user account.

$user->getDeviceLimit(); // int number

extract

Extract some necessary attributes of user to put in the tokens.

$user->extract(); // an array of user's attributes

username

Returns username column name of the user.

$user->username(); // email column for example

extractRole

Extract attributes of user's role.

$user->extractRole(); // an array of user's role attributes

extractPermissions

Extract attributes of owned permissions of user.

$user->extractPermissions(); // an array of user's permissions attributes
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
mehedimi/laravel-amp-mail
happones/laravel-vue-i18n-generator
jwerd/inertia-table
siberfx/flysystem-wasabi
hollyit/token-replace
ippanelcom/laravel-sdk
adachsoft/changelog-linter
adachsoft/collection
payerurl/telegrambot-crypto-payment-instant-payout
dskripchenko/laravel-hybrid-search
riorizkyrainey/lara-ced
mehedimi/static-vel
zharp/zharp
nonsapiens/bigquery-model-sync
lgu-bayambang-ict-office/lgu-laravel-development-standards
andydefer/laravel-support
se7enxweb/flysystem
lampwick/laravel
jeslage/statamic-emojis
micahdshackelford/rmap-laravel