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.
added providers array :
/* * shortcodes providers */ webwizo\shortcodes\shortcodesserviceprovider::class, app\providers\shortcodesserviceprovider::class,
added aliases:
'shortcode' => webwizo\shortcodes\facades\shortcode::class,
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
Post a Comment