Download the PHP package repat/laravel-helper without Composer

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

laravel-helper

Latest Version on Packagist Total Downloads

laravel-helper is a package full of helper functions I found useful when developing applications with Laravel. All functions are wrapped with a functions_exists() in case of conflicts.

Also have a look at

Ideas what should go in here? Write a pull request or email!

Installation

$ composer require repat/laravel-helper

Documentation

⚠️ The majority of helper functions are now in repat/php-helper which this package is based on. You can find the documentation at https://github.com/repat/php-helper

Database

mysql_headers($table, $assoc = false)

Returns an array of MySQL headers/columns or empty array in case of an error. If the second parameter is set true (default is false) it returns an associative array.

table_headers($model)

Returns the database table headers, similar to mysql_headers(), but based on an object of a Eloquent Model.

print_db_session($table = 'sessions')

print_r() the session of current user.

get_free_slug($toSlug, $field, $fqcn, $id, $pk)

Returns a unique slug for an Eloquent Model given the following parameters:

Will append a number if $toSlug is already taken.

insert_bindings($query)

Inserts values into ? from the ->toSql() string.

Object

morph_map()

Returns the morphMap from AppServiceProvider set with Relation::morphMap().

morph_map_key($fqcn)

Reverse lookup for a class in the morphMap of the AppServiceProvider set with Relation::morphMap().

cache_get_or_add($key, $callable)

Returns Cache for given key or adds the return value from the callable to the cache and then returns it.

dispatch_tinker($job)

Dispatches jobs from the tinker REPL.

Networking

route_path($path)

Get the path to the Laravel routes folder, similar to app_path(), see Helpers Documentation. It will append $path but it's not mandatory.

named_routes($path, $verb)

Returns array of all named routes in a routes file or null on error. It's possible to pass an HTTP verb/method defined in HTTP_VERBS_LARAVEL (see below).

current_route_name()

If the current route has a name, otherwise return null.

all_routes()

Returns an array of all routes like so:

route_exists($namedRoute)

Checks if the given route is a named route in any routes file.

Optional Packages

Optional packages suggested by this are required for these functions to work.

translated_attributes($fqcn)

Uses astrotomic/laravel-translatable and Reflection to get the translatedAttributes attribute of a Model.

HTML

extract_inline_img($text, $storagePath, $srcPath, $optimize)

Extracts an inline image from a text, saves it on the harddrive and puts in the filename with the src attribute. Can use the spatie/laravel-image-optimizer to optimize images after upload but it's disabled by default.

Constants

Contributors

License

Version

Contact

repat

Flattr this git repo


All versions of laravel-helper with dependencies

PHP Build Version
Package Version
Requires illuminate/database Version 5.*|^6.20.26|7.*|8.*|9.*|10.*|11.*
php Version >=7.2
repat/php-helper Version ^0.1.15
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 repat/laravel-helper contains the following files

Loading the files please wait ....