Giter Club home page Giter Club logo

jeremykenedy / laravel-users Goto Github PK

View Code? Open in Web Editor NEW
413.0 26.0 113.0 199 KB

A Users Management Package that includes all necessary routes, views, models, and controllers for a user management dashboard and associated pages for managing Laravels built in user scaffolding. Built for Laravel 5.2, 5.3, 5.4, 5.5, 5.6, 5.7, 5.8, 6.0, 7.0 and 8.0.

License: MIT License

PHP 46.93% Blade 53.07%
laravel-users users users-management manage-users register-users manage-laravel-users laravel-user-management

laravel-users's Issues

Bug: System will not make use of published config

Steps to Reproduce

  1. Follow Installation instructions to install into an existing Laravel Project
  2. Edit the published config to point main template to one that exists in your layouts folder (for this, i simply remove the "laravevelusers::" as I had an app.blade.php)
  3. Npm run dev and clear view cache just in case

Expected Result

Your template to change to my template

Actual Result

Defaults to your own template, although our template is working fine everywhere else.

Add new columns to save on controller

Hello there, is there a way to overwrite or clone the usermanagementcontroller into the root project without modify on vendor folder?

I need add some columns and if i change the controller they doesnt upload on the github repository.

Hope you can help me.

Greetings.

Soft delete on users

Is there a date in mind to implement soft deletes on the user model? I see it's on the road map from the config file.

I'm currently setting the trait on my User model, so that does at least give an interim solution, but it'd be great to have this built into the interface.

Support Laravel 10 and remove abandoned dependency

Can this package get updated to support Laravel 10 and remove the laravecollective/html dependency because it's abandoned?
The replace package is spatie/laravel-html.

Issue:
jeremykenedy/laravel-users v4.3.0 requires laravelcollective/html (^5.4|^5.5|^5.6|^5.7|^5.8|^6.0|^7.0|^8.0)
Package laravelcollective/html is abandoned, you should avoid using it. Use spatie/laravel-html instead.

Customize UsersManagementController.php?

Whats the proper way to customize the User Management Controller without editing it within the vendor directory? Since it has hardcoded user fields, I would think it would almost always need to be customized, but during registration/publishing, it doesnt seem to be copied to the projects directories like the config and resources files are.

Select multiple roles

I use your roles and users package for a lot of laravel website I manage and am missing the multiple roles editor in the users section.
I have some really small changes in your code that enables this to work correctly.
Is it possible to implement this? You only have to change 4 lines of code, see below.

UsersManagementController.php
Line 159 $currentRole = ''; -> $currentRole = [];
Line 165 $currentRole = $user_role; -> $currentRole[] = $user_role->id;

edit-user.blade.php
Line 107 ->
Line 112 <option value="{{ $role->id }}" {{ $currentRole->id == $role->id ? 'selected="selected"' : '' }}>{{ $role->name }} -> <option value="{{ $role->id }}" {{ in_array($role->id ,$currentRole) ? 'selected="selected"' : '' }}>{{ $role->name }}

Logout dropdown not showing

Hello,
can you help me with this problem, in defalut Laravel app.blade.php Logout shows but when i go to /users then laravel-users app.blade.php loads and there from I can't get Logout to show.
Laravel version is latest i gues installer and created project with composer.

If it is stupid question just delete it. Thank you.

Edit: it has something to do with enableAppJs => false, but i don't understand if this is ok to do

Config file

Awesome work with this package and also the roles package.
Am slightly confused re Users....
When running the vendor publish command this does not push config.
Do I need to copy this manually into config directory? Roles seemed to do it automatically.
Just getting use to laravel n will definitely contribute to getting users & roles packages working together via GUI as I've seen a few pull requests already.

How can I use spatie/laravel-permission?

Hello there,

I have read the following statement in your README file.

Laravel users can work out the box with or without the following roles packages:

I don't think it is true. I have installed spatie/laravel-permission package, but it does not seem to be working with your package.

For example, I tried to change user permission, but I got an exception saying that detachAllRoles() does not exist in User class.

Invalid translations - html entities

Hello.
I did clean install of LV 5.6 + this package. Unfortunately all icons are displayed as html entities not as parsed HTML which is default behaviour of blade templates. Could You fix it?

route on show-users.blade.php

should change the route from fixed path to this

<a href="{{ route('users.edit', $user->id) }}" class="btn btn-block btn-md btn-warning">
                                    {!! trans('laravelusers::laravelusers.buttons.edit-user') !!}
                                </a>

Allow adding a custom middleware to all routes

Would it be possible to add a custom middleware to protect the routes?

The solution might be needed to protect the user related routes in case one does not install the roles and permissions module. There is case where it is not needed and admin is determined based on the users table itself. No other roles are really needed.

The perfect scenario would be to just add the a configuration or even two and to trigger it within __constuct() method of the controller. It could be similar to how roles middleware is checked and triggered, just that it would allow one to configure any middleware to be enforced.

There did not seem to be a convenient way to make changes to an already defined routes.

Not installing fully

I have just started a new Laravel project and want to use laravel-users for user management. However on an install (PHP 7.1, Laravel 5.7 and the current version of this code) both I and a colleague, separately, are getting the error "Route [login] not defined." when browsing to /users. Looking at the result of the install it seems that neither providers nor aliases have been updated, and the migrations did not seem to run, despite package discovery locating correctly and no faults displayed in the console. Any ideas would be appreciated, thank you.

RoleDeniedException

How do I redirect someone from the admin if they don't have the role "admin" so that they don't see the ugly error? Is there any setting I could modify?

I'm using laravel roles btw.

2FA supports?

Hi,

Does it support 2FA auth? (google authenticator, ...)

Thank you.

Custom Users Model (not being honored?)

I am using a user model with a custom table named defined:
image

However when doing something like adding a new user, an error is thrown. The error seems to be spitting back the '.users' table which makes me think some kind of default is not being overridden. Is this the case? How can I fix this (while keeping my custom user table)?

Thanks!

I don't know how to install

Hi,

I followed : composer require jeremykenedy/laravel-users via CMD on window then got download "vendor" folder I don't know how to do next.

How to render the blade file in the /resources/views/vendor/laravelusers/usersmanagement folder

Hi, somehow, when I try to render these blade files, it's saying that a variable that's called "rolesEnabled" not defined, and so returning errors. Is there documentation somewhere saying:

  1. What are the necessary fields needed to render these fields
  2. What values and from what sources are we getting those values for those above fields to render the blade file

Thank you very much!!

Attempting to get working with laratrust

Hi,

I'm trying to get this working on fresh laravel 5.6 install with https://github.com/santigarcor/laratrust

I've run:
php artisan make:auth

composer require "santigarcor/laratrust:5.0.*"

php artisan vendor:publish --tag="laratrust"

php artisan laratrust:setup

composer require jeremykenedy/laravel-users

php artisan vendor:publish --tag=laravelusers

Copied Directory [\vendor\jeremykenedy\laravel-users\src\resources\views] To [\resources\views\vendor\laravelusers]
Copied Directory [\vendor\jeremykenedy\laravel-users\src\resources\lang] To [\resources\lang\vendor\laravelusers]
Publishing complete.

This has resulted in files being created e.g. resources\views\vendor\laravelusers\usersmanagement

php artisan migrate


contents of routes/web.php

Route::get('/', function () {
return view('welcome');
});

Auth::routes();

Route::get('/home', 'HomeController@index')->name('home');

If you can point out where I've gone wrong that would be great.

No error messages

Enable datatables

Via config I enable datatables but nothing change, this :
'enabledDatatablesJs' => true,

extending the edit form

As I was extending the form for user editing, I got that due to a missing validation here:

"Method [throwValidationException] does not exist on [jeremykenedy\laravelusers\App\Http\Controllers\UsersManagementController]."

which leads to public function store(Request $request)

is there a nice way of extending your form without messing around with the vendor package?

How to integrate this package in GUI

Hi,

I have installed this package but it showing a different UI or layout. Could you please let me know how to integrate into my existing layout. Thanks!

Preventing XSS

Not sure if I'm missing something obvious here, but how do I prevent XSS?

I've been able to insert a script alert function into the database and I can't see anywhere to add the validator to prevent this.

Line 32 on src/resources/views/usersmanagement/show-user.blade.php

{!! trans('laravelusers::laravelusers.showing-user-title', ['name' => $user->name]) !!}

This should be {{ }} instead of {!! to prevent raw output

Thanks

Filter User Index

I adding a custom field to the users table and would like to be able to filter the filter the results based on the user viewing the list. I dont see anywhere in the code. Is it possible within the index method? Seems pagination is pretty much the only configurable option.

Issue 25 not fixed

Hello. I've recently installl this addon and I'm getting the same bug, so default templates remains activated.

// Use the provided blade templates or extend to your own templates.
    //'showUsersBlade'                => 'laravelusers::usersmanagement.show-users',
    'showUsersBlade'                => 'users.index',

Method [throwValidationException] does not exist

Hello,

I'm using the latest version of this package and Laravel 5.5.32. I'm getting this error when trying to validate creating a new user or editing an existing user.

Method [throwValidationException] does not exist on [jeremykenedy\laravelusers\App\Http\Controllers\UsersManagementController]

This is an excellent and very useful package. It is quite common to need some type of user management. Thanks for the work on this.

Jay

Argument 3 passed to NetoJose\Bootstrap4Forms\FormService::text() must be of the type string or null, array given, RROR) Argument 3 passed to NetoJose\Bootstrap4Forms\FormService::text() must be of the type string or null, array given, vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php

ErrorException (E_ERROR)
Argument 3 passed to NetoJose\Bootstrap4Forms\FormService::text() must be of the type string or null, array given, called in C:\server\www\projects\new\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php on line 223 (View: C:\server\www\projects\new\vendor\jeremykenedy\laravel-users\src\resources\views\usersmanagement\create-user.blade.php)
Previous exceptions
Argument 3 passed to NetoJose\Bootstrap4Forms\FormService::text() must be of the type string or null, array given, called in C:\server\www\projects\new\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php on line 223 (0)

Adding role and permission management

I'm using this package along with laravel-roles and i'd like to be able to manage both users and roles/permissions from this website. Is it already possible or has anyone else integrated it with role/permission management?

appJsPublicFile value suggestion for Laravel 9 \ Vite

This appears to be working with Laravel 9, but do you have any suggestions what that value should for appjsPublicFile and appcssPublicFile since we should be using Laravel Vite instead of Laravel Mix going forward?

My CSS and JS files are bundled here now:

/public/build/assets/app-238453fd.css
/public/build/assets/app-d35ea772.js

    'enableAppCss'                  => true,
    'appCssPublicFile'              => 'css/app.css',

    'enableBootstrapJsCdn'          => true,
    'bootstrapJsCdn'                => 'https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js',

    'enableAppJs'                   => true,
    'appJsPublicFile'               => 'js/app.js',

Also, composer says this dependency laravelcollective/html is abandoned and should avoid using it. They suggest using spatie/laravel-html instead.

Can this be updated too?

Support multiple roles per user in views

It is a common requirement to select multiple roles per user.

This package already supports a many-to-many relationship schema between Users and Roles via the role_user table. However, the Create and Edit pages currently allow for only the selection of one role per user.

Edit URL assumed as base_url

This line on show-user.blade.php

<a href="/users/{{$user->id}}/edit" class="btn btn-block btn-md btn-warning">

Assumes that the Laravel app is not served from a subfolder and should be changed to

<a href="{{ url('/') }}/users/{{$user->id}}/edit" class="btn btn-block btn-md btn-warning">

No Controllers or Models file

Hi, I install the package and couldn't find the Controllers or Routes as stated from the README. Can anybody help me navigate through this? Thank you very much!!!

Using argon2id for password hashing

I configured argon2id hasing in config/hashing.php as explained in the documentation of Laravel itself. However, when I create users via this module users get a bcrypt hashed password.

In the UsersManagementController I see that the bcrypt-function is used. Maybe this could be replaced with Hash::make() which respects the hashing configuration? If that is okay, I can purpose a pull request for it.

login with admin

Swift_RfcComplianceException
Address in mailbox given [] does not comply with RFC 2822, 3.6.2.

Do you know how I can solve it?
thnx.

Add sorting feature

I have tried to sort the user list through LengthAwarePaginator but it doesn't work

   $data = [
            'users'             => $users->setCollection(
                collect(
                    collect($users->items())->sortBy('email')
                )->values()
            ),
            'pagintaionEnabled' => $pagintaionEnabled
        ];

laravelcollective/html is abandoned, laravellux/html looks like a replacement candidate

From LaravelCollective website:

Given this pattern, I think it's best to retire these packages rather than potentially open unsuspecting applications to a potential attack.

The author suggests spatie/laravel-html, but that would be a huge effort as the code patterns are way too different from the former.

A bit before the above quote the author says:

Anyone can freely take it and begin their own journey, it will be a journey that belongs to them.

Well, it looks this is done now:

⚠️ Important Update: The laravellux/html package has replaced the laravelcollective/html package. Please replace all references of Collective\Html in your project with LaravelLux\Html. For the majority of applications, no other changes should be necessary, and your project should continue to work as expected. However, always ensure to thoroughly test your project after this update to avoid unexpected issues. Thank you for your understanding.

I haven't tested it, but it looks like a pretty straightforward, drop-in replacement. So I kindly ask you to replace the now abandoned laravelcollective/html in favor of laravellux/html.

Change max password length

How can i change the maximum password length?
A length of 20 characters is not really practical anymore, i think…

Thank you for your great package. 😃

Dutch Translation

Hi, I translated your language files to dutch. Can you give me permissions to push a branch so I can create a pull request? Or would you like to receive them some other way?

Sending data to create user blade view

I've recently switched over to this package and am migrating the user registration over. I am attempting to send database data from the Registration controller to the view. My RegisterController has the following line:

return view('auth.register')->with('accounts', $accounts);

I can see that this logic is contained in

jeremykenedy\laravelusers\app\Http\Controllers\UsersManagementController@create

under this function:

    public function create()
    {
        $roles = [];

        if ($this->_rolesEnabled) {
            $roles = config('laravelusers.roleModel')::all();
        }

        $data = [
            'rolesEnabled'  => $this->_rolesEnabled,
            'roles'         => $roles,
        ];

        return view(config('laravelusers.createUserBlade'))->with($data);
    }

Is there any way to migrate this logic into the CRUD routes that have setup by this package? Or extend the logic contained in the existing function?

not install laravel 5.2.*

`composer require jeremykenedy/laravel-users
Using version ^1.0 for jeremykenedy/laravel-users
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Problem 1
- Conclusion: remove laravel/framework v5.2.45
- Conclusion: don't install laravel/framework v5.2.45
- jeremykenedy/laravel-users v1.0.0 requires laravelcollective/html ^5.3.0 -> satisfiable by laravelcollective/html[v5.3.0, v5.3.1, v5.4, v5.4.1, v5.4.2, v5.4.3, v5.4.4, v5.4.5, v5.4.6].
- jeremykenedy/laravel-users v1.0.1 requires laravelcollective/html ^5.3.0 -> satisfiable by laravelcollective/html[v5.3.0, v5.3.1, v5.4, v5.4.1, v5.4.2, v5.4.3, v5.4.4, v5.4.5, v5.4.6].
- laravelcollective/html v5.3.0 requires illuminate/view 5.3.* -> satisfiable by illuminate/view[v5.3.0, v5.3.16, v5.3.23, v5.3.4].
- laravelcollective/html v5.3.1 requires illuminate/view 5.3.* -> satisfiable by illuminate/view[v5.3.0, v5.3.16, v5.3.23, v5.3.4].
- laravelcollective/html v5.4 requires illuminate/view 5.4.* -> satisfiable by illuminate/view[v5.4.0, v5.4.13, v5.4.17, v5.4.19, v5.4.9].
- laravelcollective/html v5.4.1 requires illuminate/view 5.4.* -> satisfiable by illuminate/view[v5.4.0, v5.4.13, v5.4.17, v5.4.19, v5.4.9].
- laravelcollective/html v5.4.2 requires illuminate/view 5.4.* -> satisfiable by illuminate/view[v5.4.0, v5.4.13, v5.4.17, v5.4.19, v5.4.9].
- laravelcollective/html v5.4.3 requires illuminate/view 5.4.* -> satisfiable by illuminate/view[v5.4.0, v5.4.13, v5.4.17, v5.4.19, v5.4.9].
- laravelcollective/html v5.4.4 requires illuminate/view 5.4.* -> satisfiable by illuminate/view[v5.4.0, v5.4.13, v5.4.17, v5.4.19, v5.4.9].
- laravelcollective/html v5.4.5 requires illuminate/view 5.4.* -> satisfiable by illuminate/view[v5.4.0, v5.4.13, v5.4.17, v5.4.19, v5.4.9].
- laravelcollective/html v5.4.6 requires illuminate/view 5.4.* -> satisfiable by illuminate/view[v5.4.0, v5.4.13, v5.4.17, v5.4.19, v5.4.9].
- don't install illuminate/view v5.3.0|don't install laravel/framework v5.2.45
- don't install illuminate/view v5.3.16|don't install laravel/framework v5.2.45
- don't install illuminate/view v5.3.23|don't install laravel/framework v5.2.45
- don't install illuminate/view v5.3.4|don't install laravel/framework v5.2.45
- don't install illuminate/view v5.4.0|don't install laravel/framework v5.2.45
- don't install illuminate/view v5.4.13|don't install laravel/framework v5.2.45
- don't install illuminate/view v5.4.17|don't install laravel/framework v5.2.45
- don't install illuminate/view v5.4.19|don't install laravel/framework v5.2.45
- don't install illuminate/view v5.4.9|don't install laravel/framework v5.2.45
- Installation request for laravel/framework (locked at v5.2.45, required as 5.2.*) -> satisfiable by laravel/framework[v5.2.45].
- Installation request for jeremykenedy/laravel-users ^1.0 -> satisfiable by jeremykenedy/laravel-users[v1.0.0, v1.0.1].

Installation failed, reverting ./composer.json to its original content.`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.