laradic / support
Laravel support package
Installs: 73 220
Dependents: 14
Suggesters: 0
Security: 0
Stars: 7
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- adbario/php-dot-notation: ~2.2
- danielstjules/stringy: ~3.1.0
- gabrielelana/byte-units: ~0.5
- illuminate/support: ^5.0|^6.0|^7.0|^8.0|^9.0
- symfony/expression-language: ~3.0|~4.0|~5.0|~6.0
- webmozart/path-util: ~2.3
Requires (Dev)
- danielstjules/sliceable-stringy: dev-master@dev
- flow/jsonpath: ~0.4
- friendsofphp/php-cs-fixer: ~2.0
- tcb13/substringy: ^1.0
Suggests
- danielstjules/sliceable-stringy: dev-master@dev
- flow/jsonpath: Enables JSONPath for arrays, collections and the wrapper
- tcb13/substringy: ^1.0
This package is auto-updated.
Last update: 2024-10-29 02:32:42 UTC
README
A general support package for the Laravel 5 framework. Laradic Support provides flexible and reusable components of code for commonly used functionality as well as the means to customize the default Laravel 5 folder structure.
The package follows the FIG standards PSR-1, PSR-2, and PSR-4 to ensure a high level of interoperability between shared PHP code.
Overview
- Over 100 mixins for
Str
,Arr
andCollection
. Enable/disable each one using the configuration file. Bench
for simple benchmarkingDot
is the dot-notated equivalent ofCollection
FS
as a singletonFilesystem
with static callable methodsSorter
for dependency sortingCommandsVisibility
trait for yourConsole\Kernel
to hide commands/namespaces (also adds-A|--show-all
option)- And more...
Quick Installation
Begin by installing the package through Composer.
composer require laradic/support=~2.0
Documentation
Classes
Bench
for simple benchmarkingDot
is the dot-notated equivalent ofCollection
FS
as a singletonFilesystem
with static callable methodsSorter
for dependency sortingCommandsVisibility
trait for yourConsole\Kernel
to hide commands/namespaces (also adds-A|--show-all
option)
Helpers
path
echo path_join('/var/www/vhost', '..', 'myhost', 'config.ini'); // => /var/www/myhost/config.ini echo path_get_directory('/var/www/vhost/laradic/config.ini'); // => vhost echo path_canonicalize('/var/www/vhost/laradic/../config.ini'); // => /var/www/vhost/config.ini // => C:/Programs/config.ini echo path_make_absolute('config/config.yml', '/var/www/project'); // => /var/www/project/config/config.yml echo path_make_relative('/var/www/project/config/config.yml', '/var/www/project/uploads'); // => ../config/config.yml $paths = array( '/var/www/vhosts/project/httpdocs/config/config.yml', '/var/www/vhosts/project/httpdocs/images/banana.gif', '/var/www/vhosts/project/httpdocs/uploads/../images/nicer-banana.gif', ); path_get_longest_common_base_path($paths); // => /var/www/vhosts/project/httpdocs path_get_filename('/views/index.html.twig'); // => index.html.twig path_get_filename_without_extension('/views/index.html.twig'); // => index.html path_get_filename_without_extension('/views/index.html.twig', '.html.twig'); // => index path_get_extension('/views/index.html.twig'); // => twig path_has_extension('/views/index.html.twig'); // => true path_has_extension('/views/index.html.twig', 'twig'); // => true path_has_extension('/images/profile.jpg', array('jpg', 'png', 'gif')); // => true path_change_extension('/images/profile.jpeg', 'jpg'); // => /images/profile.jpg path_get_home_directory();