PHP code example of skybluesofa / laravel-microblog
1. Go to this page and download the library: Download skybluesofa/laravel-microblog 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/ */
use Skybluesofa\Microblog\Model\Traits\MicroblogAuthor;
class User extends Model
{
use MicroblogAuthor;
...
}
use Skybluesofa\Microblog\Model\Traits\MicroblogFriends;
class User extends Model
{
use MicroblogFriends;
...
public function getBlogFriends()
{
// Return null to get all users
return null;
// Return an array to get specific user ids
// return [1,2,3];
// Return an empty array to get no user ids (no one else)
//return [];
}
...
}
$post = new Post;
$post->content = 'This is the story of my life';
$user->savePost($post);