I am creating an application that records login histories.
I wrote the code below, and pasted it into bootstrap.php, and it worked. But, login histories are always recorded. My plan is to record login histories only when my application is active.
Where should I put the code in my applications folder?
$history = new \LoginHistory\Model_History();
$history->login = Input::post('email');
$history->pass = Input::post('password');
$history->ip = Input::real_ip();
$history->ua = Input::user_agent();
$history->status = 'Login OK';