PHP code example of oi-lab / oi-laravel-changelogs
1. Go to this page and download the library: Download oi-lab/oi-laravel-changelogs 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/ */
oi-lab / oi-laravel-changelogs example snippets
// config/oi-laravel-changelogs.php
'changelog_path' => 'resources/markdown/change-logs',
// Where the installer writes the React files. The pages path also decides the
// Inertia component the controller renders: "resources/js/pages/console/change-logs"
// is rendered as "console/change-logs/index", so moving the screen into your
// console space is a one-line change and no code edit.
'components_path' => 'resources/js/components/change-logs',
'pages_path' => 'resources/js/pages/change-logs',
'route' => [
'enabled' => env('OI_CHANGELOGS_ROUTES', true),
'prefix' => 'change-logs',
'name' => 'change-logs.',
'middleware' => ['web'],
],
'rendering' => [
'markdown_engine' => 'server', // or 'client'
'ssr' => false,
'typeset' => false,
],
'entries' => [
'locale' => null, // null = the app's locale
'summary_words' => ['min' => 30, 'max' => 75],
'max_tags' => 5,
],
'per_page' => 20,
'cache' => ['store' => null, 'ttl' => 3600],
it('keeps every change log entry well formed', function () {
$this->withoutMockingConsoleOutput();
expect($this->artisan('change-log:check'))->toBe(0);
});
use OiLab\OiLaravelChangelogs\Services\ChangeLogRepository;
public function __construct(private readonly ChangeLogRepository $changeLogs) {}
$latest = $this->changeLogs->all()->take(3); // Collection<ChangeLogEntry>
$page = $this->changeLogs->paginate(20, 1, $url); // of ChangeLogRowData
$entry = $this->changeLogs->find('2026-09-12-a-slug');
$detail = $this->changeLogs->detail($entry); // ChangeLogEntryData
['previous' => $previous, 'next' => $next] = $this->changeLogs->adjacent($entry->slug);