My Blog Posts

Laravel Befriended Pack

Laravel Befriended Pack

Eloquent uses features and contracts to implement tracking, blocking, and liking models. Examples of Benioku User Model if it shows up it can also be for any other model. For example, a user can CompanyOr Projectto give more names Or you can allow it to follow a model, such as .

Here are several examples of code using the following features:

$eric = User::where('name', 'Eric Barnes')->first();

$user-following()->count(); 1
$eric->followers()->count(); 1 
You can also check whether a user is following another user::

$user-$friend; alias

Learn more

More information about this package rennokki / befriended from the official GitHub readme page at can learn and you can install this package in your Laravel project

Share this article

Comments (0)