Download the PHP package mortezaa97/brands without Composer
On this page you can find all versions of the php package mortezaa97/brands. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package brands
Brands Package
A Laravel package for managing product brands with full API support, authorization policies, and Filament integration.
Features
- ✅ Complete CRUD operations for brands
- ✅ RESTful API endpoints with resource transformers
- ✅ Authorization policies for granular access control
- ✅ Soft deletes support
- ✅ Category relationships
- ✅ SEO-friendly with meta fields
- ✅ Slug-based routing
- ✅ User tracking (created by/updated by)
- ✅ Filament plugin ready
- ✅ API Resources for simple and detailed responses
Installation
You can install the package via composer:
Service Provider Registration
The package will automatically register its service provider. If you need to manually register it, add the following to your config/app.php:
Publish Assets
Publish the configuration file:
Publish migrations (optional, migrations are loaded automatically):
Run Migrations
Run the migrations to create the brands table:
Database Schema
The brands table includes the following fields:
| Field | Type | Description |
|---|---|---|
| id | bigint | Primary key |
| name | string | Brand name |
| slug | string | URL-friendly identifier |
| logo | string (nullable) | Logo file path |
| status | smallint | Brand status (active/inactive) |
| category_id | foreignId (nullable) | Related category |
| desc | longText (nullable) | Brand description |
| meta_title | string (nullable) | SEO meta title |
| meta_desc | longText (nullable) | SEO meta description |
| meta_keywords | string (nullable) | SEO keywords |
| page_title | string (nullable) | Page display title |
| color | string (nullable) | Brand color theme |
| created_by | foreignId | User who created the brand |
| updated_by | foreignId (nullable) | User who last updated the brand |
| deleted_at | timestamp (nullable) | Soft delete timestamp |
| created_at | timestamp | Creation timestamp |
| updated_at | timestamp | Last update timestamp |
Configuration
The configuration file config/brands.php allows you to customize:
Usage
API Endpoints
The package automatically registers the following API routes:
Get All Brands
Returns a collection of brands with simple resource transformation.
Response:
Get Single Brand
Returns a detailed brand resource including category relationship.
Response:
Using in Your Code
Create a Brand
Query Brands
Update a Brand
Delete a Brand (Soft Delete)
Relationships
The Brand model includes the following relationships:
Category
Created By User
Updated By User
Authorization
The package includes a BrandPolicy for authorization. The following gates are available:
viewAny- View list of brandsview- View single brandcreate- Create new brandupdate- Update existing branddelete- Delete brandrestore- Restore soft-deleted brandforceDelete- Permanently delete brand
Example usage in your controllers:
API Resources
The package provides two resource transformers:
BrandResource
Full details including relationships and SEO fields.
BrandSimpleResource
Simplified response for list views.
Filament Integration
To integrate with Filament, register the plugin in your panel provider:
Facade
You can use the Brands facade for convenient access:
Global Scope
The Brand model includes a global scope that orders all queries by created_at in descending order (newest first).
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- Morteza Jafari
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of brands with dependencies
illuminate/container Version ^8.12|^9.0|^10.0|^11.0|^12.0
illuminate/contracts Version ^8.12|^9.0|^10.0|^11.0|^12.0