- PHP version >= 8.2
- Composer installed for development purposes
- Apache/Nginx for production
composer create-project phpslides/phpslides ProjectNameReplace "ProjectName" with your desired project name (this will also be used as the directory name).
- First, install the PhpSlides CLI tool:
composer global require phpslides/cli- Verify installation:
phpslides --help- Create a new project:
phpslides create ProjectName- Clone the repository directly from GitHub:
git clone https://github.com/phpslides/phpslides.git- If no terminal is available, you can download the template directly from GitHub:
- Visit: https://github.com/phpslides/phpslides
- Follow the phpslides URL on GitHub
After installation, rename the .env.example file to .env before starting your development server.
PhpSlides follows MVC architecture where you need to understand every aspect of each files and folder.
project-root/
├── app/
│ ├── Forgery/
│ ├── Http/
│ │ ├── Api/
│ │ └── Controller/
│ └── Guards/
├── src/
│ ├── configs/
│ ├── resources/
│ └── routes/
├── vendor/
├── .env
├── .htaccess
└── configs.json
The app directory contains your main application logic:
- Houses controller classes for web routing
- Each controller must end with "Controller" suffix
- Create new controllers using:
phpslides make:controller ClassName- Contains database structure definitions
- Used for creating and managing database tables
- Can be created manually or via CLI commands
phpslides make:forge dbName "column1 column2" - View complete guide on creating database system in the database section
- Contains API controllers used for endpoints
- All files must end with "Endpoint"
- Create API endpoints using:
phpslides make:api-controller User- Automatically creates
UserEndpointclass in Http/Api directory
- Contains authentication logic
- Used for protecting web & API routes
- Create guards using:
phpslides make:guard AdminGuard-
Controllers
- Handle web routing and request processing
- Must follow naming convention:
ClassNameController - Can be created manually or via CLI
-
API Controllers
- Handle API endpoints
- Must end with "Endpoint" suffix
- Follow RESTful conventions
-
Guards
- Manage authentication and authorization
- Protect routes and resources
- Can be customized for different access levels
-
Database (Forgery)
- Manage database structures
- Create and modify tables
- Handle database migrations
Basic configuration details are stored in .env file. Make sure to:
- Copy
.env.exampleto.env - Update database and other configuration settings
- Set up your development environment before starting
- Set up your first controller
- Create database structures
- Configure authentication
- Start building your application