dev-master
9999999-devA PHP boilerplate for less configurable environments.
MIT
The Requires
framework boilerplate php-m
A PHP boilerplate for less configurable environments.
php-m is a very slim framework, that offers a solid boilerplate, that can be used for many simple, but also more complex web applications., (*1)
php-m was designed to be very unopinionated, lightweight and secure. It is also designed to be deployed easily in any environmnet as it tries to rely on as little operating system specific functionality and config-specific functionality as possible., (*2)
To initiate a new project in php-m with composer, follow these easy steps:
* composer create-project nualiian/php-m
* mv .env.example .env
and fill out your credentials
* bower install
to install the frontend dependencies
* npm install
to install all the npm dependencies
* npm run build
to build the resources
* ready to use!, (*3)
php-m offers this functionality out of the box:, (*4)
The framework has its own session based Auth class, that is ready to be used in your application. The main user model class is located in framework/Core/Auth
.
To login a user you simply need to call Auth::login($credentials)
in you controller. Logout on the toher hand is provided via Auth::logout()
.
Auth class also offers a convenience method for retrieving the user from the session by calling Auth::user()
. If there is no user loggd in false
will be returned.
To create a new user, you can call User::create($credentials)
and pass in an array of credentials (email and password) to persist a newly created user into the database., (*5)
php-m uses NotORM as and active record manager for the database., (*6)
This boilerplate comes with a custom gulpfile that builds your resources, which are located in the resources
folder. It uses Sass for stylesheets. php-m also comes preloaded with MaterializeCSS framework., (*7)
npm run watch
to build resources as you gophp -S localhost:3000 -t .
, or set up any other server using apache, nginx, ...A PHP boilerplate for less configurable environments.
MIT
framework boilerplate php-m