{"action":"closed","issue":{"url":"https://api.github.com/repos/sleeping-owl/admin/issues/249","labels_url":"https://api.github.com/repos/sleeping-owl/admin/issues/249/labels{/name}","comments_url":"https://api.github.com/repos/sleeping-owl/admin/issues/249/comments","events_url":"https://api.github.com/repos/sleeping-owl/admin/issues/249/events","html_url":"https://github.com/sleeping-owl/admin/issues/249","id":108175606,"number":249,"title":"v2 :: Orderable Model - not showing any button","user":{"login":"macedodebrito","id":8905347,"avatar_url":"https://avatars.githubusercontent.com/u/8905347?v=3","gravatar_id":"","url":"https://api.github.com/users/macedodebrito","html_url":"https://github.com/macedodebrito","followers_url":"https://api.github.com/users/macedodebrito/followers","following_url":"https://api.github.com/users/macedodebrito/following{/other_user}","gists_url":"https://api.github.com/users/macedodebrito/gists{/gist_id}","starred_url":"https://api.github.com/users/macedodebrito/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/macedodebrito/subscriptions","organizations_url":"https://api.github.com/users/macedodebrito/orgs","repos_url":"https://api.github.com/users/macedodebrito/repos","events_url":"https://api.github.com/users/macedodebrito/events{/privacy}","received_events_url":"https://api.github.com/users/macedodebrito/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-24T17:24:03Z","updated_at":"2015-09-24T17:40:23Z","closed_at":"2015-09-24T17:40:23Z","body":"Hello again.\r\n\r\ni cant add the \"up/down\" buttons into my table.\r\n\r\nLaravel Version: 4.2\r\nSleepingOwl Version: 2\r\n\r\nAny help would be welcome :)\r\n\r\n1 :: Admin:\r\n<?php \r\n\r\n\tAdmin::model('\\AdminTeam')\r\n\t->title('Team')\r\n\t->columns(function ()\r\n\t{\r\n\t\tColumn::image('image');\r\n\t\tColumn::string('name', 'Name');\r\n\t\tColumn::string('type', 'Department');\r\n\t\tColumn::string('email', 'Email');\r\n\t\tColumn::string('position', 'Order')->sortableDefault();\r\n\t})\r\n\t->form(function ()\r\n\t{\t\t\r\n\t\tFormItem::image('image', 'Imagem')->required();\r\n\t\tFormItem::text('name', 'Name')->required()->attributes(['style' => 'width: 300px']);\r\n\t\tFormItem::text('type', 'Department')->required()->attributes(['style' => 'width: 300px']);\r\n\t\tFormItem::text('email', 'Email')->validationRule('email')->attributes(['style' => 'width: 300px']);\r\n\t});\r\n\r\n2 :: Model:\r\n\r\n<?php \r\nuse SleepingOwl\\Models\\SleepingOwlModel;\r\nuse SleepingOwl\\Models\\Interfaces\\ModelWithImageFieldsInterface;\r\nuse SleepingOwl\\Models\\Traits\\ModelWithImageOrFileFieldsTrait;\r\nuse SleepingOwl\\Models\\Interfaces\\ModelWithOrderFieldInterface;\r\nuse SleepingOwl\\Models\\Traits\\ModelWithOrderFieldTrait;\r\nuse Symfony\\Component\\HttpFoundation\\File\\UploadedFile;\r\n\r\nclass AdminTeam extends SleepingOwlModel implements ModelWithImageFieldsInterface, ModelWithOrderFieldInterface\r\n{\r\n\tuse ModelWithImageOrFileFieldsTrait, ModelWithOrderFieldTrait;\r\n\r\n\tprotected $table = \"team\";\r\n\r\n\tprotected $fillable = [\r\n\t'type',\r\n\t'image',\r\n\t'email',\r\n\t'name',\r\n\t'description',\r\n\t'position'\r\n\t];\r\n\t\r\n\tprotected $hidden = [\r\n\t'created_at',\r\n\t'updated_at'\r\n\t];\r\n\r\n\tpublic static function boot()\r\n\t{\r\n\t\tparent::boot();\r\n\t\tstatic::deleting(function ($item)\r\n\t\t{\r\n\t\t\t/*dd('Deleting event handler executed on item #' . $item->id);*/\r\n\t\t});\r\n\t}\r\n\tpublic function getSortField()\r\n\t{\r\n\t\treturn 'position';\r\n\t}\r\n\tpublic function getImageFields()\r\n\t{\t\t\r\n\t\treturn [ \r\n\t\t'image' => ['gfx/gallery/team/', function($directory, $originalName, $extension)\r\n\t\t{\r\n\t\t\treturn $originalName;\r\n\t\t}]\r\n\t\t];\r\n\t}\r\n\r\n\r\n\r\n\tpublic function scopeDefaultSort($query)\r\n\t{\r\n\t\treturn $query->orderBy('position', 'asc');\r\n\t}\r\n\r\n\tpublic function getValidationRules()\r\n\t{\r\n\t\t// validar imagem\r\n\t\tif ((Input::get('imageConfirmDelete')) && (Input::file('image')==null)) {\r\n\t\t\treturn [ 'image' => 'required' ];\r\n\t\t}\r\n\r\n\t\t// validar email\r\n\t\tif (Input::get('email')) {\r\n\t\t\treturn [ 'email' => 'email' ];\r\n\t\t}\r\n\t\telse {\t\t\t\r\n\t\t\treturn [];\r\n\t\t}\r\n\t}\r\n\r\n}"}}