Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Laravel-mongodb #146

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ First, add the `Maklad\Permission\Traits\HasRoles` trait to your `User` model(s)

```php
use Illuminate\Auth\Authenticatable;
use Jenssegers\Mongodb\Eloquent\Model as Model;
use MongoDB\Laravel\Eloquent\Model as Model;
use Illuminate\Foundation\Auth\Access\Authorizable;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract;
Expand All @@ -249,7 +249,7 @@ class User extends Model implements AuthenticatableContract, AuthorizableContrac
> Note: that if you need to use `HasRoles` trait with another model ex.`Page` you will also need to add `protected $guard_name = 'web';` as well to that model or you would get an error

```php
use Jenssegers\Mongodb\Eloquent\Model as Model;
use MongoDB\Laravel\Eloquent\Model as Model;
use Maklad\Permission\Traits\HasRoles;

class Page extends Model
Expand Down
15 changes: 10 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "mostafamaklad/laravel-permission-mongodb",
"name": "webrek/laravel-permission-mongodb",
"description": "Permission handling for Laravel 5.2 and up using mongodb",
"keywords": [
"laravel",
Expand All @@ -10,12 +10,17 @@
"mostafamaklad",
"maklad",
"mostafa",
"spatie",
"jenssegers"
"spatie"
],
"homepage": "https://github.com/mostafamaklad/laravel-permission-mongodb",
"homepage": "https://github.com/webrek/laravel-permission-mongodb",
"license": "MIT",
"authors": [
{
"name": "Arturo Hernandez",
"email": "[email protected]",
"homepage": "https://github.com/webrek",
"role": "Developer"
},
{
"name": "Mostafa Maklad",
"email": "[email protected]",
Expand All @@ -34,7 +39,7 @@
"illuminate/auth": "^10.0",
"illuminate/container": "^10.0",
"illuminate/contracts": "^10.0",
"jenssegers/mongodb": "^3.9"
"mongodb/laravel-mongodb": "v4.0.0"
},
"require-dev": {
"monolog/monolog": "^3.2",
Expand Down
3 changes: 2 additions & 1 deletion database/migrations/create_permission_collections.php.stub
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\Schema;
use Jenssegers\Mongodb\Schema\Blueprint;
use MongoDB\Laravel\Schema\Blueprint;


return new class extends Migration
{
Expand Down
2 changes: 1 addition & 1 deletion src/Models/Permission.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Maklad\Permission\Models;

use Illuminate\Support\Collection;
use Jenssegers\Mongodb\Eloquent\Model;
use MongoDB\Laravel\Eloquent\Model;
use Maklad\Permission\Contracts\PermissionInterface;
use Maklad\Permission\Exceptions\PermissionAlreadyExists;
use Maklad\Permission\Exceptions\PermissionDoesNotExist;
Expand Down
2 changes: 1 addition & 1 deletion src/Models/Role.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Maklad\Permission\Models;

use Illuminate\Database\Eloquent\Builder;
use Jenssegers\Mongodb\Eloquent\Model;
use MongoDB\Laravel\Eloquent\Model;
use Maklad\Permission\Contracts\PermissionInterface;
use Maklad\Permission\Contracts\RoleInterface;
use Maklad\Permission\Exceptions\GuardDoesNotMatch;
Expand Down
4 changes: 2 additions & 2 deletions src/Traits/HasPermissions.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
namespace Maklad\Permission\Traits;

use Illuminate\Support\Collection;
use Jenssegers\Mongodb\Eloquent\Builder;
use Jenssegers\Mongodb\Eloquent\Model;
use MongoDB\Laravel\Eloquent\Builder;
use MongoDB\Laravel\Eloquent\Model;
use Maklad\Permission\Contracts\PermissionInterface;
use Maklad\Permission\Contracts\PermissionInterface as Permission;
use Maklad\Permission\Exceptions\GuardDoesNotMatch;
Expand Down
6 changes: 3 additions & 3 deletions src/Traits/HasRoles.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
namespace Maklad\Permission\Traits;

use Illuminate\Support\Collection;
use Jenssegers\Mongodb\Eloquent\Builder;
use Jenssegers\Mongodb\Eloquent\Model;
use Jenssegers\Mongodb\Relations\BelongsToMany;
use MongoDB\Laravel\Eloquent\Builder;
use MongoDB\Laravel\Eloquent\Model;
use MongoDB\Laravel\Relations\BelongsToMany;
use Maklad\Permission\Contracts\RoleInterface as Role;
use Maklad\Permission\Helpers;
use Maklad\Permission\PermissionRegistrar;
Expand Down
3 changes: 2 additions & 1 deletion tests/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Foundation\Auth\Access\Authorizable;
use Jenssegers\Mongodb\Eloquent\Model;
use MongoDB\Laravel\Eloquent\Model;

use Maklad\Permission\Traits\HasRoles;

class Admin extends Model implements AuthorizableContract, AuthenticatableContract
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Illuminate\Foundation\Application;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Jenssegers\Mongodb\MongodbServiceProvider;
use MongoDB\Laravel\MongodbServiceProvider;
use Maklad\Permission\Helpers;
use Maklad\Permission\Models\Permission;
use Maklad\Permission\Models\Role;
Expand Down
2 changes: 1 addition & 1 deletion tests/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Foundation\Auth\Access\Authorizable;
use Jenssegers\Mongodb\Eloquent\Model;
use MongoDB\Laravel\Eloquent\Model;
use Maklad\Permission\Traits\HasRoles;

/**
Expand Down