Download the PHP package djl997/blade-shortcuts without Composer

On this page you can find all versions of the php package djl997/blade-shortcuts. 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 blade-shortcuts

Blade Shortcuts

Latest Version on Packagist Total Downloads Build Status

Blade Shortcuts is a library of clever Blade Directives as listed below. The goal is to have less repetitive (base) logic in your Blade Views, overall shorter code and better readability.

Requirements

Blade Shortcuts requires PHP 8+ and Laravel 6+.

Installation

You can install the package via composer:

Usage

After installation, all directives should be usable immediately. If something goes wrong at first use or after an update, php artisan view:clear should clear the issue.

Contents

App Name

Boolean

Config

Dates

Automatically translate dates in the correct localized format (currently only EN, NL, DE, ES supported).

Other options:

If the time difference is more than 23 hours, ‘dateOrDiff’ will automatically show the date in a localized format instead of ‘x time ago’ or ‘in x time’. You can adjust this threshold in the config file: php artisan vendor:publish --tag=blade-shortcuts-config.

Try shortcuts for datetime, time, year, month or day (also in the correct localized format):

You even can add a custom date to datetime, time, year, month or day, for example:

Day of Week, Day of Month, Day of Year

In some cases you need the x day of week, month or year.

Or generate it based on a value:

Carbon Cascades

If you want to display a certain amount of time in human readable format, try out the new cascade directives. For example, convert 125 minutes to a readable format:

Change the time unit

If you set the time unit (2nd item in the array), the cascade will cascade max to the given unit. In the example below, we have 1530 minutes, divided into hours of 60 minutes:

CarbonInterval

The example above also means you can tweak the CarbonInterval. Suppose you have a project that requires 125 hours of work and you can allocate 30 hours per day for it. How many days will it take to complete the project? We use the @cascadeFromHours directive to calculate this value:

Filesize

nl2br

How to display input from a textarea in a read-only situation? Maybe you use {!! $comment !!} to get unexcaped data. In this way, you loose the XSS prevention, so maybe you sacrifice the newlines if the risk is too high. Now, that is no longer necessary: use the @nl2br directive.

Not Empty, inverse of @empty

Not set, inverse of @isset

Percentages

Simple Money

Helpers

Arrays

Find all available methods in Laravel Docs.

Fluent strings

Find all available methods in Laravel Docs.

Publish config

Changelog

Please see GitHubs releases section for more information on what has changed recently.

Contributing

Contributions are welcome.

License

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


All versions of blade-shortcuts with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
nesbot/carbon Version ^2.31|^3.0
laravel/framework Version ^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.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 djl997/blade-shortcuts contains the following files

Loading the files please wait ....