Download the PHP package maize-tech/laravel-helpers without Composer

On this page you can find all versions of the php package maize-tech/laravel-helpers. 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-helpers

Laravel Helpers

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

This repository contains some useful helpers for most applications using Laravel.

Installation

You can install the package via composer:

You can publish the config file with:

This is the content of the published config file:

Usage

To use the package, you can simply call the hlp() helper function, followed by one of the Available methods methods listed below. If needed, you could also call the static method directly.

Here's an example using both the helper function and the static method:

Available methods

anonymizeFilename

The anonymizeFilename function returns a randomized name of the given file followed by its extension.

classUsesTrait

The classUsesTrait function returns whether a class object or name uses the given trait or not.

instanceofTypes

The instanceofTypes function returns whether a class object is an instance of at least one of the given types or not.

isUrl

The isUrl function returns whether a string is a valid URL or not.

modelKeyName

The modelKeyName function returns the key name of a given model object or class name.

morphClassOf

The morphClassOf function returns the morph class name of a given model object or class name.

resolveMorphedModel

The resolveMorphedModel function returns the fully qualified model class name of a given morph class name.

You can either pass the singular or plural name of the morph class name.

paginationLimit

The paginationLimit function returns the amount of items per page.

It is useful when working with queries who need a pagination, and allows to define a default pagination limit and the max amount of items per page.

It will also check whether the request's query string contains a limit parameter: if true, the given limit overrides the default limit.

pipe

The pipe function allows you to integrate Laravel pipelines with ease. The first parameter is the object to be sent through the pipeline, while the second is the list of pipes.

sanitizeArrayOfStrings

The sanitizeArrayOfStrings function sanitizes an array of strings by removing all HTML tags and whitespace from both ends. When passing an associative array, it also filters all keys with an empty value.

sanitizeString

The sanitizeString function sanitizes a string by removing all HTML tags and whitespace from both ends.

sanitizeUrl

The sanitizeUrl function prepends the specified url with the https protocol if none is set.

Adding custom helper methods

If needed, you can easily add your own helper methods.

All you have to do is define your custom helper class and implement the HelperMacro interface:

After that, you can add your method to the macros attribute from config/helpers.php:

Alternatively, if you need to define custom helpers at runtime, you can call the macro static method of the Helper class:

You can now call your custom helper method with the hlp() helper method:

Testing

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

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


All versions of laravel-helpers with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/database Version ^10.0|^11.0
illuminate/support Version ^10.0|^11.0
spatie/laravel-package-tools Version ^1.14.1
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 maize-tech/laravel-helpers contains the following files

Loading the files please wait ....