public function signout() { if (ModelUser::isLoggedIn()) { ModelUser::current()->signOut(); $this->setMessage('Thanks for visiting!', 'success'); } redirect(url('home')); }
public function __construct() { $table = new DBTable(); $table->column('id')->bigint()->primary()->increment(); $table->column('user_id')->bigint()->index(); $table->column('organisation_id')->bigint()->index(); $table->column('invoice_id')->integer()->index(); $table->column('path')->string(300); $table->column('due_date')->date()->index(); $table->column('amount_total')->integer()->index(); $table->column('payed')->bool()->index(); $table->column('created')->datetime()->index(); parent::__construct($table); if (ModelUser::current()->isLoggedIn()) { $this->user_id = ModelUser::current()->id; } $this->created = Date::toDateTime(); }