FIX: lots of bugfixes
This commit is contained in:
@@ -16,7 +16,6 @@ class ModuleManager extends ServiceProvider
|
||||
// this service provider needs published config - config is merged right after this service provider
|
||||
$modules = app(ModuleRepository::class)->getOnlyModules();
|
||||
|
||||
|
||||
// iterate over all modules and enable or disable them
|
||||
foreach ($modules as $module) {
|
||||
if (isset($module->module_settings['providers']) && !empty($module->module_settings['providers'])) {
|
||||
|
||||
@@ -30,7 +30,7 @@ class ChangePassword extends Command
|
||||
$email = $this->argument('email');
|
||||
try {
|
||||
$user = User::where(['email' => $email])
|
||||
->first();
|
||||
->firstOrFail();
|
||||
} catch (ModelNotFoundException $e) {
|
||||
$this->error('Invalid user ' . $email . '.');
|
||||
return;
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\CMS\Enumerations\UserRoles;
|
||||
use App\Events\CreateNewUser;
|
||||
use App\Models\User;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
@@ -63,6 +64,8 @@ class NewUser extends Command
|
||||
$user->role = $role;
|
||||
$user->save();
|
||||
|
||||
event(new CreateNewUser($user));
|
||||
|
||||
$this->info('User ' . $email . ' successfully created.');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ namespace App\Policies;
|
||||
use App\Models\User;
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
abstract class BasicPolicy
|
||||
{
|
||||
@@ -20,7 +21,6 @@ abstract class BasicPolicy
|
||||
*/
|
||||
public function before(User $user, $ability)
|
||||
{
|
||||
|
||||
// check if user can operate on given entity
|
||||
if (!$this->manage($user)) {
|
||||
return false;
|
||||
|
||||
@@ -62,7 +62,6 @@ class AppServiceProvider extends ServiceProvider
|
||||
$this->app->register(DebugBarServiceProvider::class);
|
||||
}
|
||||
|
||||
// register PingPong module extension
|
||||
$this->app->register(LaravelLocalizationServiceProvider::class);
|
||||
|
||||
// create singletons for registering widgets
|
||||
|
||||
Reference in New Issue
Block a user