diff --git a/app/Activity.php b/app/Activity.php index bbbe5e893..34daa2760 100644 --- a/app/Activity.php +++ b/app/Activity.php @@ -1,6 +1,6 @@ belongsTo('Oxbow\User'); + return $this->belongsTo('BookStack\User'); } /** diff --git a/app/Book.php b/app/Book.php index c6e5f60a7..66ac883ef 100644 --- a/app/Book.php +++ b/app/Book.php @@ -1,6 +1,6 @@ hasMany('Oxbow\Page'); + return $this->hasMany('BookStack\Page'); } public function chapters() { - return $this->hasMany('Oxbow\Chapter'); + return $this->hasMany('BookStack\Chapter'); } public function children() diff --git a/app/Chapter.php b/app/Chapter.php index 4e011cec9..ce131f314 100644 --- a/app/Chapter.php +++ b/app/Chapter.php @@ -1,4 +1,4 @@ -belongsTo('Oxbow\Book'); + return $this->belongsTo('BookStack\Book'); } public function pages() { - return $this->hasMany('Oxbow\Page')->orderBy('priority', 'ASC'); + return $this->hasMany('BookStack\Page')->orderBy('priority', 'ASC'); } public function getUrl() diff --git a/app/Console/Commands/Inspire.php b/app/Console/Commands/Inspire.php index 1875acd3c..4b115cfb9 100644 --- a/app/Console/Commands/Inspire.php +++ b/app/Console/Commands/Inspire.php @@ -1,6 +1,6 @@ belongsTo('Oxbow\User'); + return $this->belongsTo('BookStack\User'); } } diff --git a/app/Entity.php b/app/Entity.php index d2c5bd5c1..7aee4d3b0 100644 --- a/app/Entity.php +++ b/app/Entity.php @@ -1,6 +1,6 @@ belongsTo('Oxbow\User', 'created_by'); + return $this->belongsTo('BookStack\User', 'created_by'); } /** @@ -21,7 +21,7 @@ abstract class Entity extends Model */ public function updatedBy() { - return $this->belongsTo('Oxbow\User', 'updated_by'); + return $this->belongsTo('BookStack\User', 'updated_by'); } /** @@ -41,7 +41,7 @@ abstract class Entity extends Model */ public function activity() { - return $this->morphMany('Oxbow\Activity', 'entity')->orderBy('created_at', 'desc'); + return $this->morphMany('BookStack\Activity', 'entity')->orderBy('created_at', 'desc'); } /** diff --git a/app/Events/Event.php b/app/Events/Event.php index ac6cba07c..dfe173828 100644 --- a/app/Events/Event.php +++ b/app/Events/Event.php @@ -1,6 +1,6 @@ \Oxbow\Http\Middleware\Authenticate::class, + 'auth' => \BookStack\Http\Middleware\Authenticate::class, 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, - 'guest' => \Oxbow\Http\Middleware\RedirectIfAuthenticated::class, - 'perm' => \Oxbow\Http\Middleware\PermissionMiddleware::class + 'guest' => \BookStack\Http\Middleware\RedirectIfAuthenticated::class, + 'perm' => \BookStack\Http\Middleware\PermissionMiddleware::class ]; } diff --git a/app/Http/Middleware/Authenticate.php b/app/Http/Middleware/Authenticate.php index f3c6f5925..ebd830ffe 100644 --- a/app/Http/Middleware/Authenticate.php +++ b/app/Http/Middleware/Authenticate.php @@ -1,10 +1,10 @@ belongsTo('Oxbow\Book'); + return $this->belongsTo('BookStack\Book'); } public function chapter() { - return $this->belongsTo('Oxbow\Chapter'); + return $this->belongsTo('BookStack\Chapter'); } public function hasChapter() @@ -35,7 +35,7 @@ class Page extends Entity public function revisions() { - return $this->hasMany('Oxbow\PageRevision')->orderBy('created_at', 'desc'); + return $this->hasMany('BookStack\PageRevision')->orderBy('created_at', 'desc'); } public function getUrl() diff --git a/app/PageRevision.php b/app/PageRevision.php index baabe0f12..52c37e390 100644 --- a/app/PageRevision.php +++ b/app/PageRevision.php @@ -1,6 +1,6 @@ belongsTo('Oxbow\User', 'created_by'); + return $this->belongsTo('BookStack\User', 'created_by'); } public function page() { - return $this->belongsTo('Oxbow\Page'); + return $this->belongsTo('BookStack\Page'); } public function getUrl() diff --git a/app/Permission.php b/app/Permission.php index 44776901f..6859ed56e 100644 --- a/app/Permission.php +++ b/app/Permission.php @@ -1,6 +1,6 @@ belongsToMany('Oxbow\Permissions'); + return $this->belongsToMany('BookStack\Permissions'); } } diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 5be29756d..8bcbcbdad 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -1,10 +1,10 @@ app->bind('activity', function() { - return new ActivityService($this->app->make('Oxbow\Activity')); + return new ActivityService($this->app->make('BookStack\Activity')); }); $this->app->bind('setting', function() { return new SettingService( - $this->app->make('Oxbow\Setting'), + $this->app->make('BookStack\Setting'), $this->app->make('Illuminate\Contracts\Cache\Repository') ); }); diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php index 1d97e7e25..f754b87a9 100644 --- a/app/Providers/EventServiceProvider.php +++ b/app/Providers/EventServiceProvider.php @@ -1,6 +1,6 @@ [ - 'Oxbow\Listeners\EventListener', + 'BookStack\Events\SomeEvent' => [ + 'BookStack\Listeners\EventListener', ], ]; diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php index dd166525a..2d9cd3b85 100644 --- a/app/Providers/RouteServiceProvider.php +++ b/app/Providers/RouteServiceProvider.php @@ -1,6 +1,6 @@ belongsToMany('Oxbow\User'); + return $this->belongsToMany('BookStack\User'); } /** @@ -25,7 +25,7 @@ class Role extends Model */ public function permissions() { - return $this->belongsToMany('Oxbow\Permission'); + return $this->belongsToMany('BookStack\Permission'); } /** diff --git a/app/Services/ActivityService.php b/app/Services/ActivityService.php index a515eea1c..5bfee81ab 100644 --- a/app/Services/ActivityService.php +++ b/app/Services/ActivityService.php @@ -1,8 +1,8 @@ -hasMany('Oxbow\Activity')->orderBy('created_at', 'desc') + $activity = $entity->hasMany('BookStack\Activity')->orderBy('created_at', 'desc') ->skip($count * $page)->take($count)->get(); return $this->filterSimilar($activity); diff --git a/app/Services/EmailConfirmationService.php b/app/Services/EmailConfirmationService.php index 31fe1da08..ffe21eec4 100644 --- a/app/Services/EmailConfirmationService.php +++ b/app/Services/EmailConfirmationService.php @@ -1,15 +1,15 @@ -belongsTo('Oxbow\User'); + return $this->belongsTo('BookStack\User'); } } diff --git a/app/User.php b/app/User.php index b2fa5cd1b..c7ce6b11e 100644 --- a/app/User.php +++ b/app/User.php @@ -1,6 +1,6 @@ belongsToMany('Oxbow\Role'); + return $this->belongsToMany('BookStack\Role'); } public function getRoleAttribute() @@ -103,7 +103,7 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon */ public function socialAccounts() { - return $this->hasMany('Oxbow\SocialAccount'); + return $this->hasMany('BookStack\SocialAccount'); } /** diff --git a/bootstrap/app.php b/bootstrap/app.php index 6c6b0bf36..371f93913 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -28,17 +28,17 @@ $app = new Illuminate\Foundation\Application( $app->singleton( Illuminate\Contracts\Http\Kernel::class, - Oxbow\Http\Kernel::class + BookStack\Http\Kernel::class ); $app->singleton( Illuminate\Contracts\Console\Kernel::class, - Oxbow\Console\Kernel::class + BookStack\Console\Kernel::class ); $app->singleton( Illuminate\Contracts\Debug\ExceptionHandler::class, - Oxbow\Exceptions\Handler::class + BookStack\Exceptions\Handler::class ); /* diff --git a/composer.json b/composer.json index ef5379d46..19bf5b08f 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ "database" ], "psr-4": { - "Oxbow\\": "app/" + "BookStack\\": "app/" } }, "autoload-dev": { diff --git a/config/app.php b/config/app.php index 9780558b9..44b3542a6 100644 --- a/config/app.php +++ b/config/app.php @@ -148,10 +148,10 @@ return [ /* * Application Service Providers... */ - Oxbow\Providers\AppServiceProvider::class, - Oxbow\Providers\EventServiceProvider::class, - Oxbow\Providers\RouteServiceProvider::class, - Oxbow\Providers\CustomFacadeProvider::class, + BookStack\Providers\AppServiceProvider::class, + BookStack\Providers\EventServiceProvider::class, + BookStack\Providers\RouteServiceProvider::class, + BookStack\Providers\CustomFacadeProvider::class, ], @@ -212,8 +212,8 @@ return [ * Custom */ - 'Activity' => Oxbow\Services\Facades\Activity::class, - 'Setting' => Oxbow\Services\Facades\Setting::class, + 'Activity' => BookStack\Services\Facades\Activity::class, + 'Setting' => BookStack\Services\Facades\Setting::class, ], diff --git a/config/auth.php b/config/auth.php index f9ee12aba..d4f58587d 100644 --- a/config/auth.php +++ b/config/auth.php @@ -28,7 +28,7 @@ return [ | */ - 'model' => Oxbow\User::class, + 'model' => BookStack\User::class, /* |-------------------------------------------------------------------------- diff --git a/config/services.php b/config/services.php index be9d6eb15..604a8657f 100644 --- a/config/services.php +++ b/config/services.php @@ -30,7 +30,7 @@ return [ ], 'stripe' => [ - 'model' => Oxbow\User::class, + 'model' => BookStack\User::class, 'key' => '', 'secret' => '', ], diff --git a/database/factories/ModelFactory.php b/database/factories/ModelFactory.php index e68c2f293..a47e02b72 100644 --- a/database/factories/ModelFactory.php +++ b/database/factories/ModelFactory.php @@ -11,7 +11,7 @@ | */ -$factory->define(Oxbow\User::class, function ($faker) { +$factory->define(BookStack\User::class, function ($faker) { return [ 'name' => $faker->name, 'email' => $faker->email, @@ -20,21 +20,21 @@ $factory->define(Oxbow\User::class, function ($faker) { ]; }); -$factory->define(Oxbow\Book::class, function ($faker) { +$factory->define(BookStack\Book::class, function ($faker) { return [ 'name' => $faker->sentence, 'description' => $faker->paragraph ]; }); -$factory->define(Oxbow\Chapter::class, function ($faker) { +$factory->define(BookStack\Chapter::class, function ($faker) { return [ 'name' => $faker->sentence, 'description' => $faker->paragraph ]; }); -$factory->define(Oxbow\Page::class, function ($faker) { +$factory->define(BookStack\Page::class, function ($faker) { return [ 'name' => $faker->sentence, 'html' => '

' . implode('

', $faker->paragraphs(5)) . '

' diff --git a/database/migrations/2014_10_12_000000_create_users_table.php b/database/migrations/2014_10_12_000000_create_users_table.php index 68a2940a4..3a374f251 100644 --- a/database/migrations/2014_10_12_000000_create_users_table.php +++ b/database/migrations/2014_10_12_000000_create_users_table.php @@ -21,7 +21,7 @@ class CreateUsersTable extends Migration $table->timestamps(); }); - \Oxbow\User::create([ + \BookStack\User::create([ 'name' => 'Admin', 'email' => 'admin@admin.com', 'password' => \Illuminate\Support\Facades\Hash::make('password') diff --git a/database/migrations/2015_08_29_105422_add_roles_and_permissions.php b/database/migrations/2015_08_29_105422_add_roles_and_permissions.php index 1f7f6126d..7247a0a38 100644 --- a/database/migrations/2015_08_29_105422_add_roles_and_permissions.php +++ b/database/migrations/2015_08_29_105422_add_roles_and_permissions.php @@ -68,19 +68,19 @@ class AddRolesAndPermissions extends Migration // Create default roles - $admin = new \Oxbow\Role(); + $admin = new \BookStack\Role(); $admin->name = 'admin'; $admin->display_name = 'Admin'; $admin->description = 'Administrator of the whole application'; $admin->save(); - $editor = new \Oxbow\Role(); + $editor = new \BookStack\Role(); $editor->name = 'editor'; $editor->display_name = 'Editor'; $editor->description = 'User can edit Books, Chapters & Pages'; $editor->save(); - $viewer = new \Oxbow\Role(); + $viewer = new \BookStack\Role(); $viewer->name = 'viewer'; $viewer->display_name = 'Viewer'; $viewer->description = 'User can view books & their content behind authentication'; @@ -91,7 +91,7 @@ class AddRolesAndPermissions extends Migration $ops = ['Create', 'Update', 'Delete']; foreach ($entities as $entity) { foreach ($ops as $op) { - $newPermission = new \Oxbow\Permission(); + $newPermission = new \BookStack\Permission(); $newPermission->name = strtolower($entity) . '-' . strtolower($op); $newPermission->display_name = $op . ' ' . $entity . 's'; $newPermission->save(); @@ -105,7 +105,7 @@ class AddRolesAndPermissions extends Migration $ops = ['Create', 'Update', 'Delete']; foreach ($entities as $entity) { foreach ($ops as $op) { - $newPermission = new \Oxbow\Permission(); + $newPermission = new \BookStack\Permission(); $newPermission->name = strtolower($entity) . '-' . strtolower($op); $newPermission->display_name = $op . ' ' . $entity; $newPermission->save(); @@ -115,7 +115,7 @@ class AddRolesAndPermissions extends Migration // Set all current users as admins // (At this point only the initially create user should be an admin) - $users = \Oxbow\User::all(); + $users = \BookStack\User::all(); foreach ($users as $user) { $user->attachRole($admin); } diff --git a/phpspec.yml b/phpspec.yml index 2cea9d0e0..58f1d982e 100644 --- a/phpspec.yml +++ b/phpspec.yml @@ -1,5 +1,5 @@ suites: main: - namespace: Oxbow - psr4_prefix: Oxbow + namespace: BookStack + psr4_prefix: BookStack src_path: app \ No newline at end of file diff --git a/resources/views/settings/index.blade.php b/resources/views/settings/index.blade.php index cc6c6a230..5e484be65 100644 --- a/resources/views/settings/index.blade.php +++ b/resources/views/settings/index.blade.php @@ -35,9 +35,9 @@