Download the PHP package delboy1978uk/bone-user without Composer
On this page you can find all versions of the php package delboy1978uk/bone-user. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download delboy1978uk/bone-user
More information about delboy1978uk/bone-user
Files in delboy1978uk/bone-user
Package bone-user
Short Description Integration of delboy1978uk/user for Bone Framework
License MIT
Informations about the package bone-user
bone-user
User registration and login package for Bone Framework
setup
Simply add the Package to Bone's module config
And once you have done that, setup the DB using the migration commands:
Quick point of order here. If you always type vendor/bin/whatever
, save yourself the hassle by adding the following to
your ~/.bashrc
or ~.zshrc
or whichever shell file:
Then you can close and reopen your terminal, and from now on you can just type bone
. The same for any
executable stored in a bin/
directory in your current folder.
The last setup stage is to deploy the public assets (CSS, JS, etc.)
(You added your PATH so didn't have to type vendor/bin/bone
, right?)
usage
Once installed head to your site (by default using the Bone Framework Docker development environment (it's
https://awesome.scot/user
) and register yourself as a user. Again if using the provided dev environment, check your
MailHog server at https://awesome.scot:8025
to see any outgoing mails in a convenient web inbox. Activate your account
etc! You can see all of the available endpoints in src/BoneUserPackage.php
in the addRoutes()
section.
authorization middleware
You can lock down a route to make it available to a logged in user by adding the session authorization middleware
Bone\User\Http\Middleware\SessionAuth
like so:
Once a route is locked down, in your controller you can get a User object by calling:
There is also a SessionAuthRedirect
middleware class, which you can add and which will take the visitor to the login
page, but redirect back there once logged in.
service and repository classes
You can also fetch the Del\Service\UserService
from your packages container regsistration class to inject into your
classes. This allows you to perform various funcions, most cases of which are mostly covered, but in practical terms
allows you to access the database repository and save data. A user object also has a Del\Entity\Person
ando you can
also fetch the Del\Person\Service\PersonService
from the container.
views
Obviously, you probably won't want the default Bone view with the pirate theme! So head into your config folder and override the views. Email templates are also in there. Hack away. `
config settings
If you'd like to go to your own controller upon login, create a config with the key bone-user
, and add the URL you
wish to redirect to. You can also disable the /user/register
end point, and you can make filling in a profile a
requirement.
`
That's about it! The rest should autocomplete in your IDE, and it's all pretty straightforward! Have fun.
All versions of bone-user with dependencies
delboy1978uk/bone-http Version ^2.4
delboy1978uk/bone-doctrine Version ^2.0
delboy1978uk/bone-paseto Version ^1.0
delboy1978uk/form Version ^v2.5
delboy1978uk/user Version ^v4.7
laminas/laminas-diactoros Version ^3.3