dev-master
9999999-devDisqus integration for Laravel
MIT
The Requires
- php >=5.3.0
- illuminate/support ~4
- illuminate/config ~4
by Denys Temchenko
laravel disqus comments
Wallogit.com
2017 © Pedro Peláez
Disqus integration for Laravel
Disqus comments for laravel 4, (*1)
Add the package in your composer.json file and run composer update., (*2)
{
"require": {
"d-te/laravel-discus": "dev-master"
}
}
Register the service provider within the providers array found in app/config/app.php:, (*3)
'providers' => array(
// ...
'Dte\Disqus\DisqusServiceProvider'
)
Add an alias within the aliases array found in app/config/app.php:, (*4)
'aliases' => array(
// ...
'Disqus' => 'Dte\Disqus\Facades\Disqus',
)
Create configuration file for package using artisan command, (*5)
$ php artisan config:publish d-te/laravel-disqus
Add 'disqus_shortname' to app/config/packages/d-te/laravel-disqus/config.php., (*6)
You can find your disqus shortname afer signing up and visiting https://disqus.com/admin/settings/, (*7)
In your template add :, (*8)
{{ \Disqus::comments() }}
There are some disqus configuration variables:, (*9)
disqus_category_id, (*10)
Example of usage:, (*11)
```php {{ \Disqus::comments( array( 'disqus_identifier' => '/december-2010/the-best-day-of-my-life/', 'disqus_title' => 'Some title', 'disqus_url' => 'http://example.com/helloworld.html', 'disqus_category_id' => 123456 ) ) }}, (*12)
### Multi-lingual support There are two ways how to change disqus locales: 1. To switch on auto selecting disqus language based on Laravel app locale: in ```app/config/packages/d-te/laravel-disqus/config.php``` set ```php 'auto_set_language' => true, ``` 2. Set locale manually in template: ```php {{ \Disqus::comments(array('language' => 'de')) }}
Sometimes discus locale could not corresponde to your app locale.
To convert your app locale to discus locale just add supported locales to config app/config/packages/d-te/laravel-disqus/config.php example:, (*13)
'discus_languages' => array(
'ua' => 'uk',
'fr' => 'fr_CA',
)
Disqus integration for Laravel
MIT
laravel disqus comments