PHP code example of mattmangoni / nova-recent-posts

1. Go to this page and download the library: Download mattmangoni/nova-recent-posts 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/ */

    

mattmangoni / nova-recent-posts example snippets


// in app/Providers/NovaServiceProvder.php

// ...
public function cards()
{
    return [
        // ...

        // all the parameters are optional
        new \Mattmangoni\RecentPosts\RecentPosts(
            string $authorRelationName = 'user',
            string $dateFormat = 'Y-m-d',
            int $postsNumber = 5,
            string $postModel = 'App\Post',
            string $userUriKey = 'users'
        ),
    ];
}