/my-blog

Primary LanguageJavaScript

Laravel Blog Application

Introduction

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.

Prerequisites

Make sure you have the following installed:

Installation

  1. Clone the repository:

    git clone https://github.com/fawel11/my-blog.git
  2. Navigate to the project directory:

    cd my-blog
  3. Install PHP dependencies:

    composer install
  4. Install JavaScript dependencies:

    npm install
  5. Copy the .env.example file to .env:

    cp .env.example .env
  6. Generate an application key:

    php artisan key:generate
  7. 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
  8. Migrate the database:

    php artisan migrate
  9. Seed the database with sample data (including an admin user):

    php artisan db:seed --class=UsersTableSeeder
  10. Seed the database with sample blog data :

    php artisan db:seed

Usage

  1. Run the development server:

    php artisan serve
  2. Access the application in your browser at http://localhost:8000

  3. Log in using the sample admin credentials:

API for POSTMAN

  1. Import the json file in postman:

    • Path: /My Blog.postman_collection.json

Additional Configuration

No additional configuration is required for basic usage. Customize the application as needed for your specific requirements.

License

This project is licensed under the MIT License - see the LICENSE file for details.