Skip to content

mohammadisa2/blog

Repository files navigation

Laravel Filament Project

This is a Laravel project using PHP 8+. The project includes the following key libraries:

Installation

Follow these steps to install and set up the project:

Prerequisites

  • PHP 8.0 or higher
  • Composer
  • MySQL or another supported database
  • Node.js and npm (optional, if you need to compile assets)

Steps

  1. Clone the repository:

    git clone https://github.com/mohammadisa2/blog.git
    cd blog
  2. Install dependencies:

    composer install
    npm install && npm run dev  # If you need to compile assets
  3. Environment setup: Copy the .env.example to .env and adjust your environment variables, including APP_URL, DB_*, and other necessary configurations.

    cp .env.example .env
  4. Generate application key:

    php artisan key:generate
  5. Run migrations:

    php artisan migrate
  6. Run seeder (if applicable):

    php artisan db:seed
  7. Serve the application:

    php artisan serve
  8. Install Filament Shield (for RBAC): You can follow the Filament Shield documentation here to set up roles and permissions.

  9. Set up Rupadana API Service (for API): The Rupadana API Service documentation can be found here.

API Documentation

1. Get Blogs with Category Filter

This endpoint retrieves blogs, including their category relation, and allows filtering based on the category.slug.

Endpoint:

GET {{APP_URL}}/api/admin/blogs?include=category&filter[category.slug]=computer
  • Parameters:
    • include=category – Includes the category relation.
    • filter[category.slug]=<slug> – Filters the blogs by the slug of the category.

2. Sorting Blogs by ID in Descending Order

To sort blogs by id in descending order:

Endpoint:

GET {{APP_URL}}/api/admin/blogs?sort=-id
  • Parameters:
    • sort=-id – Sorts the blogs by ID in descending order.

3. Get Blog Details by Slug (with Category Relation)

This endpoint fetches a specific blog by its slug, including its category relation.

Endpoint:

GET {{APP_URL}}/api/admin/blogs/ex-qui-soluta-archit?include=category
  • Parameters:
    • include=category – Includes the category relation in the response.

4. Get All Categories

This endpoint retrieves all available categories. No additional parameters are required since no relations are involved.

Endpoint:

GET {{APP_URL}}/api/admin//category-blogs

This documentation provides basic API interaction for the blog and category entities. Ensure you set the correct APP_URL in your .env file to correspond to your environment.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages