Evorg
Scalable Events Database for Laravel, (*1)
Requirements
- PHP >= 5.5.0
- ElasticSearch Servers
Installation
require in composer.json, (*2)
"buonzz/evorg": "2.*"
update composer by executing this in your project base folder, (*3)
composer update
add the service provider in config/app.php in providers array, (*4)
'Buonzz\Evorg\ServiceProvider',
add the alias in config/app.php in aliases array, (*5)
'Evorg' => Buonzz\Evorg\EvorgFacade::class
publish the config settings, (*6)
php artisan vendor:publish
edit config/evorg.php, (*7)
- app_id - is a unique number to identify your app
- app_name - is the unique name of your app
- logging - setting this to true makes a log file for evorg in app/storage/logs/evorg.log , good for troubleshooting
- hosts - address of the elasticsearch servers (see http://www.elasticsearch.org/guide/en/elasticsearch/client/php-api/current/_configuration.html)
create the schemas in ElasticSearch, (*8)
php artisan evorg:create_schema
NOTE: The application assumes that the Laravel Task scheduling cron entry is added in your crontab, (*9)
* * * * * php /path/to/artisan schedule:run >> /dev/null 2>&1
if not, kindly do so, as its needed to perform background tasks that the package needs to do, (*10)
Usage
Insert a click for a particular thumbnail, (*11)
Route::get('click', function()
{
return Evorg::event("click")
->insert('thumbnail', array(
'movie_name' => 'Interstellar',
'year' => '2014')
);
});
Retrieve all click events, (*12)
Route::get('all', function()
{
return Evorg::event("click")->get();
});