@@ -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]); |
@@ -22,11 +22,11 @@ |
||
22 | 22 | 'required' => true |
23 | 23 | ), |
24 | 24 | 'status' => array( |
25 | - 'name' => 'Published', |
|
26 | - 'type' => self::DROPDOWN, |
|
25 | + 'name' => 'Published', |
|
26 | + 'type' => self::DROPDOWN, |
|
27 | 27 | 'options' => ['published' => 'Published', 'unpublished' => 'Unpublished'], |
28 | 28 | 'published' => ['published'] |
29 | - ), |
|
29 | + ), |
|
30 | 30 | |
31 | 31 | ); |
32 | 32 |
@@ -40,7 +40,7 @@ |
||
40 | 40 | /** |
41 | 41 | * generate the route for this asset |
42 | 42 | */ |
43 | - public static function route($record, $path = null){ |
|
43 | + public static function route($record, $path = null) { |
|
44 | 44 | $page = $record->page; |
45 | 45 | return route('frontend.ams.article.category', ['slug' => $page->slug]); |
46 | 46 | } |
@@ -5,12 +5,12 @@ |
||
5 | 5 | |
6 | 6 | class AutoCallBackAsset extends Asset { |
7 | 7 | |
8 | - public $type = AutoCallBackAsset::class; |
|
9 | - public $namespace = 'property'; |
|
8 | + public $type = AutoCallBackAsset::class; |
|
9 | + public $namespace = 'property'; |
|
10 | 10 | |
11 | - public static function html($data) { |
|
11 | + public static function html($data) { |
|
12 | 12 | $content = explode('|', $data['meta']); |
13 | - return '<span>' . $content[1] . '</span>'; |
|
13 | + return '<span>' . $content[1] . '</span>'; |
|
14 | 14 | } |
15 | 15 | |
16 | 16 |
@@ -5,11 +5,11 @@ |
||
5 | 5 | |
6 | 6 | class SubHeadingAsset extends Asset { |
7 | 7 | |
8 | - public $shortname = 'SubHeading'; |
|
9 | - public $type = SubHeadingAsset::class; |
|
10 | - public $namespace = 'property'; |
|
8 | + public $shortname = 'SubHeading'; |
|
9 | + public $type = SubHeadingAsset::class; |
|
10 | + public $namespace = 'property'; |
|
11 | 11 | |
12 | - public static function html($data) { |
|
13 | - return '<h4>' . $data['value'] . '</h4>'; |
|
14 | - } |
|
12 | + public static function html($data) { |
|
13 | + return '<h4>' . $data['value'] . '</h4>'; |
|
14 | + } |
|
15 | 15 | } |
16 | 16 | \ No newline at end of file |
@@ -6,12 +6,12 @@ |
||
6 | 6 | |
7 | 7 | class FileAsset extends Asset { |
8 | 8 | |
9 | - public $type = FileAsset::class; |
|
10 | - public $namespace = 'property'; |
|
9 | + public $type = FileAsset::class; |
|
10 | + public $namespace = 'property'; |
|
11 | 11 | |
12 | - public static function html($data) { |
|
13 | - return Storage::url($data['value']); |
|
14 | - } |
|
12 | + public static function html($data) { |
|
13 | + return Storage::url($data['value']); |
|
14 | + } |
|
15 | 15 | |
16 | 16 | |
17 | 17 | } |