Featured Products
- Home
- PHP Scripts
- Laravel Shortcode for Developers
Laravel Shortcode for Developers
By : design-craze Published on Wednesday, July 26, 2017,11:59:15 in PHP Scripts
There is nothing too much to say about this. This is a script for laravel developers that let the developer make functions as shortcode and use them in either controller of view. Static of database based dynamic codes can be developed inside the shortcode. There is no special coding skill you need. Just use normal laravel coding style according to the documentation and 2 sample shortcodes and you are ready to go. In a single word- Easy to use and it is Master to make your project easy
âfilesâ: [âapp/Helper/helpers.phpâ],
something like this:
âautoloadâ: {
âclassmapâ: [
âdatabaseâ
],
âfilesâ: [âapp/Helper/helpers.phpâ],
âpsr-4â: {
âApp\\â: âapp/â,
},
},
{!! generate_shortcode($content) !!}
$this->add_shortcode(âsample1â, function($atts, $content = null){
extract($this->shortcode_atts(array(
ânameâ =>âworldâ
),
$atts));
return âHello â . $name .â!â;
});
extract($this->shortcode_atts(array(
âcolâ =>âcol-md-12â
),
$atts));
return â â.$this->do_shortcode($content).â â;
});
App/Http/Controllers/Shortcode/Shortcodes.php
in this file all shortcodes will go under function __construct(){}