1. Go to this page and download the library: Download contentpulseio/laravel 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/ */
contentpulseio / laravel example snippets
use ContentPulse\Laravel\Models\Content;
Content::published()->get(); // status = published, newest first
Content::whereCategory('laravel')->get();
Content::whereTag('seo')->get();
use App\Models\Post;
use ContentPulse\Laravel\Models\Content;
public function index()
{
$feed = Post::published()->get()
->concat(Content::published()->get())
->sortByDesc('published_at')
->values();
return view('blog.index', ['posts' => $feed]);
}
public function show(string $slug)
{
$post = Post::published()->where('slug', $slug)->first()
?? Content::published()->where('slug', $slug)->firstOrFail();
return view('blog.show', ['post' => $post]);
}