1. Go to this page and download the library: Download codewiser/journalism 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/ */
codewiser / journalism example snippets
'providers' => [
/*
* Laravel Framework Service Providers...
*/
Illuminate\Foundation\Providers\ArtisanServiceProvider::class,
Illuminate\Auth\AuthServiceProvider::class,
...
/**
* Third Party Service Providers...
*/
Codewiser\Journalism\JournalServiceProvider::class,
],
class Post extends Model {
use Codewiser\Journalism\Traits\Journalised;
}
$post = Post::first();
// Record an event
$post->journalise('my-event');
$post->journalise('my-event', /* jsonable data */);
class AppServiceProvider extends ServiceProvider
{
public function boot()
{
Post::observe(Codewiser\Journalism\Observers\Journalist::class);
}
}