@@ -12,23 +12,23 @@ |
||
| 12 | 12 | class DatastoreRolesSeeder extends Seeder |
| 13 | 13 | { |
| 14 | 14 | |
| 15 | - /** |
|
| 16 | - * Run the database seed. |
|
| 17 | - */ |
|
| 18 | - public function run() |
|
| 19 | - { |
|
| 15 | + /** |
|
| 16 | + * Run the database seed. |
|
| 17 | + */ |
|
| 18 | + public function run() |
|
| 19 | + { |
|
| 20 | 20 | |
| 21 | - // Create Roles |
|
| 22 | - $cms = Role::create(['name' => 'cms']); |
|
| 21 | + // Create Roles |
|
| 22 | + $cms = Role::create(['name' => 'cms']); |
|
| 23 | 23 | |
| 24 | - // Create Permissions |
|
| 25 | - $permissions = ['manage datastore']; |
|
| 24 | + // Create Permissions |
|
| 25 | + $permissions = ['manage datastore']; |
|
| 26 | 26 | |
| 27 | - foreach ($permissions as $permission) { |
|
| 28 | - Permission::create(['name' => $permission]); |
|
| 27 | + foreach ($permissions as $permission) { |
|
| 28 | + Permission::create(['name' => $permission]); |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | $cms->givePermissionTo('manage datastore'); |
| 32 | 32 | |
| 33 | - } |
|
| 33 | + } |
|
| 34 | 34 | } |
@@ -10,41 +10,41 @@ |
||
| 10 | 10 | */ |
| 11 | 11 | class CreateDatastoreDatastoreTable extends Migration |
| 12 | 12 | { |
| 13 | - /** |
|
| 14 | - * Run the migrations. |
|
| 15 | - * |
|
| 16 | - * @return void |
|
| 17 | - */ |
|
| 18 | - public function up() |
|
| 19 | - { |
|
| 20 | - Schema::create('datastore_datastore', function (Blueprint $table) { |
|
| 21 | - $table->bigIncrements('id'); |
|
| 22 | - $table->unsignedBigInteger('datastore_id')->nullable(); |
|
| 23 | - $table->unsignedBigInteger('datastore2_id')->nullable(); |
|
| 13 | + /** |
|
| 14 | + * Run the migrations. |
|
| 15 | + * |
|
| 16 | + * @return void |
|
| 17 | + */ |
|
| 18 | + public function up() |
|
| 19 | + { |
|
| 20 | + Schema::create('datastore_datastore', function (Blueprint $table) { |
|
| 21 | + $table->bigIncrements('id'); |
|
| 22 | + $table->unsignedBigInteger('datastore_id')->nullable(); |
|
| 23 | + $table->unsignedBigInteger('datastore2_id')->nullable(); |
|
| 24 | 24 | |
| 25 | 25 | $table->unique(['datastore2_id', 'datastore_id']); |
| 26 | - $table->index('datastore_id'); |
|
| 27 | - $table->index('datastore2_id'); |
|
| 26 | + $table->index('datastore_id'); |
|
| 27 | + $table->index('datastore2_id'); |
|
| 28 | 28 | |
| 29 | 29 | |
| 30 | - $table->foreign('datastore_id')->references('id')->on('datastore')->onDelete('CASCADE')->onUpdate('RESTRICT'); |
|
| 30 | + $table->foreign('datastore_id')->references('id')->on('datastore')->onDelete('CASCADE')->onUpdate('RESTRICT'); |
|
| 31 | 31 | $table->foreign('datastore2_id')->references('id')->on('datastore')->onDelete('CASCADE')->onUpdate('RESTRICT'); |
| 32 | 32 | |
| 33 | 33 | |
| 34 | 34 | |
| 35 | - }); |
|
| 35 | + }); |
|
| 36 | 36 | |
| 37 | 37 | |
| 38 | 38 | |
| 39 | - } |
|
| 39 | + } |
|
| 40 | 40 | |
| 41 | - /** |
|
| 42 | - * Reverse the migrations. |
|
| 43 | - * |
|
| 44 | - * @return void |
|
| 45 | - */ |
|
| 46 | - public function down() |
|
| 47 | - { |
|
| 48 | - Schema::dropIfExists('datastore_datastore'); |
|
| 49 | - } |
|
| 41 | + /** |
|
| 42 | + * Reverse the migrations. |
|
| 43 | + * |
|
| 44 | + * @return void |
|
| 45 | + */ |
|
| 46 | + public function down() |
|
| 47 | + { |
|
| 48 | + Schema::dropIfExists('datastore_datastore'); |
|
| 49 | + } |
|
| 50 | 50 | } |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | public function up() |
| 19 | 19 | { |
| 20 | - Schema::create('datastore_datastore', function (Blueprint $table) { |
|
| 20 | + Schema::create('datastore_datastore', function(Blueprint $table) { |
|
| 21 | 21 | $table->bigIncrements('id'); |
| 22 | 22 | $table->unsignedBigInteger('datastore_id')->nullable(); |
| 23 | 23 | $table->unsignedBigInteger('datastore2_id')->nullable(); |
@@ -10,68 +10,68 @@ |
||
| 10 | 10 | */ |
| 11 | 11 | class CreateDatastoreTable extends Migration |
| 12 | 12 | { |
| 13 | - /** |
|
| 14 | - * Run the migrations. |
|
| 15 | - * |
|
| 16 | - * @return void |
|
| 17 | - */ |
|
| 18 | - public function up() |
|
| 19 | - { |
|
| 20 | - Schema::create('datastore', function (Blueprint $table) { |
|
| 13 | + /** |
|
| 14 | + * Run the migrations. |
|
| 15 | + * |
|
| 16 | + * @return void |
|
| 17 | + */ |
|
| 18 | + public function up() |
|
| 19 | + { |
|
| 20 | + Schema::create('datastore', function (Blueprint $table) { |
|
| 21 | 21 | $table->bigIncrements('id'); |
| 22 | - $table->string('type', 255)->nullable(); |
|
| 23 | - $table->string('namespace', 255)->nullable(); |
|
| 24 | - $table->string('module', 255); |
|
| 25 | - $table->string('name', 255)->nullable(); |
|
| 26 | - $table->string('key', 255)->nullable(); |
|
| 27 | - $table->unsignedTinyInteger('private')->nullable()->default(0); |
|
| 28 | - $table->longText('value')->nullable(); |
|
| 29 | - $table->string('options', 255)->nullable(); |
|
| 30 | - $table->string('meta', 255)->nullable(); |
|
| 31 | - $table->string('accept', 255)->nullable()->comment('comma separated list of assets it accepts as related'); |
|
| 32 | - $table->string('accept_limit', 255)->nullable(); |
|
| 33 | - $table->unsignedBigInteger('datastore_id')->nullable(); |
|
| 34 | - $table->string('shortname', 255)->nullable(); |
|
| 35 | - $table->string('children', 255)->nullable(); |
|
| 36 | - $table->unsignedTinyInteger('is_child')->nullable(); |
|
| 37 | - $table->string('status', 255)->nullable(); |
|
| 38 | - $table->string('embedded', 255)->nullable(); |
|
| 39 | - $table->string('theme', 50)->nullable(); |
|
| 40 | - $table->text('meta_description')->nullable(); |
|
| 41 | - $table->text('meta_keywords')->nullable(); |
|
| 42 | - $table->text('page_css')->nullable(); |
|
| 43 | - $table->text('page_js')->nullable(); |
|
| 44 | - $table->string('limit', 20)->nullable(); |
|
| 45 | - $table->string('warning', 20)->nullable(); |
|
| 46 | - $table->string('callback', 255)->nullable(); |
|
| 47 | - $table->unsignedTinyInteger('required')->nullable(); |
|
| 48 | - $table->string('comment_equals', 255)->nullable(); |
|
| 49 | - $table->integer('max_instances')->nullable()->default(0); |
|
| 50 | - $table->date('start_date')->nullable(); |
|
| 51 | - $table->date('end_date')->nullable(); |
|
| 22 | + $table->string('type', 255)->nullable(); |
|
| 23 | + $table->string('namespace', 255)->nullable(); |
|
| 24 | + $table->string('module', 255); |
|
| 25 | + $table->string('name', 255)->nullable(); |
|
| 26 | + $table->string('key', 255)->nullable(); |
|
| 27 | + $table->unsignedTinyInteger('private')->nullable()->default(0); |
|
| 28 | + $table->longText('value')->nullable(); |
|
| 29 | + $table->string('options', 255)->nullable(); |
|
| 30 | + $table->string('meta', 255)->nullable(); |
|
| 31 | + $table->string('accept', 255)->nullable()->comment('comma separated list of assets it accepts as related'); |
|
| 32 | + $table->string('accept_limit', 255)->nullable(); |
|
| 33 | + $table->unsignedBigInteger('datastore_id')->nullable(); |
|
| 34 | + $table->string('shortname', 255)->nullable(); |
|
| 35 | + $table->string('children', 255)->nullable(); |
|
| 36 | + $table->unsignedTinyInteger('is_child')->nullable(); |
|
| 37 | + $table->string('status', 255)->nullable(); |
|
| 38 | + $table->string('embedded', 255)->nullable(); |
|
| 39 | + $table->string('theme', 50)->nullable(); |
|
| 40 | + $table->text('meta_description')->nullable(); |
|
| 41 | + $table->text('meta_keywords')->nullable(); |
|
| 42 | + $table->text('page_css')->nullable(); |
|
| 43 | + $table->text('page_js')->nullable(); |
|
| 44 | + $table->string('limit', 20)->nullable(); |
|
| 45 | + $table->string('warning', 20)->nullable(); |
|
| 46 | + $table->string('callback', 255)->nullable(); |
|
| 47 | + $table->unsignedTinyInteger('required')->nullable(); |
|
| 48 | + $table->string('comment_equals', 255)->nullable(); |
|
| 49 | + $table->integer('max_instances')->nullable()->default(0); |
|
| 50 | + $table->date('start_date')->nullable(); |
|
| 51 | + $table->date('end_date')->nullable(); |
|
| 52 | 52 | $table->string('lang', 255)->nullable(); |
| 53 | 53 | $table->timestamps(); |
| 54 | 54 | |
| 55 | 55 | |
| 56 | 56 | |
| 57 | 57 | |
| 58 | - $table->index('datastore_id', 'index_foreignkey_datastore'); |
|
| 58 | + $table->index('datastore_id', 'index_foreignkey_datastore'); |
|
| 59 | 59 | |
| 60 | - $table->foreign('datastore_id', 'datastore_ibfk_1')->references('id')->on('datastore')->onDelete('CASCADE')->onUpdate('RESTRICT'); |
|
| 60 | + $table->foreign('datastore_id', 'datastore_ibfk_1')->references('id')->on('datastore')->onDelete('CASCADE')->onUpdate('RESTRICT'); |
|
| 61 | 61 | |
| 62 | - }); |
|
| 62 | + }); |
|
| 63 | 63 | |
| 64 | 64 | |
| 65 | 65 | |
| 66 | - } |
|
| 66 | + } |
|
| 67 | 67 | |
| 68 | - /** |
|
| 69 | - * Reverse the migrations. |
|
| 70 | - * |
|
| 71 | - * @return void |
|
| 72 | - */ |
|
| 73 | - public function down() |
|
| 74 | - { |
|
| 75 | - Schema::dropIfExists('datastore'); |
|
| 76 | - } |
|
| 68 | + /** |
|
| 69 | + * Reverse the migrations. |
|
| 70 | + * |
|
| 71 | + * @return void |
|
| 72 | + */ |
|
| 73 | + public function down() |
|
| 74 | + { |
|
| 75 | + Schema::dropIfExists('datastore'); |
|
| 76 | + } |
|
| 77 | 77 | } |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | public function up() |
| 19 | 19 | { |
| 20 | - Schema::create('datastore', function (Blueprint $table) { |
|
| 20 | + Schema::create('datastore', function(Blueprint $table) { |
|
| 21 | 21 | $table->bigIncrements('id'); |
| 22 | 22 | $table->string('type', 255)->nullable(); |
| 23 | 23 | $table->string('namespace', 255)->nullable(); |
@@ -10,34 +10,34 @@ |
||
| 10 | 10 | */ |
| 11 | 11 | class CreateDatastoreCommentsTable extends Migration |
| 12 | 12 | { |
| 13 | - /** |
|
| 14 | - * Run the migrations. |
|
| 15 | - * |
|
| 16 | - * @return void |
|
| 17 | - */ |
|
| 18 | - public function up() |
|
| 19 | - { |
|
| 20 | - Schema::create('datastore_comments', function (Blueprint $table) { |
|
| 21 | - $table->bigIncrements('id'); |
|
| 13 | + /** |
|
| 14 | + * Run the migrations. |
|
| 15 | + * |
|
| 16 | + * @return void |
|
| 17 | + */ |
|
| 18 | + public function up() |
|
| 19 | + { |
|
| 20 | + Schema::create('datastore_comments', function (Blueprint $table) { |
|
| 21 | + $table->bigIncrements('id'); |
|
| 22 | 22 | $table->bigInteger('user_id')->unsigned(); |
| 23 | - $table->bigInteger('datastore_id')->unsigned(); |
|
| 24 | - $table->bigInteger('parent_id')->unsigned()->nullable(); |
|
| 25 | - $table->text('body'); |
|
| 26 | - $table->timestamps(); |
|
| 27 | - $table->softDeletes(); |
|
| 28 | - }); |
|
| 23 | + $table->bigInteger('datastore_id')->unsigned(); |
|
| 24 | + $table->bigInteger('parent_id')->unsigned()->nullable(); |
|
| 25 | + $table->text('body'); |
|
| 26 | + $table->timestamps(); |
|
| 27 | + $table->softDeletes(); |
|
| 28 | + }); |
|
| 29 | 29 | |
| 30 | 30 | |
| 31 | 31 | |
| 32 | - } |
|
| 32 | + } |
|
| 33 | 33 | |
| 34 | - /** |
|
| 35 | - * Reverse the migrations. |
|
| 36 | - * |
|
| 37 | - * @return void |
|
| 38 | - */ |
|
| 39 | - public function down() |
|
| 40 | - { |
|
| 41 | - Schema::dropIfExists('datastore_comments'); |
|
| 42 | - } |
|
| 34 | + /** |
|
| 35 | + * Reverse the migrations. |
|
| 36 | + * |
|
| 37 | + * @return void |
|
| 38 | + */ |
|
| 39 | + public function down() |
|
| 40 | + { |
|
| 41 | + Schema::dropIfExists('datastore_comments'); |
|
| 42 | + } |
|
| 43 | 43 | } |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | public function up() |
| 19 | 19 | { |
| 20 | - Schema::create('datastore_comments', function (Blueprint $table) { |
|
| 20 | + Schema::create('datastore_comments', function(Blueprint $table) { |
|
| 21 | 21 | $table->bigIncrements('id'); |
| 22 | 22 | $table->bigInteger('user_id')->unsigned(); |
| 23 | 23 | $table->bigInteger('datastore_id')->unsigned(); |
@@ -10,37 +10,37 @@ |
||
| 10 | 10 | */ |
| 11 | 11 | class CreateDatastorePagesTable extends Migration |
| 12 | 12 | { |
| 13 | - /** |
|
| 14 | - * Run the migrations. |
|
| 15 | - * |
|
| 16 | - * @return void |
|
| 17 | - */ |
|
| 18 | - public function up() |
|
| 19 | - { |
|
| 20 | - Schema::create('datastore_pages', function (Blueprint $table) { |
|
| 21 | - $table->bigIncrements('id'); |
|
| 22 | - $table->string('title', 255)->nullable(); |
|
| 23 | - $table->string('slug', 255)->nullable(); |
|
| 24 | - $table->unsignedBigInteger('asset')->nullable()->default(0); |
|
| 25 | - |
|
| 26 | - |
|
| 27 | - |
|
| 28 | - $table->foreign('asset', 'datastore_asset_foreign_key')->references('id')->on('datastore')->onDelete('RESTRICT |
|
| 13 | + /** |
|
| 14 | + * Run the migrations. |
|
| 15 | + * |
|
| 16 | + * @return void |
|
| 17 | + */ |
|
| 18 | + public function up() |
|
| 19 | + { |
|
| 20 | + Schema::create('datastore_pages', function (Blueprint $table) { |
|
| 21 | + $table->bigIncrements('id'); |
|
| 22 | + $table->string('title', 255)->nullable(); |
|
| 23 | + $table->string('slug', 255)->nullable(); |
|
| 24 | + $table->unsignedBigInteger('asset')->nullable()->default(0); |
|
| 25 | + |
|
| 26 | + |
|
| 27 | + |
|
| 28 | + $table->foreign('asset', 'datastore_asset_foreign_key')->references('id')->on('datastore')->onDelete('RESTRICT |
|
| 29 | 29 | ')->onUpdate('RESTRICT'); |
| 30 | 30 | |
| 31 | - }); |
|
| 31 | + }); |
|
| 32 | 32 | |
| 33 | 33 | |
| 34 | 34 | |
| 35 | - } |
|
| 35 | + } |
|
| 36 | 36 | |
| 37 | - /** |
|
| 38 | - * Reverse the migrations. |
|
| 39 | - * |
|
| 40 | - * @return void |
|
| 41 | - */ |
|
| 42 | - public function down() |
|
| 43 | - { |
|
| 44 | - Schema::dropIfExists('datastore_pages'); |
|
| 45 | - } |
|
| 37 | + /** |
|
| 38 | + * Reverse the migrations. |
|
| 39 | + * |
|
| 40 | + * @return void |
|
| 41 | + */ |
|
| 42 | + public function down() |
|
| 43 | + { |
|
| 44 | + Schema::dropIfExists('datastore_pages'); |
|
| 45 | + } |
|
| 46 | 46 | } |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | public function up() |
| 19 | 19 | { |
| 20 | - Schema::create('datastore_pages', function (Blueprint $table) { |
|
| 20 | + Schema::create('datastore_pages', function(Blueprint $table) { |
|
| 21 | 21 | $table->bigIncrements('id'); |
| 22 | 22 | $table->string('title', 255)->nullable(); |
| 23 | 23 | $table->string('slug', 255)->nullable(); |
@@ -10,12 +10,12 @@ |
||
| 10 | 10 | */ |
| 11 | 11 | class DatastoreDatastoreRepository extends BaseRepository |
| 12 | 12 | { |
| 13 | - /** |
|
| 14 | - * @return string |
|
| 15 | - */ |
|
| 16 | - public function model() |
|
| 17 | - { |
|
| 18 | - return DatastoreDatastore::class; |
|
| 13 | + /** |
|
| 14 | + * @return string |
|
| 15 | + */ |
|
| 16 | + public function model() |
|
| 17 | + { |
|
| 18 | + return DatastoreDatastore::class; |
|
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | public function paginateAccepted($datastore_id, $status = NULL, $limit = 25, $pageName = 'page', $page = null){ |
@@ -18,12 +18,12 @@ |
||
| 18 | 18 | return DatastoreDatastore::class; |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | - public function paginateAccepted($datastore_id, $status = NULL, $limit = 25, $pageName = 'page', $page = null){ |
|
| 21 | + public function paginateAccepted($datastore_id, $status = NULL, $limit = 25, $pageName = 'page', $page = null) { |
|
| 22 | 22 | $this->where('datastore2_id', $datastore_id)->with('datastore'); |
| 23 | 23 | |
| 24 | 24 | $this->whereHas('datastore', function($query) use ($status) { |
| 25 | - if($status){ |
|
| 26 | - if(!is_array($status)){ |
|
| 25 | + if ($status) { |
|
| 26 | + if (!is_array($status)) { |
|
| 27 | 27 | $status = [$status]; |
| 28 | 28 | } |
| 29 | 29 | $query->whereIn('status', $status); |
@@ -14,12 +14,12 @@ discard block |
||
| 14 | 14 | */ |
| 15 | 15 | class DatastoreRepository extends BaseRepository |
| 16 | 16 | { |
| 17 | - /** |
|
| 18 | - * @return string |
|
| 19 | - */ |
|
| 20 | - public function model() |
|
| 21 | - { |
|
| 22 | - return DatastoreModel::class; |
|
| 17 | + /** |
|
| 18 | + * @return string |
|
| 19 | + */ |
|
| 20 | + public function model() |
|
| 21 | + { |
|
| 22 | + return DatastoreModel::class; |
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | public function paginateAssets($assetData, $limit = 25, $pageName = 'page', $page = null){ |
@@ -29,23 +29,23 @@ discard block |
||
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | |
| 32 | - /** |
|
| 33 | - * @param int $limit |
|
| 34 | - * @param array $columns |
|
| 35 | - * @param string $pageName |
|
| 36 | - * @param null $page |
|
| 37 | - * |
|
| 38 | - * @return \Illuminate\Contracts\Pagination\LengthAwarePaginator |
|
| 39 | - */ |
|
| 40 | - public function paginate($limit = 25, array $columns = ['*'], $pageName = 'page', $page = null) |
|
| 41 | - { |
|
| 42 | - $this->newQuery()->eagerLoad()->setClauses()->setScopes(); |
|
| 32 | + /** |
|
| 33 | + * @param int $limit |
|
| 34 | + * @param array $columns |
|
| 35 | + * @param string $pageName |
|
| 36 | + * @param null $page |
|
| 37 | + * |
|
| 38 | + * @return \Illuminate\Contracts\Pagination\LengthAwarePaginator |
|
| 39 | + */ |
|
| 40 | + public function paginate($limit = 25, array $columns = ['*'], $pageName = 'page', $page = null) |
|
| 41 | + { |
|
| 42 | + $this->newQuery()->eagerLoad()->setClauses()->setScopes(); |
|
| 43 | 43 | |
| 44 | - $models = $this->query->paginate($limit, $columns, $pageName, $page); |
|
| 44 | + $models = $this->query->paginate($limit, $columns, $pageName, $page); |
|
| 45 | 45 | |
| 46 | - $this->unsetClauses(); |
|
| 46 | + $this->unsetClauses(); |
|
| 47 | 47 | |
| 48 | - return $models; |
|
| 48 | + return $models; |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | return DatastoreModel::class; |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | - public function paginateAssets($assetData, $limit = 25, $pageName = 'page', $page = null){ |
|
| 25 | + public function paginateAssets($assetData, $limit = 25, $pageName = 'page', $page = null) { |
|
| 26 | 26 | $this->where('type', $assetData['class']); |
| 27 | 27 | return $this->paginate($limit, ['*'], $pageName, $page); |
| 28 | 28 | |
@@ -49,14 +49,14 @@ discard block |
||
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | |
| 52 | - public function paginateAccepted($datastore_id, $status = NULL, $limit = 25, $pageName = 'page', $page = null){ |
|
| 52 | + public function paginateAccepted($datastore_id, $status = NULL, $limit = 25, $pageName = 'page', $page = null) { |
|
| 53 | 53 | $ds2 = new DatastoreDatastoreRepository(); |
| 54 | 54 | return $ds2->paginateAccepted($datastore_id, $status, $limit, $pageName, $page); |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | - public function paginateSearchProp($property, $property_value, $parent_type, $parent_status = NULL, $limit = 25, $pageName = 'page', $page = null){ |
|
| 57 | + public function paginateSearchProp($property, $property_value, $parent_type, $parent_status = NULL, $limit = 25, $pageName = 'page', $page = null) { |
|
| 58 | 58 | |
| 59 | - if($parent_status){ |
|
| 59 | + if ($parent_status) { |
|
| 60 | 60 | $this->where('status', $published_status); |
| 61 | 61 | } |
| 62 | 62 | |
@@ -10,11 +10,11 @@ |
||
| 10 | 10 | */ |
| 11 | 11 | class DatastorePagesRepository extends BaseRepository |
| 12 | 12 | { |
| 13 | - /** |
|
| 14 | - * @return string |
|
| 15 | - */ |
|
| 16 | - public function model() |
|
| 17 | - { |
|
| 18 | - return DatastorePages::class; |
|
| 19 | - } |
|
| 13 | + /** |
|
| 14 | + * @return string |
|
| 15 | + */ |
|
| 16 | + public function model() |
|
| 17 | + { |
|
| 18 | + return DatastorePages::class; |
|
| 19 | + } |
|
| 20 | 20 | } |
@@ -5,48 +5,48 @@ |
||
| 5 | 5 | |
| 6 | 6 | class ItemAsset extends Asset { |
| 7 | 7 | |
| 8 | - public $name = 'Article'; |
|
| 9 | - public $shortname = 'article'; |
|
| 10 | - public $value_equals = 'title'; |
|
| 11 | - public $status_equals = 'published'; |
|
| 8 | + public $name = 'Article'; |
|
| 9 | + public $shortname = 'article'; |
|
| 10 | + public $value_equals = 'title'; |
|
| 11 | + public $status_equals = 'published'; |
|
| 12 | 12 | |
| 13 | 13 | |
| 14 | - public $properties = array( |
|
| 15 | - 'title' => array( |
|
| 16 | - 'name' => 'Heading', |
|
| 17 | - 'type' => self::STRING, |
|
| 14 | + public $properties = array( |
|
| 15 | + 'title' => array( |
|
| 16 | + 'name' => 'Heading', |
|
| 17 | + 'type' => self::STRING, |
|
| 18 | 18 | 'required' => true |
| 19 | - ), |
|
| 20 | - 'intro' => array( |
|
| 21 | - 'name' => 'Intro', |
|
| 22 | - 'type' => self::TEXT |
|
| 23 | - ), |
|
| 24 | - 'content' => array( |
|
| 25 | - 'name' => 'Full Body', |
|
| 26 | - 'type' => self::HTML |
|
| 19 | + ), |
|
| 20 | + 'intro' => array( |
|
| 21 | + 'name' => 'Intro', |
|
| 22 | + 'type' => self::TEXT |
|
| 23 | + ), |
|
| 24 | + 'content' => array( |
|
| 25 | + 'name' => 'Full Body', |
|
| 26 | + 'type' => self::HTML |
|
| 27 | 27 | ), |
| 28 | 28 | 'author' => array( |
| 29 | 29 | 'name' => 'Author', |
| 30 | 30 | 'type' => self::IDENTITY |
| 31 | 31 | ), |
| 32 | - 'published' => array( |
|
| 33 | - 'name' => 'Published', |
|
| 34 | - 'type' => self::DROPDOWN, |
|
| 32 | + 'published' => array( |
|
| 33 | + 'name' => 'Published', |
|
| 34 | + 'type' => self::DROPDOWN, |
|
| 35 | 35 | 'options' => ['draft' => 'Draft', 'published' => 'Published', 'aarchive' => 'Archived'], |
| 36 | 36 | 'published' => ['published'] |
| 37 | - ), |
|
| 37 | + ), |
|
| 38 | 38 | |
| 39 | - ); |
|
| 39 | + ); |
|
| 40 | 40 | |
| 41 | - public static function about() { |
|
| 42 | - return 'An Article Asset which only holds a particular page\'s content. Can be assigned to one or more Article Categories'; |
|
| 43 | - } |
|
| 41 | + public static function about() { |
|
| 42 | + return 'An Article Asset which only holds a particular page\'s content. Can be assigned to one or more Article Categories'; |
|
| 43 | + } |
|
| 44 | 44 | |
| 45 | 45 | |
| 46 | 46 | |
| 47 | 47 | /** |
| 48 | - * generate the route for this asset |
|
| 49 | - */ |
|
| 48 | + * generate the route for this asset |
|
| 49 | + */ |
|
| 50 | 50 | public static function route($record, $path = null){ |
| 51 | 51 | $page = $record->page; |
| 52 | 52 | |
@@ -47,7 +47,7 @@ |
||
| 47 | 47 | /** |
| 48 | 48 | * generate the route for this asset |
| 49 | 49 | */ |
| 50 | - public static function route($record, $path = null){ |
|
| 50 | + public static function route($record, $path = null) { |
|
| 51 | 51 | $page = $record->page; |
| 52 | 52 | |
| 53 | 53 | return $path ? route('frontend.ams.articles.article', ['slug' => $page->slug, 'path' => $path]) : route('frontend.ams.article.article', ['slug' => $page->slug]); |