webwizo / laravel-shortcodes

Wordpress like shortcodes for Laravel 4.2, 5.x, 6.x, 7.x, 8.x, 9.x and 10.x

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

change document to register new shortcode

vahidalvandi opened this issue · comments

hi , instead create new serviceProvider register shortcodes in AppServiceProvider.php


<?php

namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use App\Shortcodes\BoldShortcode;
use Shortcode;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        //
    }

    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        Shortcode::register('b', BoldShortcode::class);
    }
}

Yes agreed, we have lots of ways in Laravel to do a single job. But instead of putting everything in AppServiceProvider, we create a new class so that it could handle only shortcodes specific job.

Yes agreed, we have lots of ways in Laravel to do a single job. But instead of putting everything in AppServiceProvider, we create a new class so that it could handle only shortcodes specific job.

No need new Provider , when we have app service provider

Sure, I will update it.

Thank you, dear!

Thank you