I am using laravel 4 and I want to keep track of history of all transactions made to a table. I followed those steps
"venturecraft/revisionable": "1.*"
at composer.jsonphp composer.phar update
run in the root of my project this :
php artisan migrate --package=venturecraft/revisionable
and it says "nothing to migrate"
then i copied the migration file from the package in my app/database folder, and changed the classname from CreateRevisionsTable to something like CreateRevisionTable and the table was created in my database. Then I added this in my Car model:
1.
class Car extends Eloquent {
use \Venturecraft\Revisionable\RevisionableTrait;
protected $keepRevisionOf = array(
'Description'
);
}
Then in my controller:
$description = Car::find($id);
$history = $description->revisionHistory;
And then in my view:
@foreach($history->revisionHistory as $h )
<li>{{ $h->userResponsible()->username }} changed {{ $h->fieldName() }} from {{ $h->oldValue() }} to {{ $h->newValue() }}</li>
@endforeach
composer.json
"require": {
"laravel/framework": "4.1.*",
"ajessup/gae-laravel": "dev-master",
"venturecraft/revisionable": "1.*"
},
And the result is:
Trait 'Venturecraft\Revisionable\RevisionableTrait' not found
What am I missing?
Try setting the item in composer to:
"venturecraft/revisionable": "~1.8"
This will match any version from 1.8 to but not including 2.0.
EDIT: This solution makes no difference.
EDIT: Maybe.