This repository contains the source code for a simple blog built using PHP, Laravel, and MySQL. This blog allows users to create accounts, write posts, and interact with other users' posts through comments.
Before you begin, ensure you have the following installed:
- PHP (>= 7.4)
- Composer
- Laravel (>= 8.0)
- MySQL (>= 5.7)
- Clone this repository to your local machine:
git clone https://github.com/mahmudhmh/lara-post-blog.git
- Navigate into the project directory:
cd blog
- Install dependencies using Composer:
composer install
- Configure your environment variables by copying the
.env.example
file to.env
:
cp .env.example .env
- Generate an application key:
php artisan key:generate
-
Update the
.env
file with your MySQL database credentials. -
Run the migrations to create the necessary database tables:
php artisan migrate
- Optionally, seed the database with sample data:
php artisan db:seed
To run the application locally, use the following command:
php artisan serve
Then, navigate to http://localhost:8000
in your web browser to access the blog.
- User Authentication: Users can register, login, and logout.
- Create Posts: Authenticated users can create new blog posts.
- Commenting: Users can comment on posts.
- CRUD Operations: Authenticated users can edit and delete their own posts and comments.
- Admin Panel: Administrators have access to a dashboard where they can manage users, posts, and comments.
If you would like to contribute to this project, please follow these steps:
- Fork the repository.
- Create your feature branch (
git checkout -b feature/your-feature
). - Commit your changes (
git commit -m 'Add some feature'
). - Push to the branch (
git push origin feature/your-feature
). - Open a pull request.
This project is licensed under the MIT License.
- Laravel documentation: https://laravel.com/docs
- PHP documentation: https://www.php.net/docs.php
- MySQL documentation: https://dev.mysql.com/doc/
For any inquiries or issues, please contact [email protected].