Skip to content

Commit 9486308

Browse files
committed
Merge branch 'release/2.0.0-beta.4'
2 parents af058f3 + 288badc commit 9486308

File tree

24 files changed

+698
-194
lines changed

24 files changed

+698
-194
lines changed

.env.example

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ APP_KEY=SomeRandomString
44
APP_URL=http://LINK_TO_YOUR_PANEL
55

66
DB_HOST_PANEL=localhost
7-
DB_DATABASE_PANEL=forge
8-
DB_USERNAME_PANEL=forge
7+
DB_DATABASE_PANEL=store
8+
DB_USERNAME_PANEL=root
99
DB_PASSWORD_PANEL=
1010
DB_PREFIX_PANEL=webpanel_
1111

1212
DB_HOST_STORE=localhost
13-
DB_DATABASE_STORE=forge
14-
DB_USERNAME_STORE=forge
13+
DB_DATABASE_STORE=store
14+
DB_USERNAME_STORE=root
1515
DB_PASSWORD_STORE=
1616
DB_PREFIX_STORE=store_
1717

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,6 @@ install:
3030

3131
before_script:
3232
- composer install
33+
- php artisan migrate
3334

3435
script: phpunit

app/Http/Controllers/WebPanel/Store/CategoriesController.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
use App\Models\StoreCategory;
44
use App\Http\Requests;
55
use App\Http\Controllers\Controller;
6+
use yajra\Datatables\Datatables;
67

78
class CategoriesController extends Controller
89
{
@@ -109,4 +110,22 @@ private function SyncServers(StoreCategory $category, $servers = array())
109110
$category->servers()->sync($servers);
110111
}
111112

113+
114+
/**
115+
* Returns the Datatables data
116+
*
117+
* @return mixed
118+
*/
119+
public function getData()
120+
{
121+
$categories = StoreCategory::select(['id','priority','display_name','require_plugin']);
122+
123+
return Datatables::of($categories)
124+
->addColumn('action', function ($category) {
125+
$actions = view('templates.' . \Config::get('webpanel.template') . 'webpanel.store.categories._actions', compact('category'))->render();
126+
return $actions;
127+
})
128+
->make();
129+
}
130+
112131
}

app/Http/Controllers/WebPanel/Store/ItemsController.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
use App\Models\StoreItem;
44
use App\Http\Requests;
55
use App\Http\Controllers\Controller;
6+
use yajra\Datatables\Datatables;
67

78
class ItemsController extends Controller
89
{
@@ -109,4 +110,22 @@ private function SyncServers(StoreItem $item, $servers = array())
109110
$item->servers()->sync($servers);
110111
}
111112

113+
114+
/**
115+
* Returns the Datatables data
116+
*
117+
* @return mixed
118+
*/
119+
public function getData()
120+
{
121+
$items = StoreItem::select(['id','priority','name','type','price']);
122+
123+
return Datatables::of($items)
124+
->addColumn('action', function ($item) {
125+
$actions = view('templates.' . \Config::get('webpanel.template') . 'webpanel.store.items._actions', compact('item'))->render();
126+
return $actions;
127+
})
128+
->make();
129+
}
130+
112131
}

app/Http/Controllers/WebPanel/Store/UsersController.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
use App\Models\StoreUser;
44
use App\Http\Requests;
55
use App\Http\Controllers\Controller;
6+
use yajra\Datatables\Datatables;
67

78
class UsersController extends Controller
89
{
@@ -92,4 +93,22 @@ public function destroy(StoreUser $store_user)
9293
return redirect()->route('webpanel.store.users.index');
9394
}
9495

96+
97+
/**
98+
* Returns the Datatables data
99+
*
100+
* @return mixed
101+
*/
102+
public function getData()
103+
{
104+
$users = StoreUser::select(['id','auth','name','credits']);
105+
106+
return Datatables::of($users)
107+
->addColumn('action', function ($user) {
108+
$actions = view('templates.' . \Config::get('webpanel.template') . 'webpanel.store.users._actions', compact('user'))->render();
109+
return $actions;
110+
})
111+
->make();
112+
}
113+
95114
}

app/Http/routes.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,15 @@
3434

3535
// Store Routes --> Features Relating to the Store Plugin
3636
Route::group(['prefix' => 'store'], function () {
37+
Route::get('items/data', ['as' => 'webpanel.store.items.data', 'uses' => 'WebPanel\Store\ItemsController@getData']);
3738
Route::resource('items', 'WebPanel\Store\ItemsController');
39+
40+
Route::get('categories/data', ['as' => 'webpanel.store.categories.data', 'uses' => 'WebPanel\Store\CategoriesController@getData']);
3841
Route::resource('categories', 'WebPanel\Store\CategoriesController');
42+
43+
Route::get('users/data', ['as' => 'webpanel.store.users.data', 'uses' => 'WebPanel\Store\UsersController@getData']);
3944
Route::resource('users', 'WebPanel\Store\UsersController', ['wildcards' => ['users' => 'store_user']]);
45+
4046
Route::resource('servers', 'WebPanel\Store\ServersController');
4147

4248
Route::group(['prefix' => 'versions'], function () {

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"php": ">=5.5.9",
99
"laravel/framework": "5.1.*",
1010
"zizaco/entrust": "dev-laravel-5",
11-
"illuminate/html": "^5.0"
11+
"illuminate/html": "^5.0",
12+
"yajra/laravel-datatables-oracle": "~5.0"
1213
},
1314
"require-dev": {
1415
"fzaninotto/faker": "~1.4",
@@ -33,8 +34,7 @@
3334
"scripts": {
3435
"post-install-cmd": [
3536
"php artisan clear-compiled",
36-
"php artisan optimize",
37-
"php artisan migrate"
37+
"php artisan optimize"
3838
],
3939
"post-update-cmd": [
4040
"php artisan clear-compiled",

composer.lock

Lines changed: 65 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/app.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,13 @@
147147
App\Providers\EventServiceProvider::class,
148148
App\Providers\RouteServiceProvider::class,
149149
App\Providers\ViewComposerServiceProvider::class,
150+
yajra\Datatables\DatatablesServiceProvider::class,
150151

151152

152153
/*
153154
* Other Service Providers
154155
*/
155-
'Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider',
156+
Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class,
156157

157158

158159
],
@@ -205,6 +206,7 @@
205206
'Entrust' => 'Zizaco\Entrust\EntrustFacade',
206207
'Form' => 'Illuminate\Html\FormFacade',
207208
'Html' => 'Illuminate\Html\HtmlFacade',
209+
'Datatables' => 'yajra\Datatables\Datatables',
208210
],
209211

210212
];

config/database.php

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -52,28 +52,28 @@
5252
'prefix' => '',
5353
],
5454

55-
'webpanel' => [
56-
'driver' => env('DB_DRIVER_PANEL', 'mysql'),
57-
'host' => env('DB_HOST_PANEL', 'localhost'),
58-
'database' => env('DB_DATABASE_PANEL', 'forge'),
59-
'username' => env('DB_USERNAME_PANEL', 'forge'),
60-
'password' => env('DB_PASSWORD_PANEL', ''),
61-
'charset' => 'utf8',
62-
'collation' => 'utf8_unicode_ci',
63-
'prefix' => env('DB_PREFIX_PANEL', 'webpanel_'),
64-
'strict' => false,
65-
],
66-
'store' => [
55+
'webpanel' => [
56+
'driver' => env('DB_DRIVER_PANEL', 'mysql'),
57+
'host' => env('DB_HOST_PANEL', 'localhost'),
58+
'database' => env('DB_DATABASE_PANEL', 'store'),
59+
'username' => env('DB_USERNAME_PANEL', 'root'),
60+
'password' => env('DB_PASSWORD_PANEL', ''),
61+
'charset' => 'utf8',
62+
'collation' => 'utf8_unicode_ci',
63+
'prefix' => env('DB_PREFIX_PANEL', 'webpanel_'),
64+
'strict' => false,
65+
],
66+
'store' => [
6767
'driver' => env('DB_DRIVER_STORE', 'mysql'),
68-
'host' => env('DB_HOST_STORE', 'localhost'),
69-
'database' => env('DB_DATABASE_STORE', 'forge'),
70-
'username' => env('DB_USERNAME_STORE', 'forge'),
71-
'password' => env('DB_PASSWORD_STORE', ''),
72-
'charset' => 'utf8',
73-
'collation' => 'utf8_unicode_ci',
74-
'prefix' => env('DB_PREFIX_STORE', 'store_'),
75-
'strict' => false,
76-
],
68+
'host' => env('DB_HOST_STORE', 'localhost'),
69+
'database' => env('DB_DATABASE_STORE', 'store'),
70+
'username' => env('DB_USERNAME_STORE', 'root'),
71+
'password' => env('DB_PASSWORD_STORE', ''),
72+
'charset' => 'utf8',
73+
'collation' => 'utf8_unicode_ci',
74+
'prefix' => env('DB_PREFIX_STORE', 'store_'),
75+
'strict' => false,
76+
],
7777

7878
'pgsql' => [
7979
'driver' => 'pgsql',

0 commit comments

Comments
 (0)