Giter Club home page Giter Club logo

laravel-https's Introduction

laravel-https

Generate HTTPS-links and redirect all requests to HTTPS. Also works with load balancing, AWS, Heroku and other services

Installation

Add to your project using Composer
composer require ecrmnn/laravel-https
Add under providers in config/app.php
\Ecrmnn\LaravelHttps\Providers\ServiceProvider::class,
Add under $middleware in app/Http/Kernel.php
\Ecrmnn\LaravelHttps\Http\Middleware\ForceHttps::class,

Usage

Set environment variable

HTTPS will only be forced when env('HTTPS') is set to true

HTTPS=true

What is this?

Generate HTTPS-links automagically

LaravelHTTPS forces the URL scheme in Laravel to use the HTTPS prefix for all links generated using url() and route(). That mean that all your links can be converted to use HTTPS just by installing LaravelHTTPS

Force redirect HTTP to HTTPS

With the middleware included; ForceHttps, you can simply specify that as a global middleware and all requests will be redirected correctly when accessing a non-HTTPS URL.

Requirements

  • Laravel 5.0 +
  • PHP 7 +

License

MIT ยฉ Daniel Eckermann

laravel-https's People

Contributors

ecrmnn avatar guiwoda avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

laravel-https's Issues

Query Parameters

Hi, it might be useful to allow query parameters to be passed on the redirect. Something like...

$query = explode('?', $request->fullUrl());
if (isset($query[1])) {
    return redirect()->secure($request->path().'?'.$query[1]);
}
return redirect()->secure($request->path());

Not working on Laravel 5.3

Hi thanks for this library.
I think you should change Laravel requirement to 5.4+ ,because method Url::forceScheme doesn't exist below L 5.4

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.