Comments (19)
What exactly are you injecting?
from laravel-markdown.
Have you registered the service provider correctly, and cleared the services.json file?
from laravel-markdown.
In my controller, I'm doing:
use Illuminate\Support\Facades\App;
use League\CommonMark\Converter;
And then:
public function __construct(Converter $converter)
{
$this->converter = $converter;
}
from laravel-markdown.
Is the service provider registered correctly?
from laravel-markdown.
In my providers I have:
GrahamCampbell\Markdown\MarkdownServiceProvider::class,
and in aliases:
'Markdown' => GrahamCampbell\Markdown\Facades\Markdown::class,
cache is cleared. Restarted php artisan serve
from laravel-markdown.
Does the facade work out of interest?
from laravel-markdown.
Doesn't look like it. Using your example:
use GrahamCampbell\Markdown\Facades\Markdown;
Markdown::convertToHtml('foo'); // <p>foo</p>
I get:
ReflectionException in /Users/jblyberg/git/dl_org-laravel/vendor/laravel/framework/src/Illuminate/Container/Container.php line 737:
Class markdown does not exist
from laravel-markdown.
Looks like you've not registered the service provider correctly then.
from laravel-markdown.
The test suite for this package proves that the facade does work.
from laravel-markdown.
GrahamCampbell\Markdown\MarkdownServiceProvider::class,
should be correct though, right?
from laravel-markdown.
Try 'GrahamCampbell\Markdown\MarkdownServiceProvider'
.
from laravel-markdown.
I will keep fiddling. Thanks for the help!
from laravel-markdown.
Are you sure you removed the services.json
file?
from laravel-markdown.
I just stopped the server, did php artisan config:cache .. cache:clear and that seemed to solve it. Not sure why it didn't work the first time I did it.
from laravel-markdown.
Probably opcache caching the config file. ;)
from laravel-markdown.
Restarting php-fpm probably flushed that cache.
from laravel-markdown.
In future, reloading the service rather than restarting should do it.
from laravel-markdown.
Yup! Cheers!
from laravel-markdown.
np ;)
from laravel-markdown.
Related Issues (20)
- Best practice for configuring extensions HOT 2
- How do I add classes? For example to an list? HOT 5
- Cannot add classes to the extension configuration HOT 1
- How to use localized Markdown files in Laravel HOT 1
- Laravel 8 installation problem HOT 10
- Markdown output does not print well if the text continues without any space. HOT 3
- Running the composer command throws an error HOT 11
- Is the Service Provider writing to file? HOT 2
- Your requirements could not be resolved to an installable set of packages. Installation failed, reverting ./composer.json to its original content. HOT 1
- Laravel 9 Support? HOT 5
- Update README or facade method HOT 1
- TableOfContentsExtension No data exists at the given path
- adding id to headers HOT 2
- Syntax highlight? HOT 2
- Adding extension in v14 / commonmark v2 HOT 3
- Livewire support? HOT 2
- Unexpected item 'commonmark'. HOT 2
- Add Laravel 10 support HOT 9
- Laravel 11 Support HOT 4
- using custom slug_normalizer
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-markdown.