diff --git a/app/Http/Controllers/CategoryController.php b/app/Http/Controllers/CategoryController.php index f62e8d5..4b64afc 100644 --- a/app/Http/Controllers/CategoryController.php +++ b/app/Http/Controllers/CategoryController.php @@ -8,18 +8,29 @@ use Illuminate\Support\Facades\Log; class CategoryController extends Controller { public function getCategories() { // /api/rpc/category/getcategories - return DB::table('str_category')->select('*')->get(); + return DB::table('str_category') + ->select('*') + ->get(); } public function getCategory($id) { // /api/rpc/category/getcategory/1 - return DB::table('str_category')->select('*')->where('id', $id)->get(); + return DB::table('str_category') + ->select('*') + ->where('id', $id) + ->get(); } public function getCategoryParent($id) { // /api/rpc/category/getcategoryparent/1 - return DB::table('str_category')->select('parent_id')->where('id', $id)->get(); + return DB::table('str_category') + ->select('parent_id') + ->where('id', $id) + ->get(); } public function getCategoryMinScreenshots($id) { // /api/rpc/category/getcategoryminscrot/1 - return DB::table('str_category')->select('min_screenshots')->where('id', $id)->get(); + return DB::table('str_category') + ->select('min_screenshots') + ->where('id', $id) + ->get(); } } diff --git a/app/Http/Controllers/FileController.php b/app/Http/Controllers/FileController.php index 7709256..7cc1e2f 100644 --- a/app/Http/Controllers/FileController.php +++ b/app/Http/Controllers/FileController.php @@ -8,19 +8,30 @@ use Illuminate\Support\Facades\Log; class FileController extends Controller { public function getAllFiles() { // /api/rpc/file/getallfiles - return DB::table('str_file')->select('*')->get(); + return DB::table('str_file') + ->select('*') + ->get(); } public function getAllApprovedFiles() { // /api/rpc/file/getallapprovedfiles - return DB::table('str_file')->select('*')->where('isApproved', 1)->get(); + return DB::table('str_file') + ->select('*') + ->where('isApproved', 1) + ->get(); } public function getAllBrokenFiles() { // /api/rpc/file/getallbrokenfiles - return DB::table('str_file')->select('*')->where('isBroken', 1)->get(); + return DB::table('str_file') + ->select('*') + ->where('isBroken', 1) + ->get(); } public function getAllPendingFiles() { // /api/rpc/file/getallpendingfiles - return DB::table('str_file')->select('*')->where('isApproved', 0)->get(); + return DB::table('str_file') + ->select('*') + ->where('isApproved', 0) + ->get(); } public function getNewFiles() { // /api/rpc/file/getnewfiles @@ -42,10 +53,16 @@ class FileController extends Controller { } public function getFile($id) { // /api/rpc/file/getfile/id - return DB::table('str_file')->select('*')->where('id', $id)->get(); + return DB::table('str_file') + ->select('*') + ->where('id', $id) + ->get(); } public function getFilesInCategory($cat_id) { // /api/rpc/file/getfilesincategory/cat_id - return DB::table('str_file')->select('*')->where('cat_id', $cat_id)->get(); + return DB::table('str_file') + ->select('*') + ->where('cat_id', $cat_id) + ->get(); } } diff --git a/app/Http/Controllers/OwnerController.php b/app/Http/Controllers/OwnerController.php index b2d8e3c..148ec64 100644 --- a/app/Http/Controllers/OwnerController.php +++ b/app/Http/Controllers/OwnerController.php @@ -16,14 +16,23 @@ class OwnerController extends Controller { } public function getOwner($id) { // /api/rpc/owner/getowner/id - return DB::table('str_owners')->select('*')->where('id', $id)->get(); + return DB::table('str_owners') + ->select('*') + ->where('id', $id) + ->get(); } public function getOwnerFile($file_id) { // /api/rpc/owner/getownerfile/id - return DB::table('str_owners')->select('*')->where('file_id', $file_id)->get(); + return DB::table('str_owners') + ->select('*') + ->where('file_id', $file_id) + ->get(); } public function getOwnerUser($user_id) { // /api/rpc/owner/getowneruser/id - return DB::table('str_owners')->select('*')->where('user_id', $user_id)->get(); + return DB::table('str_owners') + ->select('*') + ->where('user_id', $user_id) + ->get(); } } diff --git a/app/Http/Controllers/PermissionController.php b/app/Http/Controllers/PermissionController.php index a63fcc9..a99a4bf 100644 --- a/app/Http/Controllers/PermissionController.php +++ b/app/Http/Controllers/PermissionController.php @@ -8,34 +8,55 @@ use Illuminate\Support\Facades\Log; class PermissionController extends Controller { public function getPermissionsFromModule() { // /api/rpc/permission/getpermissionsfrommodule - return DB::table('usr_perm_module')->select('*')->get(); + return DB::table('usr_perm_module') + ->select('*') + ->get(); } public function getPermissionFromModule($id) { // /api/rpc/permission/getpermissionsfrommodule/id - return DB::table('usr_perm_module')->select('*')->where('id', $id)->get(); + return DB::table('usr_perm_module') + ->select('*') + ->where('id', $id) + ->get(); } public function getStorePermissions() { // /api/rpc/permission/getstorepermissions - return DB::table('str_permissions')->select('*')->get(); + return DB::table('str_permissions') + ->select('*') + ->get(); } public function getStorePermissionGroup($id) { // /api/rpc/permission/getstorepermissiongroup/id - return DB::table('str_permissions')->select('*')->where('id', $id)->get(); + return DB::table('str_permissions') + ->select('*') + ->where('id', $id) + ->get(); } public function getStorePermissionUser($id) { // /api/rpc/permission/getstorepermissionuser/id - return DB::table('str_user_permissions')->select('*')->where('id', $id)->get(); + return DB::table('str_user_permissions') + ->select('*') + ->where('id', $id) + ->get(); } public function getUserPermissions() { // /api/rpc/permission/getuserpermissions - return DB::table('usr_permissions')->select('*')->get(); + return DB::table('usr_permissions') + ->select('*') + ->get(); } public function getUserPermissionGroup($id) { // /api/rpc/permission/getuserpermissiongroup/id - return DB::table('usr_permissions')->select('*')->where('id', $id)->get(); + return DB::table('usr_permissions') + ->select('*') + ->where('id', $id) + ->get(); } public function getUserPermissionUser($id) { // /api/rpc/permission/getuserpermissionuser/id - return DB::table('usr_user_permissions')->select('*')->where('id', $id)->get(); + return DB::table('usr_user_permissions') + ->select('*') + ->where('id', $id) + ->get(); } } diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index cc3db26..e79ecb8 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -10,7 +10,9 @@ use Illuminate\Support\Facades\Log; class UserController extends Controller { public function getUsers() { // /api/rpc/user/getusers - return DB::table('for_users')->select('*')->get(); + return DB::table('for_users') + ->select('*') + ->get(); } public function getUser($id) { // /api/rpc/user/getuser/id diff --git a/resources/assets/js/components/HotEntries.vue b/resources/assets/js/components/HotEntries.vue index e329383..500faf3 100644 --- a/resources/assets/js/components/HotEntries.vue +++ b/resources/assets/js/components/HotEntries.vue @@ -1,21 +1,21 @@ @@ -25,18 +25,18 @@ name: 'hot-items', data: function () { return { - items: [] + items: [] } }, created: function () { axios.get('/api/rpc/file/gethotfiles').then(data => { - data.data.forEach(cb => { - this.items.push({ - 'id': cb.id, - 'title': cb.title, - 'downloads': cb.downloads - }); - }); + data.data.forEach(cb => { + this.items.push({ + 'id': cb.id, + 'title': cb.title, + 'downloads': cb.downloads + }); + }); }) } } @@ -44,6 +44,6 @@ \ No newline at end of file diff --git a/resources/assets/js/components/NewEntries.vue b/resources/assets/js/components/NewEntries.vue index e050ee0..297cb3b 100644 --- a/resources/assets/js/components/NewEntries.vue +++ b/resources/assets/js/components/NewEntries.vue @@ -1,21 +1,21 @@ @@ -26,18 +26,18 @@ name: 'new-items', data: function () { return { - items: [] + items: [] } }, created: function () { axios.get('/api/rpc/file/getnewfiles').then(data => { - data.data.forEach(cb => { - this.items.push({ - 'id': cb.id, - 'title': cb.title, - 'submit_date': moment.unix(cb.submit_date).format("YYYY/MM/DD") - }); - }); + data.data.forEach(cb => { + this.items.push({ + 'id': cb.id, + 'title': cb.title, + 'submit_date': moment.unix(cb.submit_date).format("YYYY/MM/DD") + }); + }); }) } } @@ -45,6 +45,6 @@ \ No newline at end of file diff --git a/resources/views/home.blade.php b/resources/views/home.blade.php index ae309fc..de83ff7 100644 --- a/resources/views/home.blade.php +++ b/resources/views/home.blade.php @@ -8,13 +8,12 @@
@lang('homepage.newitems')
- @if (session('status')) + +
diff --git a/routes/web.php b/routes/web.php index 7133dab..028bb62 100644 --- a/routes/web.php +++ b/routes/web.php @@ -64,17 +64,17 @@ Route::get('/api/rpc/user/getuser/{id}', 'UserController@getUser'); // Localization Route::get('/js/lang.js', function () { $strings = Cache::rememberForever('lang.js', function () { - $lang = config('app.locale'); + $lang = config('app.locale'); - $files = glob(resource_path('lang/' . $lang . '/*.php')); - $strings = []; + $files = glob(resource_path('lang/' . $lang . '/*.php')); + $strings = []; - foreach ($files as $file) { - $name = basename($file, '.php'); - $strings[$name] = require $file; - } + foreach ($files as $file) { + $name = basename($file, '.php'); + $strings[$name] = require $file; + } - return $strings; + return $strings; }); header('Content-Type: text/javascript');