Download the PHP package osoobe/laravel-utilities without Composer

On this page you can find all versions of the php package osoobe/laravel-utilities. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-utilities

Laravel Utilities

[Travis]() Total Downloads

A collection of Eloquent model traits, static helper classes, migration Blueprint macros, a generic AJAX data endpoint, and a base Artisan command — designed to eliminate boilerplate across Laravel applications.

Install

The service provider is auto-discovered. No manual registration needed.

Table of Contents


Migration Blueprint Macros

The package registers Blueprint macros that add common column groups with a single call.

Location columns

Coordinate columns

Userstamp columns

Tracks which user created and last edited a record using polymorphic morphs, supporting multi-model auth setups.

Active status column


Eloquent Model Traits

Active — Active/inactive record scopes

Requires an is_active column (added via $table->isActive()).

HasVerified — Verified record scopes

Requires a verified column.

IsDefault — Default record scopes

Requires an is_default column.

Sorted — Sort order scope

Requires a sort_order column.

HasSlug — Slug-based lookup

HasEmail — Email verification scopes

Userstamp — Auto-fill creator/editor on save

Requires userstamp() Blueprint macro columns. Automatically sets creator_* on create and editor_* on update using Auth::user().

TimeDiff — Date/time scopes and human-readable diffs

HasFullTextSearch / FullTextSearchTrait — MySQL FULLTEXT search

Add the FULLTEXT index in your migration using MigrationHelper, then apply the trait to the model.

AdvanceWhereQuery — Conditional where clauses

ModelDefaultTrait — Set default values before create

SEO — SEO attribute contract

Lang — Locale-based scopes

Requires a lang column and an App\Language model in the consuming app.


Helper Classes

All helpers use static methods and require no instantiation.

Utilities

General-purpose utilities for objects, arrays, math, and strings.

Str

Extends Illuminate\Support\Str — all built-in Laravel string methods are available.

FormatHelper

Renders URLs, emails, and phone numbers as plain text, HTML anchors, or Markdown links.

Supported $format values: 'html', 'markdown', 'string' (default).

Date

MigrationHelper

PhoneNumberHelper

Validation pattern is configurable via config('validation.phone.pattern').

ImageHelper

MapBoxHelper

GoogleMapsHelper


Generic AJAX Resource Endpoint

The package provides a single parameterized route that serves model data to front-end libraries (Bootstrap Table, Select2) without writing per-model controllers or routes.

Route: GET /api/resources/{slug}/{format}
Name: api.resource.get
Formats: bst (Bootstrap Table, default), select2

1. Publish and configure api-endpoints.php

Copy the config file to your application:

Then define each resource in config/api-endpoints.php:

2. Call the endpoint from the front end

Bootstrap Table:

Response shape:

Select2:

Response shape:

Query parameters supported

Parameter Description
term / search Text search (FULLTEXT or LIKE depending on config)
sort Column to sort by (default: id)
order asc or desc (default: asc)
limit Number of records
offset Pagination offset (Bootstrap Table)
paginate true to enable cursor pagination (Select2)

Custom Validators

Two validation rules are registered automatically.

phone

Override the pattern in config/validation.php:

password

Requires the consuming app to publish a config/validation.php with:


Base Artisan Command

Extend Osoobe\Utilities\Console\Command to get automatic execution timing.


Use Cases

Multi-tenant CRM with creator tracking

Use Userstamp + Active to track who created/edited every record and filter inactive ones:

Job board with expiry and full-text search

Use TimeDiff + FullTextSearchTrait for a job listing model:

Geocoding an address on model save

Combine MapBoxHelper with a model observer or ModelDefaultTrait:

Searchable admin panel with Bootstrap Table + Select2

Register your models in config/api-endpoints.php and drop in the JS widgets — no backend changes needed when adding new searchable models.

Storing user avatar uploads as base64

SEO-ready product pages


Testing

Tests extend Osoobe\Utilities\Tests\TestCase (Orchestra Testbench), which auto-registers the service provider.

Changelog

Please see CHANGELOG for recent changes.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security-related issues, please email [email protected] instead of using the issue tracker.

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-utilities with dependencies

PHP Build Version
Package Version
Requires guzzlehttp/guzzle Version ^7.3
illuminate/support Version ^6.0|^7.0|^8.0|^9.0|^10.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package osoobe/laravel-utilities contains the following files

Loading the files please wait ...