Skip to content

Commit

Permalink
Laravel 8.x patch
Browse files Browse the repository at this point in the history
  • Loading branch information
classiebit committed Jan 23, 2021
1 parent a09eb45 commit 2e3e653
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
12 changes: 7 additions & 5 deletions src/Commands/InstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

Expand Down

0 comments on commit 2e3e653

Please sign in to comment.