diff --git a/composer.json b/composer.json index 698a0ed..9d3ef0d 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "classiebit/eventmie", - "version": "1.0.9", + "version": "1.0.11", "description": "Run your own Events business with Eventmie Pro. Use it as event ticket selling website or event management platform on your own domain.", "keywords": [ "eventmie-pro", diff --git a/src/Commands/InstallCommand.php b/src/Commands/InstallCommand.php index 4a8b96f..c103b1a 100644 --- a/src/Commands/InstallCommand.php +++ b/src/Commands/InstallCommand.php @@ -76,17 +76,19 @@ public function handle(Filesystem $filesystem) $this->call('migrate', ['--force' => $this->option('force')]); // 3. Extend App\User to Eventmie user model - $this->info('3. Attempting to set Eventmie User model as parent to App\User'); - if (file_exists(app_path('User.php'))) { - $str = file_get_contents(app_path('User.php')); + $this->info('3. Attempting to set Eventmie Pro User model as parent to App\User'); + if (file_exists(app_path('User.php')) || file_exists(app_path('Models/User.php'))) { + $userPath = file_exists(app_path('User.php')) ? app_path('User.php') : app_path('Models/User.php'); + + $str = file_get_contents($userPath); if ($str !== false) { $str = str_replace('extends Authenticatable', "extends \Classiebit\Eventmie\Models\User", $str); - file_put_contents(app_path('User.php'), $str); + file_put_contents($userPath, $str); } } else { - $this->warn('Unable to locate "app/Models/User.php". Did you move this file?'); + $this->warn('Unable to locate "User.php" in app or app/Models. Did you move this file?'); $this->warn('You will need to update this manually. Change "extends Authenticatable" to "extends \Classiebit\Eventmie\Models\User" in your User model'); }