This is a simple blog application built with Laravel. Users can create, edit, and delete blog posts. The application includes role-based access control, with "admin" users having the ability to manage all blog posts, while "user" users can only manage their own posts.
Make sure you have the following installed:
-
Clone the repository:
git clone https://github.com/fawel11/my-blog.git
-
Navigate to the project directory:
cd my-blog
-
Install PHP dependencies:
composer install
-
Install JavaScript dependencies:
npm install
-
Copy the
.env.example
file to.env
:cp .env.example .env
-
Generate an application key:
php artisan key:generate
-
Configure your database connection in the
.env
file:DB_CONNECTION=mysql DB_HOST=your-database-host DB_PORT=your-database-port DB_DATABASE=your-database-name DB_USERNAME=your-database-username DB_PASSWORD=your-database-password
-
Migrate the database:
php artisan migrate
-
Seed the database with sample data (including an admin user):
php artisan db:seed --class=UsersTableSeeder
-
Seed the database with sample blog data :
php artisan db:seed
-
Run the development server:
php artisan serve
-
Access the application in your browser at http://localhost:8000
-
Log in using the sample admin credentials:
- Email: admin@example.com
- Password: 12345678
-
Import the json file in postman:
- Path: /My Blog.postman_collection.json
No additional configuration is required for basic usage. Customize the application as needed for your specific requirements.
This project is licensed under the MIT License - see the LICENSE file for details.