Download the PHP package kfoobar/laravel-shortcode without Composer

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

Shortcodes for Laravel

Efficient and versatile shortcode manager tailored for Laravel versions 8, 9, and 10.

Installation

Install the package using Composer:

Settings

Publish the configuration file to customize settings:

Usage

Adding Custom Shortcodes

Easily define custom shortcodes like this:

Configuring Default Shortcodes

Use the shortcodes array in the config file to set default shortcodes:

Shortcode Formatting

Shortcode keys are automatically transformed: they are converted to uppercase and wrapped with a character defined in the wrapper setting of your config file. The default wrapper character is %.

Rendering Shortcodes

btain parsed content with various options:

Within Blade templates, use the @shortcode directive:

Note: The Blade directive employs the render() method.

Integrating with Models

Utilize the HasShortcode trait for automatic shortcode parsing:

Automatic shortcode parsing is turned off by default to avoid conflicts with writing operations. This precaution ensures that routine create, update and delete actions proceed without unintentional interference from the shortcode processing mechanism.

Enable With Code

Enable With Model Setting

Enable auto-parsing by default:

Enable With Middleware

Enable auto-parsing for specific routes:

The middleware automatically excludes non-read requests, AJAX requests, and Laravel Nova requests.

Predefined Shortcodes

These are the predefined shortcodes:

Shortcode Value
%YEAR% 2024
%MONTH% January
%WEEK% 3
%DAY% Monday
%DATE% 2024-01-01
%TIME% 12:00
%DOMAIN% project.test
%APP-NAME% Laravel
%APP-URL% http://project.test

Contributing

Your contributions are highly appreciated.

License

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


All versions of laravel-shortcode with dependencies

PHP Build Version
Package Version
Requires php Version ^8
ext-json Version *
illuminate/config Version ^8.0||^9.0||^10.0
illuminate/database Version ^8.0||^9.0||^10.0
illuminate/support Version ^8.0||^9.0||^10.0
illuminate/view Version ^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 kfoobar/laravel-shortcode contains the following files

Loading the files please wait ....