Download the PHP package otas/dynamic-pages without Composer
On this page you can find all versions of the php package otas/dynamic-pages. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download otas/dynamic-pages
More information about otas/dynamic-pages
Files in otas/dynamic-pages
Package dynamic-pages
Short Description A comprehensive dynamic-pages package with dynamic pages, sections, items, custom attributes, and keywords support
License MIT
Informations about the package dynamic-pages
Otas Dynamic Pages
A comprehensive Laravel dynamic pages package that provides a robust content management system with pages, sections, items, custom attributes, and keywords support. Built with multilingual capabilities and media management integration.
Features
- Content Management: Create and manage pages, sections, and section items
- Multilingual Support: Full Arabic and English translation support
- Custom Attributes: Flexible custom attribute system for enhanced content metadata
- Keyword Management: Organize content with a powerful keyword system
- Media Integration: Built-in media management capabilities
- Admin Interface: Complete admin controllers for content management
- API Resources: RESTful API endpoints for all entities
- Filtering: Advanced filtering capabilities for all content types
- Validation: Comprehensive form request validation
- Database Migrations: Automated database setup
Requirements
- PHP 8.1+
- Laravel 11.0+
- MySQL/PostgreSQL database
Installation
Install the package via Composer:
Quick Setup
Run the setup command to install and configure the package:
This command will:
- Publish the configuration file
- Cache the configurations
- Optionally run migrations
Manual Installation
If you prefer manual setup:
-
Publish the configuration file:
-
Run the migrations:
- Cache the configuration:
Configuration
After installation, you can find the configuration file at config/dynamic_pages.php. Customize the package settings according to your needs.
Usage
Models
The package provides several core models:
- Page: Main content pages
- Section: Content sections within pages
- SectionItem: Individual items within sections
- CustomAttribute: Flexible attribute system
- Keyword: Content organization and tagging
Admin Controllers
Access the admin functionality through the provided controllers:
PageController- Manage pagesSectionController- Manage sectionsSectionItemController- Manage section itemsKeywordController- Manage keywordsCustomAttributeController- Manage custom attributes
API Resources
The package includes API resources for all entities, suitable for frontend frameworks or mobile applications.
Multilingual Support
All content models support Arabic and English translations out of the box. The package uses the otas/translatable package for translation management.
Filtering
Advanced filtering is available for all models using the otas/filterable package. Filter classes are organized in:
Admin/- Admin interface filtersWebsite/- Frontend filtersSupport/- Support system filters
Dependencies
This package depends on:
- otas/translatable - Multilingual support
- otas/filterable - Advanced filtering
- otas/mediable - Media management
API Endpoints
The package provides three types of API endpoints with different access levels:
Admin Routes (Admin Interface)
Base prefix: Configurable via dynamic_pages.package_admin_routes_prefix
-
Pages Management:
GET /pages- List all pagesGET /pages/{path}- Get specific page (by path)PUT /pages/{path}- Update pagePATCH /pages/{path}- Partially update page
-
Keywords Management:
GET /keywords- List all keywordsPOST /keywords- Create keywordGET /keywords/{id}- Get specific keywordPUT /keywords/{id}- Update keywordPATCH /keywords/{id}- Partially update keywordDELETE /keywords/{id}- Delete keyword
-
Page Keywords:
GET /pages/{path}/keywords- Get page keywordsPOST /pages/{path}/keywords- Assign keyword to page
-
Sections Management:
GET /pages/{path}/sections- List page sectionsGET /pages/{path}/sections/{identifier}- Get specific section (by identifier)PUT /pages/{path}/sections/{identifier}- Update sectionPATCH /pages/{path}/sections/{identifier}- Partially update section
-
Section Media:
POST /sections/{identifier}/medias- Upload section mediaDELETE /sections/{identifier}/medias/{id}- Delete section media
-
Section Custom Attributes:
GET /pages/{path}/sections/{identifier}/custom-attributes- List section attributesGET /pages/{path}/sections/{identifier}/custom-attributes/{key}- Get specific attribute (by key)PUT /pages/{path}/sections/{identifier}/custom-attributes/{key}- Update attributePATCH /pages/{path}/sections/{identifier}/custom-attributes/{key}- Partially update attribute
-
Section Items Management:
GET /pages/{path}/sections/{identifier}/section-items- List section itemsGET /pages/{path}/sections/{identifier}/section-items/{item_identifier}- Get specific item (by identifier)PUT /pages/{path}/sections/{identifier}/section-items/{item_identifier}- Update itemPATCH /pages/{path}/sections/{identifier}/section-items/{item_identifier}- Partially update item
-
Section Item Media:
POST /section-items/{item_identifier}/medias- Upload item mediaDELETE /section-items/{item_identifier}/medias/{id}- Delete item media
- Section Item Custom Attributes:
GET /pages/{path}/sections/{identifier}/section-items/{item_identifier}/custom-attributes- List item attributesGET /pages/{path}/sections/{identifier}/section-items/{item_identifier}/custom-attributes/{key}- Get specific attribute (by key)PUT /pages/{path}/sections/{identifier}/section-items/{item_identifier}/custom-attributes/{key}- Update attributePATCH /pages/{path}/sections/{identifier}/section-items/{item_identifier}/custom-attributes/{key}- Partially update attribute
Support Routes (Support Interface)
Base prefix: Configurable via dynamic_pages.package_support_routes_prefix
Full CRUD operations available for all resources:
POST /pages- Create pageDELETE /pages/{path}- Delete page (by path)POST /pages/{path}/sections- Create sectionDELETE /pages/{path}/sections/{identifier}- Delete section (by identifier)POST /pages/{path}/sections/{identifier}/section-items- Create section itemDELETE /pages/{path}/sections/{identifier}/section-items/{item_identifier}- Delete section item (by identifier)POST /pages/{path}/sections/{identifier}/custom-attributes- Create section custom attributeDELETE /pages/{path}/sections/{identifier}/custom-attributes/{key}- Delete section custom attribute (by key)POST /pages/{path}/sections/{identifier}/section-items/{item_identifier}/custom-attributes- Create section item custom attributeDELETE /pages/{path}/sections/{identifier}/section-items/{item_identifier}/custom-attributes/{key}- Delete section item custom attribute (by key)- All other endpoints same as Admin routes but with full CRUD capabilities
Website Routes (Public Interface)
Base prefix: Configurable via dynamic_pages.package_website_routes_prefix
GET /pages- List public pagesGET /pages/{path}- Get specific public page (by path)
Configuration
The package can be configured via the config/dynamic_pages.php file:
Route Configuration
Middleware Configuration
Configuration Keys Usage
package_routes_prefix: Sets the global prefix for all dynamic pages routes (e.g., 'api' results in/api/pages)package_admin_routes_prefix: Additional prefix for admin routes (e.g., 'admin' with global prefix results in/api/admin/pages)package_support_routes_prefix: Additional prefix for support routespackage_website_routes_prefix: Additional prefix for public website routesmiddlewares: Define different middleware stacks for each route type to control access and behaviorload_routes: Control whether package routes should be loaded (useful for custom route implementations)
Content Seeding
The package provides a comprehensive content seeding system to help you populate your dynamic pages with initial content.
Using the Content Seeder
-
Publish the Content Seeder:
-
Locate the Seeder: Find the published seeder at
database/seeders/DynamicPagesContentSeeder.php -
Configure Content: Edit the seeder file to define your content structure:
- Run the Seeder:
Content Structure
The seeder supports the following structure:
- Pages: Define page paths and multilingual content
- Sections: Configure section properties including validation rules
- Section Items: Add items within sections with their own attributes
- Custom Attributes: Flexible attribute system for both sections and section items
- Multilingual Support: Full Arabic and English translation support for all content
Seeder Features
- Transaction Safety: All seeding operations are wrapped in database transactions
- Duplicate Prevention: The seeder checks for existing content to prevent duplicates
- Flexible Configuration: Support for various content types and validation rules
- Multilingual Content: Automatic translation handling for all supported languages
Database Structure
The package creates the following tables:
pages- Main content pagespage_translations- Page translationssections- Content sectionssection_translations- Section translationssection_items- Section itemssection_item_translations- Section item translationscustom_attributes- Custom attributescustom_attribute_translations- Custom attribute translationskeywords- Keywordskeyword_translations- Keyword translationskeyword_related_objects- Keyword relationships
License
This package is open-sourced software licensed under the MIT license.
All versions of dynamic-pages with dependencies
otas/translatable Version >=1.0
otas/filterable Version >=1.0
otas/mediable Version >=1.0