- At first change the DB credentials & app URL (to http://localhost:8900) in
.env
file - Import the demo DB
db.sql
in your DB - then open a terminal or command line in this project and run this command
php zero serve
. - before run the php insure that your php bin folder already added in ENV path.
- or use static test domain by configure your server.
- then open your browser and put this (
http://localhost:8900
) in url. - That's it.
Default Admin Email & Password
hello@msar.me
password
If you have docker installed in your system then you can run this project by docker.
- At first change the DB credentials & others config in
.env
file - then open a terminal or command line in this project and run this command
docker-compose up -d
. - then open your browser and put this (
http://localhost:8000
) in url.
In this application by default has a AutoLoader to load all the files and classes. If you want to use composer then you can use it.
- At first run this command
composer install
in your terminal or command line. - then open your browser and put this (
http://localhost:8900
) in url.
I follow MVC pattern here.
- In
views
folder have all the view files. - In
app/Models
folder have all the models - In
app/Controllers
folder have all the Controllers - In
app/routes.php
file contain all the routes of the App. - In
app/Classes
folder have all the necessary files and classes.
Here is the list of available methods.
php zero serve
- To run the applicationphp zero make:controller <ControllerName>
- To create a new controllerphp zero make:model <ModelName>
- To create a new modelphp zero make:view <name>
- To create a new view file (you can pass the folder name with name likefolder.name
orfolder/name
)
Here is the list of available functions.
env('ENV_KEY')
- To get the value of a ENV keyapp('classPath')
- To get the instance of a classview('viewName', $data)
- To load a view fileresponse('data', 'status')
- To send a responseauth()
- To get the instance of Auth classrequest($key)
- To get the instance of Request class or get the value of a request keyinput()
- To get the instance of Redirect classflash('key', 'value')
- To set a flash messageflash('key')
- To get a flash messageisJson($data)
- To check a data is json or notredirectTo('url')
- To redirect to a urlurl($path)
- To get the full url of a pathassets($path)
- To get the full url of a assets pathdd($data)
- To dump and die a datarequest_method($method)
- To check the request method
Here is the list of available classes.
Auth
- To handle the authenticationBase
- A stdClass to handle the dataController
- To handle the controllerConnectDB
- To handle the databaseCollection
- To handle the collection of dataInput
- To handle the input dataManager
- To handle the managerModel
- To handle the modelRequest
- To handle the requestResponse
- To handle the responseRouter
- To handle the routerSession
- To handle the sessionView
- To handle the viewValidation
- To handle the validation
Users - Table - id, name, email, password
MIT