-
composer.json
Open in GitHub"require": { "php": "^7.3 | ^8.0", /// "venturecraft/revisionable": "^1.34" },
-
app/Models/Link.php
Open in GitHubuse Illuminate\Database\Eloquent\Model; use Venturecraft\Revisionable\RevisionableTrait; class Link extends Model { use RevisionableTrait; }
-
app/Http/Controllers/Models/LinkController.php
Open in GitHubuse App\Http\Controllers\Controller; use App\Models\Link; class LinkController extends Controller { public function show(Link $link): View { return view('models.links.show', [ 'link' => $link, 'history' => $link->revisionHistory()->latest()->get(), ]); } }