diff --git a/components/Company.php b/components/Company.php index ce3e370..f381c2f 100644 --- a/components/Company.php +++ b/components/Company.php @@ -8,46 +8,46 @@ class Company extends ComponentBase { - public function componentDetails() - { - return [ - 'name' => 'hambern.company::lang.components.company.name', - 'description' => 'hambern.company::lang.components.company.description', - ]; - } + public function componentDetails() + { + return [ + 'name' => 'hambern.company::lang.components.company.name', + 'description' => 'hambern.company::lang.components.company.description', + ]; + } - public function defineProperties() - { - return []; - } + public function defineProperties() + { + return []; + } - public function onRun() - { - $settings = Settings::instance(); - $company = new Model(); - $company->name = $settings->name; - $company->slogan = $settings->slogan; - $company->logo = $settings->logo; - $company->story = $settings->story; - $company->phone = $settings->phone; - $company->fax = $settings->fax; - $company->email = $settings->email; - $company->address = $settings->address; - $company->social_media = $settings->social_media; - $company->contact = $this->contact(); - $company->street_name = $settings->street_name; - $company->street_number = $settings->street_number; - $company->zip = $settings->zip; - $company->city = $settings->city; - $this->page['company'] = $company; - } + public function onRun() + { + $settings = Settings::instance(); + $company = new Model(); + $company->name = $settings->name; + $company->slogan = $settings->slogan; + $company->logo = $settings->logo; + $company->story = $settings->story; + $company->phone = $settings->phone; + $company->fax = $settings->fax; + $company->email = $settings->email; + $company->address = $settings->address; + $company->social_media = $settings->social_media; + $company->contact = $this->contact(); + $company->street_name = $settings->street_name; + $company->street_number = $settings->street_number; + $company->zip = $settings->zip; + $company->city = $settings->city; + $this->page['company'] = $company; + } - public function contact() - { - if ($employee = Employee::find(Settings::get('contact'))) { - return $employee; - } - return Employee::orderBy('id', 'asc')->first(); - } + public function contact() + { + if ($employee = Employee::find(Settings::get('contact'))) { + return $employee; + } + return Employee::orderBy('id', 'asc')->first(); + } } diff --git a/components/Component.php b/components/Component.php index bd12b00..946426f 100644 --- a/components/Component.php +++ b/components/Component.php @@ -9,94 +9,91 @@ class Component extends ComponentBase { - public $item; - public $list; - public $table; + public $item; + public $list; + public $table; - public function componentDetails() - { - } + public function componentDetails() + { + } - public function defineProperties() - { - return [ - 'itemId' => [ - 'title' => 'hambern.company::lang.labels.item_id', - 'description' => 'hambern.company::lang.descriptions.item_id', - 'default' => '', - 'type' => 'string', - 'validationPattern' => '^[0-9]+$', - ], - 'maxItems' => [ - 'title' => 'hambern.company::lang.labels.max_items', - 'description' => 'hambern.company::lang.descriptions.max_items', - 'default' => 36, - 'type' => 'string', - 'validationPattern' => '^[0-9]+$', - ], - 'orderBy' => [ - 'title' => 'hambern.company::lang.labels.order_by', - 'description' => 'hambern.company::lang.descriptions.order_by', - 'type' => 'dropdown', - 'default' => 'id', - 'group' => 'hambern.company::lang.labels.order', - ], - 'sort' => [ - 'title' => 'hambern.company::lang.labels.sort', - 'description' => 'hambern.company::lang.descriptions.sort', - 'type' => 'dropdown', - 'default' => 'desc', - 'group' => 'hambern.company::lang.labels.order', - ], - 'paginate' => [ - 'title' => 'hambern.company::lang.labels.paginate', - 'description' => 'hambern.company::lang.descriptions.paginate', - 'type' => 'checkbox', - 'default' => false, - 'group' => 'hambern.company::lang.labels.paginate', - ], - 'page' => [ - 'title' => 'hambern.company::lang.labels.page', - 'description' => 'hambern.company::lang.descriptions.page', - 'type' => 'string', - 'default' => '1', - 'validationPattern' => '^[0-9]+$', - 'group' => 'hambern.company::lang.labels.paginate', - ], - 'perPage' => [ - 'title' => 'hambern.company::lang.labels.per_page', - 'description' => 'hambern.company::lang.descriptions.per_page', - 'type' => 'string', - 'default' => '12', - 'validationPattern' => '^[0-9]+$', - 'group' => 'hambern.company::lang.labels.paginate', - ], - ]; - } + public function defineProperties() + { + return [ + 'itemId' => [ + 'title' => 'hambern.company::lang.labels.item_id', + 'description' => 'hambern.company::lang.descriptions.item_id', + 'default' => '{{ :model }}', + ], + 'modelIdentifier' => [ + 'title' => 'hambern.company::lang.misc.model_identifier', + 'description' => 'hambern.company::lang.descriptions.model_identifier', + 'type' => 'dropdown', + 'options' => ['id' => 'id', 'slug' => 'slug'], + 'default' => 'id', + ], + 'maxItems' => [ + 'title' => 'hambern.company::lang.labels.max_items', + 'description' => 'hambern.company::lang.descriptions.max_items', + 'default' => 36, + 'type' => 'string', + 'validationPattern' => '^[0-9]+$', + ], + 'orderBy' => [ + 'title' => 'hambern.company::lang.labels.order_by', + 'description' => 'hambern.company::lang.descriptions.order_by', + 'type' => 'dropdown', + 'default' => 'id', + 'group' => 'hambern.company::lang.labels.order', + ], + 'sort' => [ + 'title' => 'hambern.company::lang.labels.sort', + 'description' => 'hambern.company::lang.descriptions.sort', + 'type' => 'dropdown', + 'default' => 'desc', + 'group' => 'hambern.company::lang.labels.order', + ], + 'paginate' => [ + 'title' => 'hambern.company::lang.labels.paginate', + 'description' => 'hambern.company::lang.descriptions.paginate', + 'type' => 'checkbox', + 'default' => false, + 'group' => 'hambern.company::lang.labels.paginate', + ], + 'page' => [ + 'title' => 'hambern.company::lang.labels.page', + 'description' => 'hambern.company::lang.descriptions.page', + 'type' => 'string', + 'default' => '1', + 'validationPattern' => '^[0-9]+$', + 'group' => 'hambern.company::lang.labels.paginate', + ], + 'perPage' => [ + 'title' => 'hambern.company::lang.labels.per_page', + 'description' => 'hambern.company::lang.descriptions.per_page', + 'type' => 'string', + 'default' => '12', + 'validationPattern' => '^[0-9]+$', + 'group' => 'hambern.company::lang.labels.paginate', + ], + ]; + } - public function getSortOptions() - { - return [ - 'desc' => Lang::get('hambern.company::lang.labels.descending'), - 'asc' => Lang::get('hambern.company::lang.labels.ascending'), - ]; - } + public function getSortOptions() + { + return [ + 'desc' => Lang::get('hambern.company::lang.labels.descending'), + 'asc' => Lang::get('hambern.company::lang.labels.ascending'), + ]; + } - public function getOrderByOptions() - { - $schema = Schema::getColumnListing($this->table); - foreach ($schema as $column) { - $options[$column] = ucwords(str_replace('_', ' ', $column)); - } - return $options; - } + public function getOrderByOptions() + { + $schema = Schema::getColumnListing($this->table); + foreach ($schema as $column) { + $options[$column] = ucwords(str_replace('_', ' ', $column)); + } + return $options; + } - public function getFilterTagOptions() - { - $options = [Lang::get('hambern.company::lang.labels.show_all')]; - $tags = Tag::all(); - if ($tags) - $options += $tags->lists('name', 'id'); - return $options; - } } diff --git a/components/Employees.php b/components/Employees.php index c87b155..4f3db72 100644 --- a/components/Employees.php +++ b/components/Employees.php @@ -6,71 +6,83 @@ class Employees extends Component { - public $table = 'hambern_company_employees'; + public $table = 'hambern_company_employees'; - public function componentDetails() - { - return [ - 'name' => 'hambern.company::lang.components.employees.name', - 'description' => 'hambern.company::lang.components.employees.description', - ]; - } + public function componentDetails() + { + return [ + 'name' => 'hambern.company::lang.components.employees.name', + 'description' => 'hambern.company::lang.components.employees.description', + ]; + } - public function onRun() - { - $this->page['employee'] = $this->employee(); - $this->page['employees'] = $this->employees(); - } + public function onRun() + { + $this->page['employee'] = $this->employee(); + $this->page['employees'] = $this->employees(); + } - public function defineProperties() - { - $properties = parent::defineProperties(); - $properties['filterRole'] = [ - 'title' => 'hambern.company::lang.roles.menu_label', - 'description' => 'hambern.company::lang.descriptions.filter_roles', - 'type' => 'dropdown', - 'group' => 'hambern.company::lang.labels.filters', - ]; - return $properties; - } + public function employee() + { + if (!empty($this->property('itemId'))) { + if ($this->item) return $this->item; + return $this->item = Employee::where($this->property('modelIdentifier', 'id'), $this->property('itemId')) + ->with('picture') + ->first(); + } + } - public function employee() - { - if (is_numeric($this->property('itemId')) && !empty($this->property('itemId'))) { - if ($this->item) return $this->item; - return $this->item = Employee::whereId($this->property('itemId'))->with('picture')->first(); - } - } + public function employees() + { + if (empty($this->property('itemId'))) { + if ($this->list) return $this->list; - public function employees() - { - if (!is_numeric($this->property('itemId')) || empty($this->property('itemId'))) { - if ($this->list) return $this->list; + $employees = Employee::published()->with('picture'); - $employees = Employee::published()->with('picture'); + if ($this->property('filterRole')) { + $id_attribute = $this->property('roleIdentifier', 'id'); + $employees->whereHas('roles', function ($query) use ($id_attribute) { + $query->where($id_attribute, '=', $this->property('filterRole')); + })->with('roles'); + } - if ($this->property('filterRole')) { - $employees->whereHas('roles', function ($query) { - $query->where('id', '=', $this->property('filterRole')); - })->with('roles'); - } + $employees = $employees->orderBy( + $this->property('orderBy', 'id'), + $this->property('sort', 'desc'))->take($this->property('maxItems')); - $employees = $employees->orderBy( - $this->property('orderBy', 'id'), - $this->property('sort', 'desc'))->take($this->property('maxItems')); + return $this->list = $this->property('paginate') ? + $employees->paginate($this->property('perPage'), $this->property('page')) : + $employees->get(); + } + } - return $this->list = $this->property('paginate') ? - $employees->paginate($this->property('perPage'), $this->property('page')) : - $employees->get(); + public function defineProperties() + { + $properties = parent::defineProperties(); + $properties['roleIdentifier'] = [ + 'title' => 'hambern.company::lang.roles.role_identifier', + 'description' => 'hambern.company::lang.descriptions.role_identifier', + 'type' => 'dropdown', + 'options' => ['id' => 'id', 'slug' => 'slug'], + 'default' => 'id', + 'group' => 'hambern.company::lang.labels.filters', + ]; + $properties['filterRole'] = [ + 'title' => 'hambern.company::lang.roles.menu_label', + 'description' => 'hambern.company::lang.descriptions.filter_roles', + 'type' => 'dropdown', + 'group' => 'hambern.company::lang.labels.filters', + ]; + return $properties; } - } - public function getFilterRoleOptions() - { - $options = [Lang::get('hambern.company::lang.labels.show_all')]; - $roles = Role::has('employees')->get(); - if ($roles) - $options += $roles->lists('name', 'id'); - return $options; - } + public function getFilterRoleOptions() + { + $options = [Lang::get('hambern.company::lang.labels.show_all')]; + $roles = Role::has('employees')->get(); + $id_attribute = $this->property('roleIdentifier', 'id'); + if ($roles) + $options += $roles->lists('name', $id_attribute); + return $options; + } } diff --git a/components/Galleries.php b/components/Galleries.php index 959d934..585a805 100644 --- a/components/Galleries.php +++ b/components/Galleries.php @@ -6,72 +6,83 @@ class Galleries extends Component { + public $table = 'hambern_company_galleries'; - public $table = 'hambern_company_galleries'; - - public function componentDetails() - { - return [ - 'name' => 'hambern.company::lang.components.galleries.name', - 'description' => 'hambern.company::lang.components.galleries.description', - ]; - } + public function componentDetails() + { + return [ + 'name' => 'hambern.company::lang.components.galleries.name', + 'description' => 'hambern.company::lang.components.galleries.description', + ]; + } - public function onRun() - { - $this->page['gallery'] = $this->gallery(); - $this->page['galleries'] = $this->galleries(); - } + public function onRun() + { + $this->page['gallery'] = $this->gallery(); + $this->page['galleries'] = $this->galleries(); + } - public function defineProperties() - { - $properties = parent::defineProperties(); - $properties['filterTag'] = [ - 'title' => 'hambern.company::lang.tags.menu_label', - 'description' => 'hambern.company::lang.descriptions.filter_tags', - 'type' => 'dropdown', - 'group' => 'hambern.company::lang.labels.filters', - ]; - return $properties; - } + public function gallery() + { + if (!empty($this->property('itemId'))) { + if ($this->item) return $this->item; + return $this->item = Gallery::where($this->property('modelIdentifier', 'id'), $this->property('itemId')) + ->with('pictures') + ->first(); + } + } - public function gallery() - { - if (is_numeric($this->property('itemId')) && !empty($this->property('itemId'))) { - if ($this->item) return $this->item; - return $this->item = Gallery::whereId($this->property('itemId'))->with('pictures')->first(); - } - } + public function galleries() + { + if (empty($this->property('itemId'))) { + if ($this->list) return $this->list; - public function galleries() - { - if (!is_numeric($this->property('itemId')) || empty($this->property('itemId'))) { - if ($this->list) return $this->list; + $galleries = Gallery::published()->with('pictures'); - $galleries = Gallery::published()->with('pictures'); + if ($this->property('filterTag')) { + $id_attribute = $this->property('tagIdentifier', 'id'); + $galleries->whereHas('tags', function ($query) use ($id_attribute) { + $query->where($id_attribute, '=', $this->property('filterTag')); + })->with('tags'); + } - if ($this->property('filterTag')) { - $galleries->whereHas('tags', function ($query) { - $query->where('id', '=', $this->property('filterTag')); - })->with('tags'); - } + $galleries = $galleries->orderBy( + $this->property('orderBy', 'id'), + $this->property('sort', 'desc'))->take($this->property('maxItems')); - $galleries = $galleries->orderBy( - $this->property('orderBy', 'id'), - $this->property('sort', 'desc'))->take($this->property('maxItems')); + return $this->list = $this->property('paginate') ? + $galleries->paginate($this->property('perPage'), $this->property('page')) : + $galleries->get(); + } + } - return $this->list = $this->property('paginate') ? - $galleries->paginate($this->property('perPage'), $this->property('page')) : - $galleries->get(); + public function defineProperties() + { + $properties = parent::defineProperties(); + $properties['tagIdentifier'] = [ + 'title' => 'hambern.company::lang.tags.tag_identifier', + 'description' => 'hambern.company::lang.descriptions.tag_identifier', + 'type' => 'dropdown', + 'options' => ['id' => 'id', 'slug' => 'slug'], + 'default' => 'id', + 'group' => 'hambern.company::lang.labels.filters', + ]; + $properties['filterTag'] = [ + 'title' => 'hambern.company::lang.tags.menu_label', + 'description' => 'hambern.company::lang.descriptions.filter_tags', + 'type' => 'dropdown', + 'group' => 'hambern.company::lang.labels.filters', + ]; + return $properties; } - } - public function getFilterTagOptions() - { - $options = [Lang::get('hambern.company::lang.labels.show_all')]; - $tags = Tag::has('galleries')->get(); - if ($tags) - $options += $tags->lists('name', 'id'); - return $options; - } + public function getFilterTagOptions() + { + $options = [Lang::get('hambern.company::lang.labels.show_all')]; + $tags = Tag::has('galleries')->get(); + $id_attribute = $this->property('tagIdentifier', 'id'); + if ($tags) + $options += $tags->lists('name', $id_attribute); + return $options; + } } diff --git a/components/Links.php b/components/Links.php index 26f256e..0df8a7c 100644 --- a/components/Links.php +++ b/components/Links.php @@ -5,42 +5,44 @@ class Links extends Component { - public $table = 'hambern_company_links'; - - public function componentDetails() - { - return [ - 'name' => 'hambern.company::lang.components.links.name', - 'description' => 'hambern.company::lang.components.links.description' - ]; - } - - public function onRun() - { - $this->page['link'] = $this->link(); - $this->page['links'] = $this->links(); - } - - public function link() - { - if (is_numeric($this->property('itemId')) && !empty($this->property('itemId'))) { - if ($this->item) return $this->item; - return $this->item = Link::whereId($this->property('itemId'))->with('picture', 'pictures')->first(); + public $table = 'hambern_company_links'; + + public function componentDetails() + { + return [ + 'name' => 'hambern.company::lang.components.links.name', + 'description' => 'hambern.company::lang.components.links.description' + ]; } - } - - public function links() - { - if (!is_numeric($this->property('itemId')) || empty($this->property('itemId'))) { - if ($this->list) return $this->list; - $links = Link::published() - ->with('picture', 'pictures') - ->orderBy($this->property('orderBy', 'id'), $this->property('sort', 'desc')) - ->take($this->property('maxItems')); - - return $this->list = $this->property('paginate') ? - $links->paginate($this->property('perPage'), $this->property('page')) : - $links->get(); + + public function onRun() + { + $this->page['link'] = $this->link(); + $this->page['links'] = $this->links(); + } + + public function link() + { + if (!empty($this->property('itemId'))) { + if ($this->item) return $this->item; + return $this->item = Link::where($this->property('modelIdentifier', 'id'), $this->property('itemId')) + ->with('picture', 'pictures') + ->first(); + } + } + + public function links() + { + if (empty($this->property('itemId'))) { + if ($this->list) return $this->list; + $links = Link::published() + ->with('picture', 'pictures') + ->orderBy($this->property('orderBy', 'id'), $this->property('sort', 'desc')) + ->take($this->property('maxItems')); + + return $this->list = $this->property('paginate') ? + $links->paginate($this->property('perPage'), $this->property('page')) : + $links->get(); + } } - } } diff --git a/components/Projects.php b/components/Projects.php index f5640cb..dcb737f 100644 --- a/components/Projects.php +++ b/components/Projects.php @@ -7,71 +7,84 @@ class Projects extends Component { - public $table = 'hambern_company_projects'; + public $table = 'hambern_company_projects'; - public function componentDetails() - { - return [ - 'name' => 'hambern.company::lang.components.projects.name', - 'description' => 'hambern.company::lang.components.projects.description', - ]; - } - - public function onRun() - { - $this->page['project'] = $this->project(); - $this->page['projects'] = $this->projects(); - } + public function componentDetails() + { + return [ + 'name' => 'hambern.company::lang.components.projects.name', + 'description' => 'hambern.company::lang.components.projects.description', + ]; + } - public function defineProperties() - { - $properties = parent::defineProperties(); - $properties['filterTag'] = [ - 'title' => 'hambern.company::lang.tags.menu_label', - 'description' => 'hambern.company::lang.descriptions.filter_tags', - 'type' => 'dropdown', - 'group' => 'hambern.company::lang.labels.filters', - ]; - return $properties; - } + public function onRun() + { + $this->page['project'] = $this->project(); + $this->page['projects'] = $this->projects(); + } - public function project() - { - if (is_numeric($this->property('itemId')) && !empty($this->property('itemId'))) { - if ($this->item) return $this->item; - return $this->item = Project::whereId($this->property('itemId'))->with('picture', 'pictures', 'files')->first(); + public function project() + { + if (!empty($this->property('itemId'))) { + if ($this->item) return $this->item; + return $this->item = Project::where($this->property('modelIdentifier', 'id'), $this->property('itemId')) + ->with('picture', 'pictures', 'files') + ->first(); + } } - } - public function projects() - { - if (!is_numeric($this->property('itemId')) || empty($this->property('itemId'))) { - if ($this->list) return $this->list; + public function projects() + { + if (empty($this->property('itemId'))) { + if ($this->list) return $this->list; - $projects = Project::published()->with('picture', 'pictures', 'files'); + $projects = Project::published()->with('picture', 'pictures', 'files'); - if ($this->property('filterTag')) { - $projects->whereHas('tags', function ($query) { - $query->where('id', '=', $this->property('filterTag')); - })->with('tags'); - } + if ($this->property('filterTag')) { + $id_attribute = $this->property('tagIdentifier', 'id'); + $projects->whereHas('tags', function ($query) use ($id_attribute) { + $query->where($id_attribute, '=', $this->property('filterTag')); + })->with('tags'); + } - $projects = $projects->orderBy( - $this->property('orderBy', 'id'), - $this->property('sort', 'desc'))->take($this->property('maxItems')); + $projects = $projects->orderBy( + $this->property('orderBy', 'id'), + $this->property('sort', 'desc'))->take($this->property('maxItems')); - return $this->list = $this->property('paginate') ? - $projects->paginate($this->property('perPage'), $this->property('page')) : - $projects->get(); + return $this->list = $this->property('paginate') ? + $projects->paginate($this->property('perPage'), $this->property('page')) : + $projects->get(); + } } - } - public function getFilterTagOptions() - { - $options = [Lang::get('hambern.company::lang.labels.show_all')]; - $tags = Tag::has('projects')->get(); - if ($tags) - $options += $tags->lists('name', 'id'); - return $options; - } + public function defineProperties() + { + $properties = parent::defineProperties(); + $properties['tagIdentifier'] = [ + 'title' => 'hambern.company::lang.tags.tag_identifier', + 'description' => 'hambern.company::lang.descriptions.tag_identifier', + 'type' => 'dropdown', + 'options' => ['id' => 'id', 'slug' => 'slug'], + 'default' => 'id', + 'group' => 'hambern.company::lang.labels.filters', + ]; + $properties['filterTag'] = [ + 'title' => 'hambern.company::lang.tags.menu_label', + 'description' => 'hambern.company::lang.descriptions.filter_tags', + 'type' => 'dropdown', + 'depends' => ['tagIdentifier'], + 'group' => 'hambern.company::lang.labels.filters', + ]; + return $properties; + } + + public function getFilterTagOptions() + { + $options = [Lang::get('hambern.company::lang.labels.show_all')]; + $tags = Tag::has('projects')->get(); + $id_attribute = $this->property('tagIdentifier', 'id'); + if ($tags) + $options += $tags->lists('name', $id_attribute); + return $options; + } } diff --git a/components/Roles.php b/components/Roles.php index 7bf13cf..c2c1756 100644 --- a/components/Roles.php +++ b/components/Roles.php @@ -4,43 +4,44 @@ class Roles extends Component { + public $table = 'hambern_company_roles'; + + public function componentDetails() + { + return [ + 'name' => 'hambern.company::lang.components.roles.name', + 'description' => 'hambern.company::lang.components.roles.description', + ]; + } - public $table = 'hambern_company_roles'; - - public function componentDetails() - { - return [ - 'name' => 'hambern.company::lang.components.roles.name', - 'description' => 'hambern.company::lang.components.roles.description', - ]; - } - - public function onRun() - { - $this->page['role'] = $this->role(); - $this->page['roles'] = $this->roles(); - } - - public function role() - { - if (is_numeric($this->property('itemId')) && !empty($this->property('itemId'))) { - if ($this->item) return $this->item; - return $this->item = Role::whereId($this->property('itemId'))->with('employees')->first(); + public function onRun() + { + $this->page['role'] = $this->role(); + $this->page['roles'] = $this->roles(); } - } - public function roles() - { - if (!is_numeric($this->property('itemId')) || empty($this->property('itemId'))) { - if ($this->list) return $this->list; - $roles = Role::published() - ->with('employees') - ->orderBy($this->property('orderBy', 'id'), $this->property('sort', 'desc')) - ->take($this->property('maxItems')); + public function role() + { + if (!empty($this->property('itemId'))) { + if ($this->item) return $this->item; + return $this->item = Role::where($this->property('modelIdentifier', 'id'), $this->property('itemId')) + ->with('employees') + ->first(); + } + } - return $this->list = $this->property('paginate') ? - $roles->paginate($this->property('perPage'), $this->property('page')) : - $roles->get(); + public function roles() + { + if (empty($this->property('itemId'))) { + if ($this->list) return $this->list; + $roles = Role::published() + ->with('employees') + ->orderBy($this->property('orderBy', 'id'), $this->property('sort', 'desc')) + ->take($this->property('maxItems')); + + return $this->list = $this->property('paginate') ? + $roles->paginate($this->property('perPage'), $this->property('page')) : + $roles->get(); + } } - } } diff --git a/components/Services.php b/components/Services.php index bd55e81..5e94c4f 100644 --- a/components/Services.php +++ b/components/Services.php @@ -7,71 +7,83 @@ class Services extends Component { - public $table = 'hambern_company_services'; + public $table = 'hambern_company_services'; - public function componentDetails() - { - return [ - 'name' => 'hambern.company::lang.components.services.name', - 'description' => 'hambern.company::lang.components.services.description', - ]; - } - - public function onRun() - { - $this->page['service'] = $this->service(); - $this->page['services'] = $this->services(); - } + public function componentDetails() + { + return [ + 'name' => 'hambern.company::lang.components.services.name', + 'description' => 'hambern.company::lang.components.services.description', + ]; + } - public function defineProperties() - { - $properties = parent::defineProperties(); - $properties['filterTag'] = [ - 'title' => 'hambern.company::lang.tags.menu_label', - 'description' => 'hambern.company::lang.descriptions.filter_tags', - 'type' => 'dropdown', - 'group' => 'hambern.company::lang.labels.filters', - ]; - return $properties; - } + public function onRun() + { + $this->page['service'] = $this->service(); + $this->page['services'] = $this->services(); + } - public function service() - { - if (is_numeric($this->property('itemId')) && !empty($this->property('itemId'))) { - if ($this->item) return $this->item; - return $this->item = Service::whereId($this->property('itemId'))->with('picture', 'pictures', 'files')->first(); + public function service() + { + if (!empty($this->property('itemId'))) { + if ($this->item) return $this->item; + return $this->item = Service::where($this->property('modelIdentifier', 'id'), $this->property('itemId')) + ->with('picture', 'pictures', 'files') + ->first(); + } } - } - public function services() - { - if (!is_numeric($this->property('itemId')) || empty($this->property('itemId'))) { - if ($this->list) return $this->list; + public function services() + { + if (empty($this->property('itemId'))) { + if ($this->list) return $this->list; - $services = Service::published()->with('picture', 'pictures', 'files'); + $services = Service::published()->with('picture', 'pictures', 'files'); - if ($this->property('filterTag')) { - $services->whereHas('tags', function ($query) { - $query->where('id', '=', $this->property('filterTag')); - })->with('tags'); - } + if ($this->property('filterTag')) { + $id_attribute = $this->property('tagIdentifier', 'id'); + $services->whereHas('tags', function ($query) use ($id_attribute) { + $query->where($id_attribute, '=', $this->property('filterTag')); + })->with('tags'); + } - $services = $services->orderBy( - $this->property('orderBy', 'id'), - $this->property('sort', 'desc'))->take($this->property('maxItems')); + $services = $services->orderBy( + $this->property('orderBy', 'id'), + $this->property('sort', 'desc'))->take($this->property('maxItems')); - return $this->list = $this->property('paginate') ? - $services->paginate($this->property('perPage'), $this->property('page')) : - $services->get(); + return $this->list = $this->property('paginate') ? + $services->paginate($this->property('perPage'), $this->property('page')) : + $services->get(); + } } - } - public function getFilterTagOptions() - { - $options = [Lang::get('hambern.company::lang.labels.show_all')]; - $tags = Tag::has('services')->get(); - if ($tags) - $options += $tags->lists('name', 'id'); - return $options; - } + public function defineProperties() + { + $properties = parent::defineProperties(); + $properties['tagIdentifier'] = [ + 'title' => 'hambern.company::lang.tags.tag_identifier', + 'description' => 'hambern.company::lang.descriptions.tag_identifier', + 'type' => 'dropdown', + 'options' => ['id' => 'id', 'slug' => 'slug'], + 'default' => 'id', + 'group' => 'hambern.company::lang.labels.filters', + ]; + $properties['filterTag'] = [ + 'title' => 'hambern.company::lang.tags.menu_label', + 'description' => 'hambern.company::lang.descriptions.filter_tags', + 'type' => 'dropdown', + 'group' => 'hambern.company::lang.labels.filters', + ]; + return $properties; + } + + public function getFilterTagOptions() + { + $options = [Lang::get('hambern.company::lang.labels.show_all')]; + $tags = Tag::has('services')->get(); + $id_attribute = $this->property('tagIdentifier', 'id'); + if ($tags) + $options += $tags->lists('name', $id_attribute); + return $options; + } } diff --git a/components/Tags.php b/components/Tags.php index 06ac702..65c760d 100644 --- a/components/Tags.php +++ b/components/Tags.php @@ -4,44 +4,45 @@ class Tags extends Component { + public $table = 'hambern_company_tags'; + + public function componentDetails() + { + return [ + 'name' => 'hambern.company::lang.components.tags.name', + 'description' => 'hambern.company::lang.components.tags.description' + ]; + } + + public function onRun() + { + $this->page['tag'] = $this->tag(); + $this->page['tags'] = $this->tags(); + } - public $table = 'hambern_company_tags'; - - public function componentDetails() - { - return [ - 'name' => 'hambern.company::lang.components.tags.name', - 'description' => 'hambern.company::lang.components.tags.description' - ]; - } - - public function onRun() - { - $this->page['tag'] = $this->tag(); - $this->page['tags'] = $this->tags(); - } - - public function tag() - { - if (is_numeric($this->property('itemId')) && !empty($this->property('itemId'))) { - if ($this->item) return $this->item; - return $this->item = Tag::whereId($this->property('itemId'))->with('picture', 'pictures')->first(); + public function tag() + { + if (!empty($this->property('itemId'))) { + if ($this->item) return $this->item; + return $this->item = Tag::where($this->property('modelIdentifier', 'id'), $this->property('itemId')) + ->with('picture', 'pictures') + ->first(); + } } - } - - public function tags() - { - if (!is_numeric($this->property('itemId')) || empty($this->property('itemId'))) { - if ($this->list) return $this->list; - $tags = Tag::published() - ->with('picture', 'pictures') - ->orderBy($this->property('orderBy', 'id'), $this->property('sort', 'desc')) - ->take($this->property('maxItems')); - - return $this->list = $this->property('paginate') ? - $tags->paginate($this->property('perPage'), $this->property('page')) : - $tags->get(); + + public function tags() + { + if (empty($this->property('itemId'))) { + if ($this->list) return $this->list; + $tags = Tag::published() + ->with('picture', 'pictures') + ->orderBy($this->property('orderBy', 'id'), $this->property('sort', 'desc')) + ->take($this->property('maxItems')); + + return $this->list = $this->property('paginate') ? + $tags->paginate($this->property('perPage'), $this->property('page')) : + $tags->get(); + } } - } } diff --git a/components/Testimonials.php b/components/Testimonials.php index 2916553..fa188e0 100644 --- a/components/Testimonials.php +++ b/components/Testimonials.php @@ -4,43 +4,59 @@ class Testimonials extends Component { + public $table = 'hambern_company_testimonials'; + + public function componentDetails() + { + return [ + 'name' => 'hambern.company::lang.components.testimonials.name', + 'description' => 'hambern.company::lang.components.testimonials.description', + ]; + } + + public function onRun() + { + $this->page['testimonial'] = $this->testimonial(); + $this->page['testimonials'] = $this->testimonials(); + } + + public function testimonial() + { + if (!empty($this->property('itemId'))) { + if ($this->item) return $this->item; + return $this->item = Testimonial::where($this->property('modelIdentifier', 'id'), $this->property('itemId')) + ->with('picture') + ->first(); + } + } - public $table = 'hambern_company_testimonials'; - - public function componentDetails() - { - return [ - 'name' => 'hambern.company::lang.components.testimonials.name', - 'description' => 'hambern.company::lang.components.testimonials.description', - ]; - } - - public function onRun() - { - $this->page['testimonial'] = $this->testimonial(); - $this->page['testimonials'] = $this->testimonials(); - } - - public function testimonial() - { - if (is_numeric($this->property('itemId')) && !empty($this->property('itemId'))) { - if ($this->item) return $this->item; - return $this->item = Testimonial::whereId($this->property('itemId'))->with('picture')->first(); + public function testimonials() + { + if (empty($this->property('itemId'))) { + if ($this->list) return $this->list; + $testimonials = Testimonial::published() + ->with('picture') + ->orderBy($this->property('orderBy', 'id'), $this->property('sort', 'desc')) + ->take($this->property('maxItems')); + + return $this->list = $this->property('paginate') ? + $testimonials->paginate($this->property('perPage'), $this->property('page')) : + $testimonials->get(); + } } - } - - public function testimonials() - { - if (!is_numeric($this->property('itemId')) || empty($this->property('itemId'))) { - if ($this->list) return $this->list; - $testimonials = Testimonial::published() - ->with('picture') - ->orderBy($this->property('orderBy', 'id'), $this->property('sort', 'desc')) - ->take($this->property('maxItems')); - - return $this->list = $this->property('paginate') ? - $testimonials->paginate($this->property('perPage'), $this->property('page')) : - $testimonials->get(); + + public function defineProperties() + { + $properties = parent::defineProperties(); + + $properties['modelIdentifier'] = [ + 'title' => 'hambern.company::lang.misc.model_identifier', + 'description' => 'hambern.company::lang.descriptions.model_identifier', + 'type' => 'dropdown', + 'options' => ['id' => 'id'], + 'default' => 'id', + ]; + + return $properties; } - } } diff --git a/lang/en/lang.php b/lang/en/lang.php index 478d8d8..65ee316 100644 --- a/lang/en/lang.php +++ b/lang/en/lang.php @@ -1,6 +1,4 @@ - [ 'name' => 'Company', 'description' => 'A plugin to show information about your company', @@ -75,6 +73,7 @@ 'delete_confirm' => 'Do you really want to delete this role?', 'delete_selected_success' => 'Successfully deleted the selected roles.', 'delete_selected_empty' => 'There are no selected :name to delete.', + 'role_identifier' => 'Role ID attribute', ], 'descriptions' => [ 'max_items' => 'Pick the maximum amount of results from your component', @@ -85,7 +84,10 @@ 'page' => 'Pick which page number you want to show', 'per_page' => 'Choose how many items you want per page', 'filter_tags' => 'Filter your results based on tags', + 'tag_identifier' => 'Which attribute to use to identify the tag', + 'model_identifier' => 'Which attribute to use to identify the model', 'filter_roles' => 'Filter your results based on roles', + 'role_identifier' => 'Which attribute to use to identify the role', ], 'labels' => [ 'name' => 'Name', @@ -134,6 +136,7 @@ 'city' => 'City', 'fax' => 'Fax', 'link' => 'Link', + 'slug' => 'Slug', ], 'service' => [ 'new' => 'New Service', @@ -242,5 +245,9 @@ 'delete_confirm' => 'Do you really want to delete this Tag?', 'delete_selected_success' => 'Successfully deleted the selected Tags.', 'delete_selected_empty' => 'There are no selected Tags to delete.', + 'tag_identifier' => 'Tag ID attribute', ], -]; + 'misc' => [ + 'model_identifier' => 'Model ID attribute', + ], +]; \ No newline at end of file diff --git a/models/Employee.php b/models/Employee.php index 655d45f..ddbdf5a 100644 --- a/models/Employee.php +++ b/models/Employee.php @@ -5,51 +5,58 @@ */ class Employee extends Model { - /** - * @var string The database table used by the model. - */ - public $table = 'hambern_company_employees'; - /** - * @var array Relations - */ - public $hasOne = []; - public $hasMany = []; - public $belongsTo = []; - public $belongsToMany = [ - 'roles' => [ - 'Hambern\Company\Models\Role', - 'table' => 'hambern_company_pivots', - ], - ]; - public $morphTo = []; - public $morphOne = []; - public $morphMany = []; - public $attachOne = [ - 'picture' => ['System\Models\File'], - ]; - public $attachMany = []; - - protected $appends = ['name', 'duties']; - protected $jsonable = ['social_media']; - - public function getRolesOptions() - { - return Role::all()->lists('name', 'id'); - } - - public function afterDelete() - { - parent::afterDelete(); - $this->roles()->detach(); - } - - public function getNameAttribute() - { - return $this->first_name . ' ' . $this->last_name; - } - - public function getDutiesAttribute() - { - return implode(', ', $this->roles()->orderBy('name', 'asc')->lists('name', 'id')); - } + use \October\Rain\Database\Traits\Sluggable; + + /** + * @var array Generate slugs for these attributes. + */ + protected $slugs = ['slug' => ['first_name', 'last_name']]; + + /** + * @var string The database table used by the model. + */ + public $table = 'hambern_company_employees'; + /** + * @var array Relations + */ + public $hasOne = []; + public $hasMany = []; + public $belongsTo = []; + public $belongsToMany = [ + 'roles' => [ + 'Hambern\Company\Models\Role', + 'table' => 'hambern_company_pivots', + ], + ]; + public $morphTo = []; + public $morphOne = []; + public $morphMany = []; + public $attachOne = [ + 'picture' => ['System\Models\File'], + ]; + public $attachMany = []; + + protected $appends = ['name', 'duties']; + protected $jsonable = ['social_media']; + + public function getRolesOptions() + { + return Role::all()->lists('name', 'id'); + } + + public function afterDelete() + { + parent::afterDelete(); + $this->roles()->detach(); + } + + public function getNameAttribute() + { + return $this->first_name . ' ' . $this->last_name; + } + + public function getDutiesAttribute() + { + return implode(', ', $this->roles()->orderBy('name', 'asc')->lists('name', 'id')); + } } diff --git a/models/Gallery.php b/models/Gallery.php index d7a6100..c83c87c 100644 --- a/models/Gallery.php +++ b/models/Gallery.php @@ -5,28 +5,35 @@ */ class Gallery extends Model { - /** - * @var string The database table used by the model. - */ - public $table = 'hambern_company_galleries'; - /** - * @var array Relations - */ - public $hasOne = []; - public $hasMany = []; - public $belongsTo = []; - public $belongsToMany = [ - 'tags' => [ - 'Hambern\Company\Models\Tag', - 'table' => 'hambern_company_pivots', - ], - ]; - public $morphTo = []; - public $morphOne = []; - public $morphMany = []; - public $attachOne = []; - public $attachMany = [ - 'pictures' => ['System\Models\File'], - ]; + use \October\Rain\Database\Traits\Sluggable; + + /** + * @var array Generate slugs for these attributes. + */ + protected $slugs = ['slug' => 'name']; + + /** + * @var string The database table used by the model. + */ + public $table = 'hambern_company_galleries'; + /** + * @var array Relations + */ + public $hasOne = []; + public $hasMany = []; + public $belongsTo = []; + public $belongsToMany = [ + 'tags' => [ + 'Hambern\Company\Models\Tag', + 'table' => 'hambern_company_pivots', + ], + ]; + public $morphTo = []; + public $morphOne = []; + public $morphMany = []; + public $attachOne = []; + public $attachMany = [ + 'pictures' => ['System\Models\File'], + ]; } diff --git a/models/Link.php b/models/Link.php index a3a7035..d8cb405 100644 --- a/models/Link.php +++ b/models/Link.php @@ -5,6 +5,13 @@ */ class Link extends Model { + use \October\Rain\Database\Traits\Sluggable; + + /** + * @var array Generate slugs for these attributes. + */ + protected $slugs = ['slug' => 'name']; + /** * @var string The database table used by the model. */ diff --git a/models/Project.php b/models/Project.php index 7cb04c4..94f6b1e 100644 --- a/models/Project.php +++ b/models/Project.php @@ -5,42 +5,48 @@ */ class Project extends Model { + use \October\Rain\Database\Traits\Sluggable; - /** - * @var string The database table used by the model. - */ - public $table = 'hambern_company_projects'; - /** - * @var array Relations - */ - public $hasOne = []; - public $hasMany = []; - public $belongsTo = []; - public $belongsToMany = [ - 'services' => [ - 'Hambern\Company\Models\Service', - 'table' => 'hambern_company_pivots', - ], - 'tags' => [ - 'Hambern\Company\Models\Tag', - 'table' => 'hambern_company_pivots', - ], - ]; - public $morphTo = []; - public $morphOne = []; - public $morphMany = []; - public $attachOne = [ - 'picture' => ['System\Models\File'], - ]; - public $attachMany = [ - 'pictures' => ['System\Models\File'], - 'files' => ['System\Models\File'], - ]; + /** + * @var array Generate slugs for these attributes. + */ + protected $slugs = ['slug' => 'name']; - public function afterDelete() - { - parent::afterDelete(); - $this->services()->detach(); - } + /** + * @var string The database table used by the model. + */ + public $table = 'hambern_company_projects'; + /** + * @var array Relations + */ + public $hasOne = []; + public $hasMany = []; + public $belongsTo = []; + public $belongsToMany = [ + 'services' => [ + 'Hambern\Company\Models\Service', + 'table' => 'hambern_company_pivots', + ], + 'tags' => [ + 'Hambern\Company\Models\Tag', + 'table' => 'hambern_company_pivots', + ], + ]; + public $morphTo = []; + public $morphOne = []; + public $morphMany = []; + public $attachOne = [ + 'picture' => ['System\Models\File'], + ]; + public $attachMany = [ + 'pictures' => ['System\Models\File'], + 'files' => ['System\Models\File'], + ]; + + public function afterDelete() + { + parent::afterDelete(); + $this->services()->detach(); + } } diff --git a/models/Role.php b/models/Role.php index e918df9..a05ab49 100644 --- a/models/Role.php +++ b/models/Role.php @@ -5,43 +5,49 @@ */ class Role extends Model { + use \October\Rain\Database\Traits\Sluggable; - /** - * @var string The database table used by the model. - */ - public $table = 'hambern_company_roles'; - /** - * @var array Relations - */ - public $hasOne = []; - public $hasMany = []; - public $belongsTo = []; - public $belongsToMany = [ - 'employees' => [ - 'Hambern\Company\Models\Employee', - 'table' => 'hambern_company_pivots', - ], - ]; - public $morphTo = []; - public $morphOne = []; - public $morphMany = []; - public $attachOne = []; - public $attachMany = []; + /** + * @var array Generate slugs for these attributes. + */ + protected $slugs = ['slug' => 'name']; - public function afterDelete() - { - parent::afterDelete(); - $this->employees()->detach(); - } + /** + * @var string The database table used by the model. + */ + public $table = 'hambern_company_roles'; + /** + * @var array Relations + */ + public $hasOne = []; + public $hasMany = []; + public $belongsTo = []; + public $belongsToMany = [ + 'employees' => [ + 'Hambern\Company\Models\Employee', + 'table' => 'hambern_company_pivots', + ], + ]; + public $morphTo = []; + public $morphOne = []; + public $morphMany = []; + public $attachOne = []; + public $attachMany = []; - public function getEmployeesOptions() - { - $options = []; - $employees = Employee::orderBy('last_name', 'asc')->orderBy('first_name', 'asc')->get(); - foreach ($employees as $employee) { - $options[$employee->id] = $employee->name; - } - return $options; - } + public function afterDelete() + { + parent::afterDelete(); + $this->employees()->detach(); + } + + public function getEmployeesOptions() + { + $options = []; + $employees = Employee::orderBy('last_name', 'asc')->orderBy('first_name', 'asc')->get(); + foreach ($employees as $employee) { + $options[$employee->id] = $employee->name; + } + return $options; + } } diff --git a/models/Service.php b/models/Service.php index b52ed9c..f5f8b0e 100644 --- a/models/Service.php +++ b/models/Service.php @@ -5,42 +5,48 @@ */ class Service extends Model { + use \October\Rain\Database\Traits\Sluggable; - /** - * @var string The database table used by the model. - */ - public $table = 'hambern_company_services'; - /** - * @var array Relations - */ - public $hasOne = []; - public $hasMany = []; - public $belongsTo = []; - public $belongsToMany = [ - 'projects' => [ - 'Hambern\Company\Models\Project', - 'table' => 'hambern_company_pivots', - ], - 'tags' => [ - 'Hambern\Company\Models\Tag', - 'table' => 'hambern_company_pivots', - ], - ]; - public $morphTo = []; - public $morphOne = []; - public $morphMany = []; - public $attachOne = [ - 'picture' => ['System\Models\File'], - ]; - public $attachMany = [ - 'pictures' => ['System\Models\File'], - 'files' => ['System\Models\File'], - ]; + /** + * @var array Generate slugs for these attributes. + */ + protected $slugs = ['slug' => 'name']; - public function afterDelete() - { - parent::afterDelete(); - $this->projects()->detach(); - } + /** + * @var string The database table used by the model. + */ + public $table = 'hambern_company_services'; + /** + * @var array Relations + */ + public $hasOne = []; + public $hasMany = []; + public $belongsTo = []; + public $belongsToMany = [ + 'projects' => [ + 'Hambern\Company\Models\Project', + 'table' => 'hambern_company_pivots', + ], + 'tags' => [ + 'Hambern\Company\Models\Tag', + 'table' => 'hambern_company_pivots', + ], + ]; + public $morphTo = []; + public $morphOne = []; + public $morphMany = []; + public $attachOne = [ + 'picture' => ['System\Models\File'], + ]; + public $attachMany = [ + 'pictures' => ['System\Models\File'], + 'files' => ['System\Models\File'], + ]; + + public function afterDelete() + { + parent::afterDelete(); + $this->projects()->detach(); + } } diff --git a/models/Tag.php b/models/Tag.php index 227250a..5dec0e1 100644 --- a/models/Tag.php +++ b/models/Tag.php @@ -5,6 +5,12 @@ */ class Tag extends Model { + use \October\Rain\Database\Traits\Sluggable; + + /** + * @var array Generate slugs for these attributes. + */ + protected $slugs = ['slug' => 'name']; /** * @var string The database table used by the model. @@ -17,35 +23,35 @@ class Tag extends Model public $hasMany = []; public $belongsTo = []; public $belongsToMany = [ - 'projects' => [ - 'Hambern\Company\Models\Project', - 'table' => 'hambern_company_pivots', - ], - 'services' => [ - 'Hambern\Company\Models\Service', - 'table' => 'hambern_company_pivots', - ], - 'galleries' => [ - 'Hambern\Company\Models\Gallery', - 'table' => 'hambern_company_pivots', - ], + 'projects' => [ + 'Hambern\Company\Models\Project', + 'table' => 'hambern_company_pivots', + ], + 'services' => [ + 'Hambern\Company\Models\Service', + 'table' => 'hambern_company_pivots', + ], + 'galleries' => [ + 'Hambern\Company\Models\Gallery', + 'table' => 'hambern_company_pivots', + ], ]; public $morphTo = []; public $morphOne = []; public $morphMany = []; public $attachOne = [ - 'picture' => ['System\Models\File'], - ]; - public $attachMany = [ - 'pictures' => ['System\Models\File'], - ]; + 'picture' => ['System\Models\File'], + ]; + public $attachMany = [ + 'pictures' => ['System\Models\File'], + ]; public function afterDelete() - { - parent::afterDelete(); - $this->projects()->detach(); - $this->services()->detach(); - $this->galleries()->detach(); - } + { + parent::afterDelete(); + $this->projects()->detach(); + $this->services()->detach(); + $this->galleries()->detach(); + } } diff --git a/models/Testimonial.php b/models/Testimonial.php index 5bbd4ee..1322fe9 100644 --- a/models/Testimonial.php +++ b/models/Testimonial.php @@ -5,24 +5,23 @@ */ class Testimonial extends Model { - - /** - * @var string The database table used by the model. - */ - public $table = 'hambern_company_testimonials'; - /** - * @var array Relations - */ - public $hasOne = []; - public $hasMany = []; - public $belongsTo = []; - public $belongsToMany = []; - public $morphTo = []; - public $morphOne = []; - public $morphMany = []; - public $attachOne = [ - 'picture' => ['System\Models\File'], - ]; - public $attachMany = []; + /** + * @var string The database table used by the model. + */ + public $table = 'hambern_company_testimonials'; + /** + * @var array Relations + */ + public $hasOne = []; + public $hasMany = []; + public $belongsTo = []; + public $belongsToMany = []; + public $morphTo = []; + public $morphOne = []; + public $morphMany = []; + public $attachOne = [ + 'picture' => ['System\Models\File'], + ]; + public $attachMany = []; } diff --git a/models/employee/fields.yaml b/models/employee/fields.yaml index b6e7d90..8647638 100644 --- a/models/employee/fields.yaml +++ b/models/employee/fields.yaml @@ -1,79 +1,91 @@ -# =================================== -# Form Field Definitions -# =================================== - fields: first_name: - label: hambern.company::lang.labels.first_name + label: 'hambern.company::lang.labels.first_name' + oc.commentPosition: '' span: auto + required: 1 + type: text last_name: - label: hambern.company::lang.labels.last_name + label: 'hambern.company::lang.labels.last_name' + oc.commentPosition: '' span: auto + type: text quote: - label: hambern.company::lang.labels.quote + label: 'hambern.company::lang.labels.quote' span: auto + type: text published_at: - label: hambern.company::lang.labels.published_at + label: 'hambern.company::lang.labels.published_at' default: now type: datepicker mode: date span: auto - + slug: + label: 'hambern.company::lang.labels.slug' + oc.commentPosition: '' + span: auto + type: text tabs: - fields: - picture: - label: hambern.company::lang.labels.picture - type: fileupload - mode: image - span: right - imageHeight: 260 - imageWidth: 260 - tab: hambern.company::lang.labels.information - born_at: - label: hambern.company::lang.labels.born_at - type: datepicker - default: today - 30 years - mode: date - minDate: 1900-01-01 - span: left - tab: hambern.company::lang.labels.information - email: - label: hambern.company::lang.labels.email - span: left - tab: hambern.company::lang.labels.information - phone: - label: hambern.company::lang.labels.phone - span: left - tab: hambern.company::lang.labels.information - description: - type: richeditor - size: giant - label: hambern.company::lang.labels.description - span: full - tab: hambern.company::lang.labels.description - roles: - type: partial - path: $/hambern/company/controllers/relations/roles.htm - tab: hambern.company::lang.roles.menu_label - social_media: - type: repeater - tab: hambern.company::lang.labels.social - prompt: hambern.company::lang.labels.social_prompt - form: - fields: - name: - label: hambern.company::lang.labels.name - comment: hambern.company::lang.employees.name_comment - span: auto - icon: - label: hambern.company::lang.labels.icon - span: auto - default: fa- - comment: hambern.company::lang.projects.icon_comment - tab: hambern.company::lang.labels.description - username: - label: hambern.company::lang.labels.username - span: auto - url: - label: hambern.company::lang.labels.user_url - span: auto + fields: + picture: + label: 'hambern.company::lang.labels.picture' + type: fileupload + mode: image + span: right + imageHeight: 260 + imageWidth: 260 + tab: 'hambern.company::lang.labels.information' + born_at: + label: 'hambern.company::lang.labels.born_at' + type: datepicker + default: 'today - 30 years' + mode: date + minDate: -2208988800 + span: left + tab: 'hambern.company::lang.labels.information' + email: + label: 'hambern.company::lang.labels.email' + span: left + tab: 'hambern.company::lang.labels.information' + type: text + phone: + label: 'hambern.company::lang.labels.phone' + span: left + tab: 'hambern.company::lang.labels.information' + type: text + description: + type: richeditor + size: giant + label: 'hambern.company::lang.labels.description' + span: full + tab: 'hambern.company::lang.labels.description' + roles: + type: partial + path: $/hambern/company/controllers/relations/roles.htm + tab: 'hambern.company::lang.roles.menu_label' + social_media: + type: repeater + tab: 'hambern.company::lang.labels.social' + prompt: 'hambern.company::lang.labels.social_prompt' + form: + fields: + name: + label: 'hambern.company::lang.labels.name' + comment: 'hambern.company::lang.employees.name_comment' + span: auto + type: text + icon: + label: 'hambern.company::lang.labels.icon' + span: auto + default: fa- + comment: 'hambern.company::lang.projects.icon_comment' + tab: 'hambern.company::lang.labels.description' + type: text + username: + label: 'hambern.company::lang.labels.username' + span: auto + type: text + url: + label: 'hambern.company::lang.labels.user_url' + span: auto + type: text diff --git a/models/gallery/fields.yaml b/models/gallery/fields.yaml index ed95203..e6d37f2 100644 --- a/models/gallery/fields.yaml +++ b/models/gallery/fields.yaml @@ -1,35 +1,38 @@ -# =================================== -# Form Field Definitions -# =================================== - fields: name: - label: hambern.company::lang.labels.name + label: 'hambern.company::lang.labels.name' + oc.commentPosition: '' span: auto + required: 1 + type: text published_at: - label: hambern.company::lang.labels.published_at + label: 'hambern.company::lang.labels.published_at' type: datepicker default: now mode: date span: auto - + slug: + label: 'hambern.company::lang.labels.slug' + oc.commentPosition: '' + span: auto + type: text tabs: - fields: - pictures: - label: hambern.company::lang.labels.pictures - type: fileupload - mode: image - span: full - imageHeight: 260 - imageWidth: 260 - label: hambern.company::lang.labels.pictures - description: - label: hambern.company::lang.labels.description - type: richeditor - size: giant - span: full - tab: hambern.company::lang.labels.description - tags: - type: partial - path: $/hambern/company/controllers/relations/tags.htm - tab: hambern.company::lang.tags.menu_label + fields: + pictures: + label: 'hambern.company::lang.labels.pictures' + type: fileupload + mode: image + span: full + imageHeight: 260 + imageWidth: 260 + tab: Misc + description: + label: 'hambern.company::lang.labels.description' + type: richeditor + size: giant + span: full + tab: 'hambern.company::lang.labels.description' + tags: + type: partial + path: $/hambern/company/controllers/relations/tags.htm + tab: 'hambern.company::lang.tags.menu_label' diff --git a/models/link/fields.yaml b/models/link/fields.yaml index f16ec58..1c1bfbe 100644 --- a/models/link/fields.yaml +++ b/models/link/fields.yaml @@ -1,48 +1,53 @@ -# =================================== -# Form Field Definitions -# =================================== - fields: name: - label: hambern.company::lang.labels.name + label: 'hambern.company::lang.labels.name' + oc.commentPosition: '' span: auto + required: 1 + type: text published_at: - label: hambern.company::lang.labels.published_at + label: 'hambern.company::lang.labels.published_at' default: now type: datepicker mode: date span: auto url: - label: hambern.company::lang.labels.url + label: 'hambern.company::lang.labels.url' span: auto - default: http:// + default: 'http://' + type: text icon: - label: hambern.company::lang.labels.icon + label: 'hambern.company::lang.labels.icon' span: auto default: fa- - comment: hambern.company::lang.projects.icon_comment - + comment: 'hambern.company::lang.projects.icon_comment' + type: text + slug: + label: 'hambern.company::lang.labels.slug' + oc.commentPosition: '' + span: auto + type: text tabs: fields: description: type: richeditor size: giant - label: hambern.company::lang.labels.description + label: 'hambern.company::lang.labels.description' span: full - tab: hambern.company::lang.labels.description + tab: 'hambern.company::lang.labels.description' picture: - label: hambern.company::lang.labels.picture + label: 'hambern.company::lang.labels.picture' type: fileupload mode: image span: left imageHeight: 260 imageWidth: 260 - tab: hambern.company::lang.labels.attachments + tab: 'hambern.company::lang.labels.attachments' pictures: - label: hambern.company::lang.labels.pictures + label: 'hambern.company::lang.labels.pictures' type: fileupload mode: image span: right imageHeight: 260 imageWidth: 260 - tab: hambern.company::lang.labels.attachments + tab: 'hambern.company::lang.labels.attachments' diff --git a/models/project/fields.yaml b/models/project/fields.yaml index 73a5715..f77e485 100644 --- a/models/project/fields.yaml +++ b/models/project/fields.yaml @@ -1,60 +1,65 @@ -# =================================== -# Form Field Definitions -# =================================== - fields: name: - label: hambern.company::lang.labels.name + label: 'hambern.company::lang.labels.name' + oc.commentPosition: '' span: auto + required: 1 + type: text customer: - label: hambern.company::lang.labels.customer + label: 'hambern.company::lang.labels.customer' span: auto + type: text url: - label: hambern.company::lang.labels.url + label: 'hambern.company::lang.labels.url' span: auto - default: http:// + default: 'http://' + type: text published_at: - label: hambern.company::lang.labels.published_at + label: 'hambern.company::lang.labels.published_at' default: now type: datepicker mode: date span: auto - + slug: + label: 'hambern.company::lang.labels.slug' + oc.commentPosition: '' + span: auto + type: text tabs: - fields: - description: - type: richeditor - size: giant - label: hambern.company::lang.labels.description - span: full - tab: hambern.company::lang.labels.description - services: - type: partial - path: $/hambern/company/controllers/relations/services.htm - tab: hambern.company::lang.services.menu_label - picture: - label: hambern.company::lang.labels.picture - type: fileupload - mode: image - span: left - imageHeight: 260 - imageWidth: 260 - tab: hambern.company::lang.labels.attachments - pictures: - label: hambern.company::lang.labels.pictures - type: fileupload - mode: image - span: right - imageHeight: 260 - imageWidth: 260 - tab: hambern.company::lang.labels.attachments - files: - label: hambern.company::lang.labels.files - type: fileupload - mode: file - span: right - tab: hambern.company::lang.labels.attachments - tags: - type: partial - path: $/hambern/company/controllers/relations/tags.htm - tab: hambern.company::lang.tags.menu_label + fields: + description: + type: richeditor + size: giant + label: 'hambern.company::lang.labels.description' + span: full + tab: 'hambern.company::lang.labels.description' + services: + type: partial + path: $/hambern/company/controllers/relations/services.htm + tab: 'hambern.company::lang.services.menu_label' + picture: + label: 'hambern.company::lang.labels.picture' + type: fileupload + mode: image + span: left + imageHeight: 260 + imageWidth: 260 + tab: 'hambern.company::lang.labels.attachments' + pictures: + label: 'hambern.company::lang.labels.pictures' + type: fileupload + mode: image + span: right + imageHeight: 260 + imageWidth: 260 + tab: 'hambern.company::lang.labels.attachments' + files: + label: 'hambern.company::lang.labels.files' + type: fileupload + mode: file + span: right + tab: 'hambern.company::lang.labels.attachments' + tags: + type: partial + path: $/hambern/company/controllers/relations/tags.htm + tab: 'hambern.company::lang.tags.menu_label' diff --git a/models/project/fields_modal.yaml b/models/project/fields_modal.yaml index c07b925..6af8cb5 100644 --- a/models/project/fields_modal.yaml +++ b/models/project/fields_modal.yaml @@ -1,52 +1,52 @@ -# =================================== -# Form Field Definitions -# =================================== - fields: name: - label: hambern.company::lang.labels.name + label: 'hambern.company::lang.labels.name' + oc.commentPosition: '' span: auto + required: 1 + type: text customer: - label: hambern.company::lang.labels.customer + label: 'hambern.company::lang.labels.customer' span: auto + type: text url: - label: hambern.company::lang.labels.url + label: 'hambern.company::lang.labels.url' span: auto - default: http:// + default: 'http://' + type: text published_at: - label: hambern.company::lang.labels.published_at + label: 'hambern.company::lang.labels.published_at' default: now type: datepicker mode: date span: auto - tabs: - fields: - description: - type: richeditor - size: giant - label: hambern.company::lang.labels.description - span: full - tab: hambern.company::lang.labels.description - picture: - label: hambern.company::lang.labels.picture - type: fileupload - mode: image - span: left - imageHeight: 260 - imageWidth: 260 - tab: hambern.company::lang.labels.attachments - pictures: - label: hambern.company::lang.labels.pictures - type: fileupload - mode: image - span: right - imageHeight: 260 - imageWidth: 260 - tab: hambern.company::lang.labels.attachments - files: - label: hambern.company::lang.labels.files - type: fileupload - mode: file - span: right - tab: hambern.company::lang.labels.attachments + fields: + description: + type: richeditor + size: giant + label: 'hambern.company::lang.labels.description' + span: full + tab: 'hambern.company::lang.labels.description' + picture: + label: 'hambern.company::lang.labels.picture' + type: fileupload + mode: image + span: left + imageHeight: 260 + imageWidth: 260 + tab: 'hambern.company::lang.labels.attachments' + pictures: + label: 'hambern.company::lang.labels.pictures' + type: fileupload + mode: image + span: right + imageHeight: 260 + imageWidth: 260 + tab: 'hambern.company::lang.labels.attachments' + files: + label: 'hambern.company::lang.labels.files' + type: fileupload + mode: file + span: right + tab: 'hambern.company::lang.labels.attachments' diff --git a/models/role/fields.yaml b/models/role/fields.yaml index 56caeda..2c84174 100644 --- a/models/role/fields.yaml +++ b/models/role/fields.yaml @@ -1,26 +1,30 @@ -# =================================== -# Form Field Definitions -# =================================== - fields: name: - label: hambern.company::lang.labels.name + label: 'hambern.company::lang.labels.name' + oc.commentPosition: '' span: auto + required: 1 + type: text published_at: - label: hambern.company::lang.labels.published_at + label: 'hambern.company::lang.labels.published_at' default: now type: datepicker mode: date span: auto + slug: + label: 'hambern.company::lang.labels.slug' + oc.commentPosition: '' + span: auto + type: text tabs: - fields: - description: - type: richeditor - size: giant - label: hambern.company::lang.labels.description - span: full - tab: hambern.company::lang.labels.description - employees: - type: partial - path: $/hambern/company/controllers/relations/employees.htm - tab: hambern.company::lang.employees.menu_label + fields: + description: + type: richeditor + size: giant + label: 'hambern.company::lang.labels.description' + span: full + tab: 'hambern.company::lang.labels.description' + employees: + type: partial + path: $/hambern/company/controllers/relations/employees.htm + tab: 'hambern.company::lang.employees.menu_label' diff --git a/models/service/fields.yaml b/models/service/fields.yaml index f5e5cca..701146e 100644 --- a/models/service/fields.yaml +++ b/models/service/fields.yaml @@ -1,64 +1,68 @@ -# =================================== -# Form Field Definitions -# =================================== - fields: name: - label: hambern.company::lang.labels.name + label: 'hambern.company::lang.labels.name' + oc.commentPosition: '' span: auto + required: 1 + type: text published_at: - label: hambern.company::lang.labels.published_at + label: 'hambern.company::lang.labels.published_at' type: datepicker default: now mode: date span: auto - + slug: + label: 'hambern.company::lang.labels.slug' + oc.commentPosition: '' + span: auto + type: text tabs: fields: description: type: richeditor size: giant - label: hambern.company::lang.labels.description + label: 'hambern.company::lang.labels.description' span: full - tab: hambern.company::lang.labels.description + tab: 'hambern.company::lang.labels.description' icon: - label: hambern.company::lang.labels.icon + label: 'hambern.company::lang.labels.icon' span: left default: fa- - comment: hambern.company::lang.projects.icon_comment - tab: hambern.company::lang.labels.description + comment: 'hambern.company::lang.projects.icon_comment' + tab: 'hambern.company::lang.labels.description' + type: text link: - label: hambern.company::lang.labels.link + label: 'hambern.company::lang.labels.link' span: right type: text - tab: hambern.company::lang.labels.description + tab: 'hambern.company::lang.labels.description' projects: type: partial path: $/hambern/company/controllers/relations/projects.htm - tab: hambern.company::lang.projects.menu_label + tab: 'hambern.company::lang.projects.menu_label' picture: - label: hambern.company::lang.labels.picture + label: 'hambern.company::lang.labels.picture' type: fileupload mode: image span: left imageHeight: 260 imageWidth: 260 - tab: hambern.company::lang.labels.attachments + tab: 'hambern.company::lang.labels.attachments' pictures: - label: hambern.company::lang.labels.pictures + label: 'hambern.company::lang.labels.pictures' type: fileupload mode: image span: right imageHeight: 260 imageWidth: 260 - tab: hambern.company::lang.labels.attachments + tab: 'hambern.company::lang.labels.attachments' files: - label: hambern.company::lang.labels.files + label: 'hambern.company::lang.labels.files' type: fileupload mode: file span: right - tab: hambern.company::lang.labels.attachments + tab: 'hambern.company::lang.labels.attachments' tags: type: partial path: $/hambern/company/controllers/relations/tags.htm - tab: hambern.company::lang.tags.menu_label + tab: 'hambern.company::lang.tags.menu_label' diff --git a/models/service/fields_modal.yaml b/models/service/fields_modal.yaml index e0d0efe..3457281 100644 --- a/models/service/fields_modal.yaml +++ b/models/service/fields_modal.yaml @@ -1,51 +1,50 @@ -# =================================== -# Form Field Definitions -# =================================== - fields: name: - label: hambern.company::lang.labels.name + label: 'hambern.company::lang.labels.name' + oc.commentPosition: '' span: auto + required: 1 + type: text published_at: - label: hambern.company::lang.labels.published_at + label: 'hambern.company::lang.labels.published_at' type: datepicker default: now mode: date span: auto - tabs: fields: description: type: richeditor size: giant - label: hambern.company::lang.labels.description + label: 'hambern.company::lang.labels.description' span: full - tab: hambern.company::lang.labels.description + tab: 'hambern.company::lang.labels.description' icon: - label: hambern.company::lang.labels.icon + label: 'hambern.company::lang.labels.icon' span: full default: fa- - comment: hambern.company::lang.projects.icon_comment - tab: hambern.company::lang.labels.description + comment: 'hambern.company::lang.projects.icon_comment' + tab: 'hambern.company::lang.labels.description' + type: text picture: - label: hambern.company::lang.labels.picture + label: 'hambern.company::lang.labels.picture' type: fileupload mode: image span: left imageHeight: 260 imageWidth: 260 - tab: hambern.company::lang.labels.attachments + tab: 'hambern.company::lang.labels.attachments' pictures: - label: hambern.company::lang.labels.pictures + label: 'hambern.company::lang.labels.pictures' type: fileupload mode: image span: right imageHeight: 260 imageWidth: 260 - tab: hambern.company::lang.labels.attachments + tab: 'hambern.company::lang.labels.attachments' files: - label: hambern.company::lang.labels.files + label: 'hambern.company::lang.labels.files' type: fileupload mode: file span: right - tab: hambern.company::lang.labels.attachments + tab: 'hambern.company::lang.labels.attachments' diff --git a/models/tag/fields.yaml b/models/tag/fields.yaml index f501d3e..3e52ef1 100644 --- a/models/tag/fields.yaml +++ b/models/tag/fields.yaml @@ -1,57 +1,61 @@ -# =================================== -# Form Field Definitions -# =================================== - fields: name: - label: hambern.company::lang.labels.name + label: 'hambern.company::lang.labels.name' + oc.commentPosition: '' span: auto + required: 1 + type: text published_at: - label: hambern.company::lang.labels.published_at + label: 'hambern.company::lang.labels.published_at' type: datepicker default: now mode: date span: auto - + slug: + label: 'hambern.company::lang.labels.slug' + oc.commentPosition: '' + span: auto + type: text tabs: fields: description: type: richeditor size: giant - label: hambern.company::lang.labels.description + label: 'hambern.company::lang.labels.description' span: full - tab: hambern.company::lang.labels.description + tab: 'hambern.company::lang.labels.description' icon: - label: hambern.company::lang.labels.icon + label: 'hambern.company::lang.labels.icon' span: full default: fa-tag - comment: hambern.company::lang.projects.icon_comment - tab: hambern.company::lang.labels.description + comment: 'hambern.company::lang.projects.icon_comment' + tab: 'hambern.company::lang.labels.description' + type: text picture: - label: hambern.company::lang.labels.picture + label: 'hambern.company::lang.labels.picture' type: fileupload mode: image span: left imageHeight: 260 imageWidth: 260 - tab: hambern.company::lang.labels.attachments + tab: 'hambern.company::lang.labels.attachments' pictures: - label: hambern.company::lang.labels.pictures + label: 'hambern.company::lang.labels.pictures' type: fileupload mode: image span: right imageHeight: 260 imageWidth: 260 - tab: hambern.company::lang.labels.attachments + tab: 'hambern.company::lang.labels.attachments' projects: type: partial path: $/hambern/company/controllers/relations/projects.htm - tab: hambern.company::lang.projects.menu_label + tab: 'hambern.company::lang.projects.menu_label' services: type: partial path: $/hambern/company/controllers/relations/services.htm - tab: hambern.company::lang.services.menu_label + tab: 'hambern.company::lang.services.menu_label' galleries: type: partial path: $/hambern/company/controllers/relations/galleries.htm - tab: hambern.company::lang.galleries.menu_label + tab: 'hambern.company::lang.galleries.menu_label' diff --git a/models/tag/fields_modal.yaml b/models/tag/fields_modal.yaml index 60f8e30..bba9a24 100644 --- a/models/tag/fields_modal.yaml +++ b/models/tag/fields_modal.yaml @@ -1,45 +1,44 @@ -# =================================== -# Form Field Definitions -# =================================== - fields: name: - label: hambern.company::lang.labels.name + label: 'hambern.company::lang.labels.name' + oc.commentPosition: '' span: auto + required: 1 + type: text published_at: - label: hambern.company::lang.labels.published_at + label: 'hambern.company::lang.labels.published_at' type: datepicker default: now mode: date span: auto - tabs: fields: description: type: richeditor size: giant - label: hambern.company::lang.labels.description + label: 'hambern.company::lang.labels.description' span: full - tab: hambern.company::lang.labels.description + tab: 'hambern.company::lang.labels.description' icon: - label: hambern.company::lang.labels.icon + label: 'hambern.company::lang.labels.icon' span: full default: fa-tag - comment: hambern.company::lang.projects.icon_comment - tab: hambern.company::lang.labels.description + comment: 'hambern.company::lang.projects.icon_comment' + tab: 'hambern.company::lang.labels.description' + type: text picture: - label: hambern.company::lang.labels.picture + label: 'hambern.company::lang.labels.picture' type: fileupload mode: image span: left imageHeight: 260 imageWidth: 260 - tab: hambern.company::lang.labels.attachments + tab: 'hambern.company::lang.labels.attachments' pictures: - label: hambern.company::lang.labels.pictures + label: 'hambern.company::lang.labels.pictures' type: fileupload mode: image span: right imageHeight: 260 imageWidth: 260 - tab: hambern.company::lang.labels.attachments + tab: 'hambern.company::lang.labels.attachments' diff --git a/models/testimonial/fields.yaml b/models/testimonial/fields.yaml index 9d9d922..01b6ce9 100644 --- a/models/testimonial/fields.yaml +++ b/models/testimonial/fields.yaml @@ -1,28 +1,27 @@ -# =================================== -# Form Field Definitions -# =================================== - fields: content: - label: hambern.company::lang.labels.content + label: 'hambern.company::lang.labels.content' type: textarea span: full picture: - label: hambern.company::lang.labels.picture + label: 'hambern.company::lang.labels.picture' type: fileupload mode: image span: right imageHeight: 260 imageWidth: 260 source: - label: hambern.company::lang.labels.source + label: 'hambern.company::lang.labels.source' + oc.commentPosition: '' span: left + type: text url: - label: hambern.company::lang.labels.url + label: 'hambern.company::lang.labels.url' span: left - default: http:// + default: 'http://' + type: text published_at: - label: hambern.company::lang.labels.published_at + label: 'hambern.company::lang.labels.published_at' type: datepicker default: now mode: date diff --git a/updates/builder_table_update_hambern_company_employees.php b/updates/builder_table_update_hambern_company_employees.php new file mode 100644 index 0000000..a901f0c --- /dev/null +++ b/updates/builder_table_update_hambern_company_employees.php @@ -0,0 +1,30 @@ +string('slug')->index(); + }); + + // Fill slug attributes + Employee::all()->each(function ($model) { + $model->slugAttributes(); + $model->save(); + }); + } + + public function down() + { + Schema::table('hambern_company_employees', function($table) + { + $table->dropColumn('slug'); + }); + } +} \ No newline at end of file diff --git a/updates/builder_table_update_hambern_company_galleries.php b/updates/builder_table_update_hambern_company_galleries.php new file mode 100644 index 0000000..e0a0c9c --- /dev/null +++ b/updates/builder_table_update_hambern_company_galleries.php @@ -0,0 +1,30 @@ +string('slug')->index(); + }); + + // Fill slug attributes + Gallery::all()->each(function ($model) { + $model->slugAttributes(); + $model->save(); + }); + } + + public function down() + { + Schema::table('hambern_company_galleries', function($table) + { + $table->dropColumn('slug'); + }); + } +} \ No newline at end of file diff --git a/updates/builder_table_update_hambern_company_links.php b/updates/builder_table_update_hambern_company_links.php new file mode 100644 index 0000000..9c1326d --- /dev/null +++ b/updates/builder_table_update_hambern_company_links.php @@ -0,0 +1,30 @@ +string('slug')->index(); + }); + + // Fill slug attributes + Link::all()->each(function ($model) { + $model->slugAttributes(); + $model->save(); + }); + } + + public function down() + { + Schema::table('hambern_company_links', function($table) + { + $table->dropColumn('slug'); + }); + } +} \ No newline at end of file diff --git a/updates/builder_table_update_hambern_company_projects.php b/updates/builder_table_update_hambern_company_projects.php new file mode 100644 index 0000000..24c6736 --- /dev/null +++ b/updates/builder_table_update_hambern_company_projects.php @@ -0,0 +1,30 @@ +string('slug')->index(); + }); + + // Fill slug attributes + Project::all()->each(function ($model) { + $model->slugAttributes(); + $model->save(); + }); + } + + public function down() + { + Schema::table('hambern_company_projects', function($table) + { + $table->dropColumn('slug'); + }); + } +} \ No newline at end of file diff --git a/updates/builder_table_update_hambern_company_roles.php b/updates/builder_table_update_hambern_company_roles.php new file mode 100644 index 0000000..422f8eb --- /dev/null +++ b/updates/builder_table_update_hambern_company_roles.php @@ -0,0 +1,30 @@ +string('slug')->index(); + }); + + // Fill slug attributes + Role::all()->each(function ($model) { + $model->slugAttributes(); + $model->save(); + }); + } + + public function down() + { + Schema::table('hambern_company_roles', function($table) + { + $table->dropColumn('slug'); + }); + } +} \ No newline at end of file diff --git a/updates/builder_table_update_hambern_company_services2.php b/updates/builder_table_update_hambern_company_services2.php new file mode 100644 index 0000000..a5d2a2d --- /dev/null +++ b/updates/builder_table_update_hambern_company_services2.php @@ -0,0 +1,30 @@ +string('slug')->index(); + }); + + // Fill slug attributes + Service::all()->each(function ($model) { + $model->slugAttributes(); + $model->save(); + }); + } + + public function down() + { + Schema::table('hambern_company_services', function($table) + { + $table->dropColumn('slug'); + }); + } +} \ No newline at end of file diff --git a/updates/builder_table_update_hambern_company_tags.php b/updates/builder_table_update_hambern_company_tags.php new file mode 100644 index 0000000..edc56ca --- /dev/null +++ b/updates/builder_table_update_hambern_company_tags.php @@ -0,0 +1,30 @@ +string('slug')->index(); + }); + + // Fill slug attributes + Tag::all()->each(function ($model) { + $model->slugAttributes(); + $model->save(); + }); + } + + public function down() + { + Schema::table('hambern_company_tags', function($table) + { + $table->dropColumn('slug'); + }); + } +} \ No newline at end of file diff --git a/updates/version.yaml b/updates/version.yaml index 5280dc5..60a34a6 100644 --- a/updates/version.yaml +++ b/updates/version.yaml @@ -1,111 +1,133 @@ 1.0.1: - - First version of Company + - 'First version of Company' - create_employees_table.php - create_projects_table.php - create_roles_table.php - create_services_table.php - create_pivots_table.php 1.0.2: - - Added galleries + - 'Added galleries' - create_galleries_table.php 1.0.3: - - Added testimonials + - 'Added testimonials' - create_testimonials_table.php 1.0.4: - - Changed timestamps() to nullableTimestamps() in migrations + - 'Changed timestamps() to nullableTimestamps() in migrations' 1.0.5: - - Much better permission integration + - 'Much better permission integration' 1.0.6: - - Important bug fix to permission integration + - 'Important bug fix to permission integration' 1.0.7: - - Another bug fix to permission integration. Still learning this... + - 'Another bug fix to permission integration. Still learning this...' 1.0.8: - - Facepalm update ;) + - 'Facepalm update ;)' 1.1.0: - - Perfected permissions + - 'Perfected permissions' 1.1.1: - - Implements some support of the translate plugin + - 'Implements some support of the translate plugin' 1.1.2: - - Improved services tools + - 'Improved services tools' 1.1.3: - - Further improved services tools + - 'Further improved services tools' 1.1.4: - - Added links tool + - 'Added links tool' - create_links_table.php 1.1.5: - - Minor bug fixes + - 'Minor bug fixes' 1.1.6: - - Settings now also translatable + - 'Settings now also translatable' 1.1.7: - - Employee bug fixed + - 'Employee bug fixed' 1.1.8: - - Added role filter to Employee component + - 'Added role filter to Employee component' 1.1.9: - - Added role component + - 'Added role component' 1.1.10: - - Change string to text on Testimonial content + - 'Change string to text on Testimonial content' - change_testimonials_table_20160201.php 1.1.11: - - Changed field layout for better responsiveness and added markdown for role descriptions + - 'Changed field layout for better responsiveness and added markdown for role descriptions' 1.1.12: - - ...and applying the necessary database-changes + - '...and applying the necessary database-changes' - change_roles_table_20160202.php 1.2.0: - - Added pagination options to the components + - 'Added pagination options to the components' 1.2.1: - - Cleaned up the models and corrected a small bug in the service model + - 'Cleaned up the models and corrected a small bug in the service model' 1.2.2: - - Another small update to the service component + - 'Another small update to the service component' 1.2.3: - - Rearranging components to be able to show several of them at once on the same page + - 'Rearranging components to be able to show several of them at once on the same page' 1.2.4: - - Bug fix and a lot cleaner components + - 'Bug fix and a lot cleaner components' 1.2.5: - - Bug fix in Links component + - 'Bug fix in Links component' 1.2.6: - - Thanks to Jan Vince Company now comes in a Czech translation as well + - 'Thanks to Jan Vince Company now comes in a Czech translation as well' 1.2.7: - - Contacts options updated to suit SQL lite as well (thanx Jan Vince) + - 'Contacts options updated to suit SQL lite as well (thanx Jan Vince)' 1.2.8: - - Fixed bug on Company-form when there were no employees + - 'Fixed bug on Company-form when there were no employees' 1.2.9: - - Add social media information + - 'Add social media information' - change_employees_table_20160816.php 1.2.10: - - Add social media bug fix + - 'Add social media bug fix' - change_employees_table_20160831.php 1.2.11: - - Added social media prompt (thanx Jan Vince) + - 'Added social media prompt (thanx Jan Vince)' 1.2.12: - - Added company email, phone and address + - 'Added company email, phone and address' 1.2.13: - - Updated Czech language file + - 'Updated Czech language file' 1.2.14: - - Fixed a really small typo + - 'Fixed a really small typo' 1.2.15: - - Dutch translations added + - 'Dutch translations added' 1.3.0: - - Added tags + - 'Added tags' - create_tags_table.php - change_pivots_table_20160918.php 1.3.1: - - Added filter options on the components + - 'Added filter options on the components' 1.3.2: - - Added social media to company + - 'Added social media to company' 1.3.3: - - !!! This changes the logo-field in company to mediafinder. You will have to re-upload it + - '!!! This changes the logo-field in company to mediafinder. You will have to re-upload it' 1.3.4: - - Added default dates on published_at and born_at + - 'Added default dates on published_at and born_at' 1.3.5: - - !!! Due to a bug the logo-field is now once again a fileupload. Sorry for this. + - '!!! Due to a bug the logo-field is now once again a fileupload. Sorry for this.' 1.3.6: - - Updated the Czech language file. Thanks Jan Vince! + - 'Updated the Czech language file. Thanks Jan Vince!' 1.3.7: - - Added the Portuguese language file. Thanks Ronaldo Ribeiro de Sousa! + - 'Added the Portuguese language file. Thanks Ronaldo Ribeiro de Sousa!' 1.3.8: - - Adding link to services + - 'Adding link to services' - builder_table_update_hambern_company_services.php 1.3.9: - builder_table_update_hambern_company_services.php - - German language support - - Adding custom links to services + - 'German language support' + - 'Adding custom links to services' +1.4.1: + - 'Slug attribute hambern_company_tags' + - builder_table_update_hambern_company_tags.php +1.4.2: + - 'Slug attribute hambern_company_projects' + - builder_table_update_hambern_company_projects.php +1.4.3: + - 'Slug attribute hambern_company_services' + - builder_table_update_hambern_company_services2.php +1.4.4: + - 'Slug attribute hambern_company_links' + - builder_table_update_hambern_company_links.php +1.4.5: + - 'Updated table hambern_company_employees' + - builder_table_update_hambern_company_employees.php +1.4.6: + - 'Updated table hambern_company_galleries' + - builder_table_update_hambern_company_galleries.php +1.4.7: + - 'Updated table hambern_company_roles' + - builder_table_update_hambern_company_roles.php +1.4.8: 'Slug attribute for pretty urls'