Skip to content

Commit

Permalink
production use
Browse files Browse the repository at this point in the history
  • Loading branch information
anditsung committed Aug 6, 2020
1 parent 94765de commit c89bc05
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 63 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ composer require laravel/nova
php artisan nova:install
```


Install User Management
if install using folder run this first
```
Expand All @@ -22,12 +23,15 @@ composer config repositories.nova-user-management path [PACKAGE_PATH]
```
composer require tsung/nova-user-management
php artisan migrate
php artisan novaweb:install
php artisan novauser:install
php artisan novauser:init
```
Done

====================
jika ingin menambahkan permission pada action resource
maka ganti 'resource' => ActionResource::class,
yang ada di config/nova.php menjadi class \Tsung\NovaUserManagement\Nova\ActionResource::class

>already add function to patch this when execute install command ( 13-05-2020 )
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"php": "^7.2.5",
"laravel/framework": "^7.0",
"laravel/nova": "^3",
"spatie/laravel-permission": "^3"
"spatie/laravel-permission": "^3",
"tsung/nova-web": "^0.0.4"
},
"autoload": {
"psr-4": {
Expand Down
32 changes: 0 additions & 32 deletions config/novauser.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,38 +9,6 @@

],

"gates" => [

"action" => [

"model" => \Laravel\Nova\Actions\ActionEvent::class,
"policy" => \Tsung\NovaUserManagement\Policies\ActionEventPolicy::class,

],

"user" => [

"model" => config('auth.providers.users.model'),
"policy" => \Tsung\NovaUserManagement\Policies\UserPolicy::class,

],

"role" => [

"model" => \Tsung\NovaUserManagement\Models\Role::class,
"policy" => \Tsung\NovaUserManagement\Policies\RolePolicy::class,

],

"permission" => [

"model" => \Tsung\NovaUserManagement\Models\Permission::class,
"policy" => \Tsung\NovaUserManagement\Policies\PermissionPolicy::class,

]

],

'fields' => [
'permission-checkbox' => [
/*
Expand Down
4 changes: 0 additions & 4 deletions src/Commands/Init.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,9 @@ private function defaultPermissions($model)
'view ' . strtolower($model) => $model,
'create ' . strtolower($model) => $model,
'update ' . strtolower($model) => $model,
'updateOwn ' . strtolower($model) => $model,
'delete ' . strtolower($model) => $model,
'deleteOwn ' . strtolower($model) => $model,
'restore ' . strtolower($model) => $model,
'restoreOwn ' . strtolower($model) => $model,
'forceDelete ' . strtolower($model) => $model,
'forceDeleteOwn ' . strtolower($model) => $model,
];

$permissions = array_merge($permissions, isset($additional[strtolower($model)]) ? $additional[strtolower($model)] : []);
Expand Down
13 changes: 0 additions & 13 deletions src/Commands/Install.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ class Install extends Command

public function handle()
{
$this->novaweb();

$this->replaceUserModel();

$this->replaceUserNova();
Expand All @@ -25,17 +23,6 @@ public function handle()
$this->patchingNovaServiceProviderGate();
}

private function novaweb()
{
$this->pInfo("Publishing Novaweb Assets");
$this->call('vendor:publish', ['--tag' => 'novaweb-assets', '--force' => true]);
$this->pInfo("Done Publishing Novaweb Assets");

$this->pInfo("Publishing Novaweb welcome");
$this->call('vendor:publish', ['--tag' => 'novaweb-welcome', '--force' => true]);
$this->pInfo("Done Publishing Novaweb Welcome");
}

private function replaceUserModel()
{
$this->info('Replacing Default User Model');
Expand Down
12 changes: 0 additions & 12 deletions src/ToolServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,6 @@ protected function registerPublishing()
$this->publishes([
__DIR__ . '/../config' => config_path('/'),
], 'novauser-config');

$this->publishes([
__DIR__ . '/../../public' => public_path('/vendor/novaweb'),
], 'novaweb-assets');

$this->publishes([
__DIR__ . '/../../resources/views/novaweb' => resource_path('/views'),
], 'novaweb-welcome');
}

public function registerPolicies()
Expand All @@ -72,10 +64,6 @@ public function registerPolicies()
return true;
}
});

// foreach(config('novauser.gates') as $gate => $value) {
// Gate::policy($value['model'], $value['policy']);
// }
}

protected function registerTools()
Expand Down

0 comments on commit c89bc05

Please sign in to comment.