public function __construct() { parent::__construct(); $this->submenu = Navigation::submenu('inventory'); // Registering unique category validator Validator::register('cat_exists', function ($attribute, $value, $parameters) { if ($value == 'null') { return true; } $category = DB::table('categories')->where_id($value)->first(); if ($category !== null) { return true; } }); // Registering unique item code validator Validator::register('code_unique', function ($attribute, $value, $parameters = array()) { $id = !empty($parameters) ? $parameters[0] : null; $existing_item = DB::table('items')->where_code($value)->first('code'); if ($existing_item !== null) { if ($id === null) { return false; } $current_item = DB::table('items')->where_id($id)->first('code'); if ($current_item->code == $value) { return true; } } elseif ($existing_item == null) { return true; } }); }
/** * Construct */ public function __construct() { parent::__construct(); $this->submenu = Navigation::submenu('inventory'); // Generating buttons $this->item_buttons = Navigation::item_buttons()->add_item_button(array('icon' => 'icon-plus-sign', 'link' => 'contact@add', 'text' => __('site.add_contact')))->get_item_buttons(); }
/** * Construct * * @return void */ public function __construct() { parent::__construct(); $this->submenu = Navigation::submenu('report'); }
/** * Construct */ public function __construct() { parent::__construct(); $this->submenu = Navigation::submenu('inventory'); }
/** * Construct */ public function __construct() { parent::__construct(); $this->submenu = Navigation::submenu('transactions'); }