php - Laravel webwizo shortcodes package Shortcodes class not found -


i started using laravel i'm beginner, , right i'm working on small project requires me use shortcodes(like ones in wordpress). searched little bit , found package:

https://packagist.org/packages/webwizo/laravel-shortcodes

i ran installation , usage way it's written error : class 'app\providers\shortcode' not found in provider have make using laravel make:provider command specified in package instructions, below exact usage , install code.

  1. added providers array :

     /*  * shortcodes providers  */ webwizo\shortcodes\shortcodesserviceprovider::class, app\providers\shortcodesserviceprovider::class, 
  2. added aliases:

    'shortcode' => webwizo\shortcodes\facades\shortcode::class,

  3. this content of shortcodesserviceprovider in app/providers:

    namespace app\providers;

    use illuminate\support\serviceprovider; use app\shortcodes\jobsform;

    class shortcodesserviceprovider extends serviceprovider { /**

    • bootstrap application services. *
    • @return void */ public function boot() { // }

    /**

    • register application services. *
    • @return void */ public function register() { shortcode::register('jobs', jobsform::class); } }

i use laravel 5.4 might issue.

the thing class exists, gives shortcodes class not found error because think searches in app/providers/shortcodesserviceprovider file, , it's not there it's in vendor file.

is there i'm missing i've checked , double checked, can't seem thing work.

it shoould work considering has alias defined right ?

i used in view this:

return view('quarx-frontend::pages.' . $page->template)->with('page', $page)->withshortcodes(); 

thanks taking time read appreciated.

if need more info i'll glad supply it.

p.s. sorry bad english ,not native speaker :p

it searches shortcode in app\providers; namespace , not in root namespace facade defined.

you can fix in app\providers\shortcodesserviceprovider.php either doing:

<?php  namespace app\providers;  use illuminate\support\serviceprovider;  use app\shortcodes\jobsform; use shortcode;  class shortcodesserviceprovider extends serviceprovider { 

or use \shortcode

/**  * register application services.  *  * @return void  */ public function register() {     \shortcode::register('jobs', jobsform::class); } 

i recommend first option.


Comments

Popular posts from this blog

php - Permission denied. Laravel linux server -

google bigquery - Delta between query execution time and Java query call to finish -

python - Pandas two dataframes multiplication? -