Download the PHP package ctf0/odin without Composer
On this page you can find all versions of the php package ctf0/odin. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package odin
Odin
Manage model revisions with ease.
If you are also looking to preview the form data before submitting to the db, you may want to give OverSeer a try.
- package requires Laravel v5.4+
Installation
-
composer require ctf0/odin
-
(Laravel < 5.5) add the service provider & facade
-
publish the package assets with
php artisan vendor:publish --provider="ctf0\Odin\OdinServiceProvider"
-
after installation, run
php artisan odin:setup
to add- package routes to
routes/web.php
- package assets compiling to
webpack.mix.js
- package routes to
-
check laravel-auditing docs for configuration
-
install dependencies
- add this one liner to your main js file and run
npm run watch
to compile yourjs/css
files.- if you are having issues Check.
Features
- support single & nested values.
- delete & restore revisions.
- support soft deletes.
- revision preview.
-
clear audits for permanently deleted models.
- which can be scheduled as well
-
shortcuts
navigation keyboard mouse (click) go to next revision right/down (revision date)* go to prev revision left/up (revision date)* go to first revision home (revision date)* go to last revision end (revision date)* hide revision window esc (x)* -
events "JS"
event-name description odin-show when revision is showen odin-hide when revision is hidden
Usage
-
run
php artisan migrate
-
add
Revisions
trait &AuditableContract
contract to your model- for
User model
Check
- for
-
you can disable creating ghost audits where both
old/new
values are empty by using- remember that without the parent model audit log we cant show the relation changes
- inside the model view ex.
post edit view
add
Notes
-
model
user_id
&id
are excluded from the audit log by default. -
data:uri
-
if you use
data:uri
in your revisionable content, changeaudits_table
columns type to eithermediumText
orlongText
before migrating to avoid future errors of long data. - because
data:uri
is a render blocking & isn't readable by humans, we truncate it to 75 char max
note that this ONLY effects the displaying of the revision diff, we never touch the data that gets saved to the db.
-
- model-relation
- atm the relation revision is limited, it means we can only show the
attach/detach
changes but we cantundo/redo
any of them through the package it self. - also if you use mass update like
Model::update()
make sure to call$model->touch();
afterwards to make sure an audit is created ex.
- atm the relation revision is limited, it means we can only show the
Security
If you discover any security-related issues, please email [email protected].
All versions of odin with dependencies
phpspec/php-diff Version ^1.1
owen-it/laravel-auditing Version *
fico7489/laravel-pivot Version *
ctf0/package-changelog Version *