2017 © Pedro Peláez
 

library sportily-laravel-support

A library of support classes for creating Sportily sites with Laravel.

image

sportily/sportily-laravel-support

A library of support classes for creating Sportily sites with Laravel.

  • Friday, December 8, 2017
  • by craigsssmith
  • Repository
  • 0 Watchers
  • 0 Stars
  • 110 Installations
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

Sportily Support library for Laravel

Installation

Composer is the recommended way to install this package. Add the following line to your composer.json file:, (*1)

"sportily/sportily-laravel-support": "dev-master@dev"

Then run composer update to get the package., (*2)

Once composer has installed the package this the following line to the providers array, located in your config/app.php file:, (*3)

Sportily\Support\SupportServiceProvider::class,

Next, run php artisan vendor:publish to publish this package's configuration., (*4)

Middleware

Forcing HTTPS in certain environments

We recommended all production environments run over a https connection, to do so register the middleware in Kernel.php under 'web', (*5)

'web' => [
    \App\Http\Middleware\EncryptCookies::class,
    ...
    ...
    \Sportily\Support\Middleware\ForceHttps::class,
],

Add to sportily-support.php the environments to secure., (*6)

    'secure-envs' => ['prod', 'production']

Obtaining an organisation ID

To make use of the organisation id in Controller methods, it can be plucked out of the Request like in the example below., (*7)

public function getIndex(Request $request) {
    $posts = $this->posts->all([
        'organisation_id' => $request->organisation['id'],
        'status' => 'published'
    ]);
    return view('posts', ['posts' => $posts]);
}

Fixed ID

URL Prefix based ID

Host based ID

Register the HostBasedOrganisationId in the middleware groups require-dev, (*8)

'sportily.private' => [
    \Sportily\OAuth\Middleware\OAuthMiddlewarePrivate::class,
    \Sportily\Support\Middleware\HostBasedOrganisationId::class,
    \Sportily\Support\Middleware\AugmentRequestWithOrganisation::class,
],

'sportily.public' => [
    \Sportily\OAuth\Middleware\OAuthMiddlewarePublic::class,
    \Sportily\Support\Middleware\HostBasedOrganisationId::class,
    \Sportily\Support\Middleware\AugmentRequestWithOrganisation::class,
]

The Versions

08/12 2017

dev-master

9999999-dev https://bitbucket.org/sportily/sportily-laravel-support

A library of support classes for creating Sportily sites with Laravel.

  Sources   Download

MIT

The Requires

 

laravel oauth sportily

25/09 2017

1.0.5

1.0.5.0 https://bitbucket.org/sportily/sportily-laravel-support

A library of support classes for creating Sportily sites with Laravel.

  Sources   Download

MIT

The Requires

 

laravel oauth sportily

25/10 2016

1.0.3

1.0.3.0

A library of support classes for creating Sportily sites with Laravel.

  Sources   Download

MIT

The Requires

 

laravel oauth sportily

25/10 2016

1.0.4

1.0.4.0

A library of support classes for creating Sportily sites with Laravel.

  Sources   Download

MIT

The Requires

 

laravel oauth sportily

25/10 2016

1.0.2

1.0.2.0

A library of support classes for creating Sportily sites with Laravel.

  Sources   Download

MIT

The Requires

 

laravel oauth sportily

24/10 2016

1.0.1

1.0.1.0

A library of support classes for creating Sportily sites with Laravel.

  Sources   Download

MIT

The Requires

 

laravel oauth sportily

23/10 2016

1.0.0

1.0.0.0

A library of support classes for creating Sportily sites with Laravel.

  Sources   Download

MIT

The Requires

 

laravel oauth sportily