PHPackages                             qit/helper - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. qit/helper

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

qit/helper
==========

A Colactions helper for Laravel

v1.10(4mo ago)038MITPHPPHP ^7.2.5 || ^8.0

Since Jul 28Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/aroon9002ahmed/helperPackage)[ Packagist](https://packagist.org/packages/qit/helper)[ RSS](/packages/qit-helper/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (2)Versions (13)Used By (0)

Qit Helper Package
==================

[](#qit-helper-package)

A collection of helper utilities for Laravel applications, providing YouTube video embedding and image processing capabilities.

Description
-----------

[](#description)

This package provides essential helper functions for Laravel applications, including YouTube video iframe generation and image resizing with caching capabilities. Perfect for content management systems and media-heavy applications.

Installation
------------

[](#installation)

You can install the package via Composer:

```
composer require qit/helper
```

**Note:** This package requires the Intervention Image library for image processing (V3):

```
composer require intervention/image
```

Configuration
-------------

[](#configuration)

After installation, you need to register the service provider in your Laravel application.

### Laravel 5.5+ (Auto-Discovery)

[](#laravel-55-auto-discovery)

The package will automatically register itself via Laravel's package auto-discovery feature.

### Manual Registration (Laravel 5.4 and below)

[](#manual-registration-laravel-54-and-below)

Add the service provider to your `config/app.php` file:

```
'providers' => [
    // Other service providers...
    Qit\Helper\HelperServiceProvider::class,
],
```

Usage
-----

[](#usage)

### YouTube Video Embedding

[](#youtube-video-embedding)

Generate YouTube video iframes or links from YouTube URLs:

```
use Qit\Helper\functions\HelperGeneral;

// Generate an iframe (default)
$iframe = HelperGeneral::Youtube('https://www.youtube.com/watch?v=dQw4w9WgXcQ');

// Generate with custom dimensions
$iframe = HelperGeneral::Youtube(
    'https://www.youtube.com/watch?v=dQw4w9WgXcQ',
    width: 800,
    height: 450,
    title: 'My Custom Video'
);

// Generate a clickable link instead of iframe
$link = HelperGeneral::Youtube(
    'https://www.youtube.com/watch?v=dQw4w9WgXcQ',
    title: 'Watch Video',
    iframe: false
);
```

**Supported YouTube URL formats:**

- `https://www.youtube.com/watch?v=VIDEO_ID`
- `https://youtu.be/VIDEO_ID`
- `https://www.youtube.com/embed/VIDEO_ID`

### Image Resizing and Caching

[](#image-resizing-and-caching)

Resize images and create cached versions with optional small thumbnails:

```
use Qit\Helper\functions\HelperGeneral;

// Basic resize - creates a cached version
HelperGeneral::ImgResize('image.jpg', 'uploads', 800, 600);

// Resize with small thumbnail
HelperGeneral::ImgResize(
    filename: 'image.jpg',
    path: 'uploads',
    weight: 800,
    height: 600,
    smallweight: 150,
    smallheight: 150
);

// Keep original aspect ratio (pass null for dimensions)
HelperGeneral::ImgResize('image.jpg', 'uploads', 'cache', 'small', 800, null);

// Custom folder names for cache and thumbnails
HelperGeneral::ImgResize('product.jpg', 'products', 'optimized', 'thumbs', 1200, 800, 200, 200);
```

**Image file structure created:**

```
storage/
├── uploads/
│   ├── image.jpg (original)
│   ├── cache/
│   │   └── image.jpg (resized version)
│   └── small/
│       └── image.jpg (thumbnail, if specified)

```

### E-commerce Order Status Management

[](#e-commerce-order-status-management)

Manage order statuses with predefined status codes and names:

```
use Qit\Helper\functions\HelperShop;

// Get a specific order status name
$statusName = HelperShop::getOrderStatusName(1);
// Returns: "Confirmed"

// Handle unknown status codes
$statusName = HelperShop::getOrderStatusName(999);
// Returns: "Unknown Status"

// Get all available order statuses
$allStatuses = HelperShop::getOrderStatusName(null, true);
// Returns: [
//     0 => 'Pending',
//     1 => 'Confirmed',
//     2 => 'Processing',
//     3 => 'Shipped',
//     4 => 'Cancelled',
//     5 => 'Delivered'
// ]

// Usage in a loop for displaying order status options
foreach (HelperShop::getOrderStatusName(null, true) as $code => $name) {
    echo "{$name}";
}
```

**Available Order Statuses:**

- `0` - Pending
- `1` - Confirmed
- `2` - Processing
- `3` - Shipped
- `4` - Cancelled
- `5` - Delivered

Features
--------

[](#features)

- **YouTube Integration**: Convert YouTube URLs to embedded iframes or links
- **Image Processing**: Resize images with automatic caching and custom folder names
- **E-commerce Support**: Order status management with predefined status codes
- **Flexible Dimensions**: Support for aspect ratio preservation
- **Thumbnail Generation**: Create small versions of images
- **Laravel Integration**: Service provider and auto-discovery support
- **PSR-4 Autoloading**: Modern PHP standards compliance

Requirements
------------

[](#requirements)

- PHP &gt;= 7.2.5 || ^8.0
- Laravel &gt;= 8.0 (supports up to Laravel 12.0)
- Intervention Image ^3.0 (for image processing)
- GD or Imagick PHP extension

File Structure
--------------

[](#file-structure)

```
src/
├── HelperServiceProvider.php
└── functions/
    ├── HelperGeneral.php
    └── HelperShop.php

```

Error Handling
--------------

[](#error-handling)

The package includes basic error handling, but you should wrap calls in try-catch blocks for production use:

```
try {
    HelperGeneral::ImgResize('image.jpg', 'uploads', 'cache', 'small', 800, 600);
    $status = HelperShop::getOrderStatusName(1);
} catch (Exception $e) {
    // Handle errors
    Log::error('Helper function failed: ' . $e->getMessage());
}
```

Contributing
------------

[](#contributing)

Contributions are welcome! Please feel free to submit a Pull Request.

1. Fork the repository
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](LICENSE).

Author
------

[](#author)

**Ahmed Saad Hassan**

- Email:

Changelog
---------

[](#changelog)

### v1.0.0 (2025-07-29)

[](#v100-2025-07-29)

- Initial release
- YouTube video iframe generation
- Image resizing with caching support and custom folder names
- E-commerce order status management
- Laravel service provider integration
- Support for Laravel 8.0 through 12.0

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance75

Regular maintenance activity

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~15 days

Recently: every ~39 days

Total

11

Last Release

138d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ed5c726d97ad2603f18cb934794a4de9c0e7fd0c1623bf50700c9192e35a1165?d=identicon)[ahmedsaad](/maintainers/ahmedsaad)

---

Top Contributors

[![aroon9002ahmed](https://avatars.githubusercontent.com/u/7735634?v=4)](https://github.com/aroon9002ahmed "aroon9002ahmed (39 commits)")

### Embed Badge

![Health badge](/badges/qit-helper/health.svg)

```
[![Health](https://phpackages.com/badges/qit-helper/health.svg)](https://phpackages.com/packages/qit-helper)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[laravolt/avatar

Turn name, email, and any other string into initial-based avatar or gravatar.

2.0k5.4M31](/packages/laravolt-avatar)[illuminate/pipeline

The Illuminate Pipeline package.

9346.6M213](/packages/illuminate-pipeline)[illuminate/pagination

The Illuminate Pagination package.

10532.5M862](/packages/illuminate-pagination)[beyondcode/laravel-favicon

Create dynamic favicons based on your environment settings.

37345.5k](/packages/beyondcode-laravel-favicon)[flarum/core

Delightfully simple forum software.

211.3M1.9k](/packages/flarum-core)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
