jurager / teams Goto Github PK
View Code? Open in Web Editor NEWLaravel package for managing teams and user permissions.
License: MIT License
Laravel package for managing teams and user permissions.
License: MIT License
The method called in the CreateTeam
action is not defined anywhere.
teams/stubs/app/Actions/Teams/CreateTeam.php
Lines 32 to 34 in 48289ef
This is an amazing piece of work. I have a prebuilt application with standard Laravel admin, owner and user permissions, can I install this without an major overhaul?
I would like to know how I use the invite methods, for me the documentation is a little confusing in this part. How do I invite by email?
After I installed the package using the documentation, I get the following error when running php artisan serve
:
Exception
Error, configured model App\Models\User not exists
at vendor/jurager/teams/src/TeamsServiceProvider.php:90
86▕ throw new Exception('Error, missing '.$model.' model configuration');
87▕ }
88▕
89▕ if (! class_exists(config('teams.models.'.$model))) {
➜ 90▕ throw new Exception('Error, configured model '.config('teams.models.'.$model).' not exists');
91▕ }
92▕
93▕ Teams::setModel($model, config('teams.models.'.$model));
94▕ }
+8 vendor frames
9 [internal]:0
Illuminate\Foundation\Application::Illuminate\Foundation\{closure}()
+5 vendor frames
15 artisan:35
Illuminate\Foundation\Console\Kernel::handle()
My User Model looks the following:
<?php
namespace App\Models;
namespace App\Providers;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Laravel\Sanctum\HasApiTokens;
use Jurager\Teams\Traits\HasTeams;
class User extends Authenticatable
{
use HasTeams, HasApiTokens, HasFactory, Notifiable;
...
What am I missing?
On the very first step when running composer required i get a class error
$ composer require jurager/teams
./composer.json has been updated
Running composer update jurager/teams
Loading composer repositories with package information
Updating dependencies
Lock file operations: 1 install, 0 updates, 0 removals
In ClassLoader.php line 305:
A non-empty PSR-4 prefix must end with a namespace separator.
can you confirm if this is something I have to fix first my end?
This package looks promising and has everything, in simple words the most complete package but things aren't working either the read me isn't updated or maybe I have missed something.
Teams::defaultApiTokenPermissions(['read']);
Teams::role('admin', 'Administrator', [
'server:create',
'server:read',
'server:update',
'server:delete',
])->description('Administrator users can perform any action.');
Teams::role('support', 'Support Specialist', [
'server:read',
])->description('Support specialists can read server information.');
In TeamsServiceProvider
, not able to define role,
Ability::firstOrCreate([ 'name' => 'edit', 'title' => 'Edit' ]);
Doesn't work either the team_id is missing. How can one define global roles and abilities for teams?
If you could setup a demo app I can help you write documentation? plus demo app will be helpful understanding the lifecycle and flow of package?
Hi
The documentation on how to use the actions could be better :)
I'm trying to create at new team:
$action = new CreateTeam();
$action->create(auth()->user(), $request->all());
But it fails with this error:
Call to undefined method Jurager\Teams\Teams::newTeamModel()
Hi
Great library, came here after becoming immensely frustrated with the Spatie experience.
Is it possible to use this library without groups?
We already have groups (of other models) which belong to our teams, so extending this libraries Team is problematic.
Thank you
When issuing the install command the users table migration is overwritten
now, while I do understand that new fields is needed on the user there is a few issues with the 'silent' approach :)
Installing the package in an exiting Laravel app will not work
If the migration has been executed before then publishing and overwriting the migration file does not have any effect
It's not mentioned in the doc, so one does not know that migration is needed.
It would be better to have a add_fields_to_users_table migration or document which new fields are needed
I encountered an issue after installing the latest version. When attempting to retrieve all the users associated with the team, I received the following error message:
Column not found: 1054 Unknown column 'team_user.role'.
The migration specifies 'role_id' as the column name, but in the 'Team.php' model, it appears that you're trying to pivot using the 'role' column:
public function users(): BelongsToMany
{
return $this->belongsToMany(Teams::$userModel, Teams::$membershipModel)
->withPivot('role')
->withTimestamps()
->as('membership');
}
This mismatch between the expected 'role_id' column and the 'role' column used in the model may be causing the issue.
Can we expect to see some elaborate documentation or are we supposed to guess our way forwards?
Nowhere does it say
Can we assume this is abandoned? If so, could you please inform on the readme that this is not intended for install.
Thanks in advance
Hi
The Group model is not published during
php artisan teams:install
Can you please explain the logic behind "group" relationship. I'm trying to make some basic "CRUD" GUI for this package in order to test everything and to understand how everything works, but got stuck with 'Class "App\Models\Group" not found' error because of eager loaded relation in 'Team' class... TBH, I'm a noob when it comes to digging into PHP/Laravel OO code, I'm hoping that you'll be able to give us some more examples/docs soon. Thanks in advance!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.