PHP code example of jeroenherczeg / dog

1. Go to this page and download the library: Download jeroenherczeg/dog 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/ */

    

jeroenherczeg / dog example snippets

 php
// config/app.php
'providers' => [
    ...
    Jeroenherczeg\Dog\FollowServiceProvider::class,
];
 bash
php artisan vendor:publish --provider="Jeroenherczeg\Dog\FollowServiceProvider"
bash
php artisan migrate
 php
// Follow User
$user->follow(1)
$user->follow([1,2,3,4])

// Unfollow User
$user->unfollow(1)
$user->unfollow([1,2,3,4])

// Get Followers
$user->followers()

// Get Followings
$user->followings()

// Check if Follow
$user->isFollowing(1)

// Check if Followed By
$user->isFollowedBy(1)