@@ -1,13 +1,13 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | // PATH aliases |
4 | -define('ROOT_PATH', __DIR__ ); |
|
5 | -define('MIGRATIONS_PATH', __DIR__ . '/app/database/migrations'); |
|
6 | -define('SEEDS_PATH', __DIR__ . '/app/database/seeds'); |
|
7 | -define('MODELS_PATH', __DIR__ . '/app/src/Model'); |
|
8 | -define('SCHEMAS_PATH', __DIR__ . '/app/src/Schema'); |
|
9 | -define('COMMANDS_PATH', __DIR__ . '/app/src/Console/Commands'); |
|
10 | -define('CODE_TEMPLATE_PATH', __DIR__ . '/app/src/Console/CodeTemplates'); |
|
11 | -define('CONFIG_PATH', __DIR__ . '/config'); |
|
12 | -define('APP_PATH', __DIR__ . '/app'); |
|
4 | +define('ROOT_PATH', __DIR__); |
|
5 | +define('MIGRATIONS_PATH', __DIR__.'/app/database/migrations'); |
|
6 | +define('SEEDS_PATH', __DIR__.'/app/database/seeds'); |
|
7 | +define('MODELS_PATH', __DIR__.'/app/src/Model'); |
|
8 | +define('SCHEMAS_PATH', __DIR__.'/app/src/Schema'); |
|
9 | +define('COMMANDS_PATH', __DIR__.'/app/src/Console/Commands'); |
|
10 | +define('CODE_TEMPLATE_PATH', __DIR__.'/app/src/Console/CodeTemplates'); |
|
11 | +define('CONFIG_PATH', __DIR__.'/config'); |
|
12 | +define('APP_PATH', __DIR__.'/app'); |
|
13 | 13 |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | |
55 | 55 | /** |
56 | 56 | * @param $name |
57 | - * @param $table |
|
57 | + * @param string $table |
|
58 | 58 | * @return bool |
59 | 59 | */ |
60 | 60 | private function isRowExist($name, $table) |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | |
66 | 66 | /** |
67 | 67 | * @param $name |
68 | - * @param $table |
|
68 | + * @param string $table |
|
69 | 69 | */ |
70 | 70 | private function insertRow($name, $table) |
71 | 71 | { |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | |
77 | 77 | /** |
78 | 78 | * @param $name |
79 | - * @param $table |
|
79 | + * @param string $table |
|
80 | 80 | */ |
81 | 81 | private function deleteRow($name, $table) |
82 | 82 | { |
@@ -108,12 +108,12 @@ |
||
108 | 108 | public function getAttributes($entity) |
109 | 109 | { |
110 | 110 | return [ |
111 | - 'file' => (string)$entity->file, |
|
112 | - 'file_info' => json_decode($entity->file_info), |
|
113 | - 'created_by' => (integer)$entity->created_by, |
|
114 | - 'updated_by' => (integer)$entity->updated_by, |
|
115 | - 'created_at' => Carbon::parse($entity->created_at)->setTimezone('UTC')->format(Carbon::ISO8601), |
|
116 | - 'updated_at' => Carbon::parse($entity->updated_at)->setTimezone('UTC')->format(Carbon::ISO8601), |
|
111 | + 'file' => (string)$entity->file, |
|
112 | + 'file_info' => json_decode($entity->file_info), |
|
113 | + 'created_by' => (integer)$entity->created_by, |
|
114 | + 'updated_by' => (integer)$entity->updated_by, |
|
115 | + 'created_at' => Carbon::parse($entity->created_at)->setTimezone('UTC')->format(Carbon::ISO8601), |
|
116 | + 'updated_at' => Carbon::parse($entity->updated_at)->setTimezone('UTC')->format(Carbon::ISO8601), |
|
117 | 117 | ]; |
118 | 118 | } |
119 | 119 | } |
@@ -22,12 +22,12 @@ |
||
22 | 22 | protected $table = 'media_files'; |
23 | 23 | |
24 | 24 | protected $fillable = [ |
25 | - 'file', |
|
26 | - 'file_info', |
|
27 | - 'created_by', |
|
28 | - 'updated_by', |
|
29 | - 'created_at', |
|
30 | - 'updated_at', |
|
25 | + 'file', |
|
26 | + 'file_info', |
|
27 | + 'created_by', |
|
28 | + 'updated_by', |
|
29 | + 'created_at', |
|
30 | + 'updated_at', |
|
31 | 31 | ]; |
32 | 32 | |
33 | 33 | private static $allowedMimeTypes = [ |
@@ -9,8 +9,7 @@ |
||
9 | 9 | */ |
10 | 10 | public function up() |
11 | 11 | { |
12 | - Capsule::schema()->create('media_files', function($table) |
|
13 | - { |
|
12 | + Capsule::schema()->create('media_files', function($table) { |
|
14 | 13 | $table->increments('id'); |
15 | 14 | $table->string('file'); |
16 | 15 | $table->string('file_info'); |
@@ -48,9 +48,9 @@ discard block |
||
48 | 48 | */ |
49 | 49 | Acl::GUARD_TYPE_ROUTE => [ |
50 | 50 | // resource, [roles as array], [privileges as array] |
51 | - ['/api/token', ['guest'], [Acl::PRIVILEGE_POST]], |
|
52 | - ['/api/user', ['user'], [Acl::PRIVILEGE_GET]], |
|
53 | - ['/api/upload', ['user'], [Acl::PRIVILEGE_POST]], |
|
51 | + ['/api/token', ['guest'], [Acl::PRIVILEGE_POST]], |
|
52 | + ['/api/user', ['user'], [Acl::PRIVILEGE_GET]], |
|
53 | + ['/api/upload', ['user'], [Acl::PRIVILEGE_POST]], |
|
54 | 54 | ], |
55 | 55 | |
56 | 56 | /** |
@@ -62,17 +62,17 @@ discard block |
||
62 | 62 | */ |
63 | 63 | Acl::GUARD_TYPE_CALLABLE => [ |
64 | 64 | // resource, [roles as array], [privileges as array] |
65 | - ['App\Controller\CrudController', ['user']], |
|
66 | - ['App\Controller\CrudController:actionIndex', ['user']], |
|
67 | - ['App\Controller\CrudController:actionGet', ['user']], |
|
65 | + ['App\Controller\CrudController', ['user']], |
|
66 | + ['App\Controller\CrudController:actionIndex', ['user']], |
|
67 | + ['App\Controller\CrudController:actionGet', ['user']], |
|
68 | 68 | ['App\Controller\CrudController:actionCreate', ['user']], |
69 | 69 | ['App\Controller\CrudController:actionUpdate', ['user']], |
70 | 70 | ['App\Controller\CrudController:actionDelete', ['user']], |
71 | 71 | |
72 | 72 | ['App\Controller\UploadController:actionUpload', ['user']], |
73 | 73 | |
74 | - ['App\Controller\UserController:actionIndex', ['user']], |
|
75 | - ['App\Controller\UserController:actionGet', ['user']], |
|
74 | + ['App\Controller\UserController:actionIndex', ['user']], |
|
75 | + ['App\Controller\UserController:actionGet', ['user']], |
|
76 | 76 | ['App\Controller\UserController:actionCreate', ['admin']], |
77 | 77 | ['App\Controller\UserController:actionUpdate', ['admin']], |
78 | 78 | ['App\Controller\UserController:actionDelete', ['admin']], |