2017 © Pedro Peláez
 

library laravel-disqus

Disqus integration for Laravel

image

d-te/laravel-disqus

Disqus integration for Laravel

  • Thursday, January 15, 2015
  • by d-te
  • Repository
  • 1 Watchers
  • 1 Stars
  • 39 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

laravel-disqus

Disqus comments for laravel 4, (*1)

Installation

Add the package in your composer.json file and run composer update., (*2)

{
    "require": {
        "d-te/laravel-discus": "dev-master"
    }
}

Registering the Package

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',
)

Configuration

Create configuration file for package using artisan command, (*5)

$ php artisan config:publish d-te/laravel-disqus

Usage

Basic usage

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() }}

Additional disqus configuration variables

There are some disqus configuration variables:, (*9)

  • disqus_identifier
  • disqus_title
  • disqus_url
  • 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',
            )

The Versions

15/01 2015

dev-master

9999999-dev

Disqus integration for Laravel

  Sources   Download

MIT

The Requires

 

by Denys Temchenko

laravel disqus comments