shawnsandy/extras

Laravel descriptions


README

Latest Version on Packagist Software License Total Downloads

Extras is small Laravel package that contains some basic components (functions) that are usually required for most apps but are not necessarily included in the base Laravel install.

  • Social Login
  • Messaging (mail)
  • Maps (google)
  • Glide for Dynamic images
  • Components (login, register, alerts, contact...)

Coming Soon

  • Toastr alerts
  • Notifications
  • Push notifications
  • Backups

Read the docs

Install

Via Composer

$ composer require shawnsandy/extras dev-master

Laravel 5.4 and below

$ composer require shawnsandy/extras

Required packages

composer require zondicons/blade-bridge thujohn/twitter spatie/laravel-collection-macros rap2hpoutre/laravel-log-viewer plank/laravel-mediable mews/purifier league/glide-laravel laravelcollective/remote laravelcollective/html laravel/socialite laracasts/utilities laracasts/generators laracasts/flash illuminate/support illuminate/http illuminate/contracts greggilbert/recaptcha doctrine/dbal brotzka/laravel-dotenv-editor barryvdh/laravel-ide-helper albertcht/invisible-recaptcha abraham/twitteroauth

Open config\app.php and add the following

  • Providers array

The Laravel discover package feature or the Extras service provider auto loads the required providers / Facade for the following package in one go.

  • 'davestewart\sketchpad\SketchpadServiceProvider'
  • 'Collective\Remote\RemoteServiceProvider'
  • 'Collective\Html\HtmlServiceProvider'
  • 'Mews\Purifier\PurifierServiceProvider'
  • 'Thujohn\Twitter\TwitterServiceProvider'
  • 'Brotzka\DotenvEditor\DotenvEditorServiceProvider'
  • 'Laravel\Socialite\SocialiteServiceProvider'
  • ...
'providers' => [
ShawnSandy\Extras\ExtrasServiceProvider::class,
]

or load them on you lonesome :(

'providers' => [

    ShawnSandy\Extras\ExtrasProvider::class,
    // --- packages -----
    Thujohn\Twitter\TwitterServiceProvider::class,
    Collective\Html\HtmlServiceProvider::class,
    davestewart\sketchpad\SketchpadServiceProvider'
    Collective\Remote\RemoteServiceProvider'
    Collective\Html\HtmlServiceProvider'
    Mews\Purifier\PurifierServiceProvider'
    Thujohn\Twitter\TwitterServiceProvider'
    Brotzka\DotenvEditor\DotenvEditorServiceProvider'
    Laravel\Socialite\SocialiteServiceProvider'

    // ###
]
  • Aliases array
    'aliases' => [

    'Form' => Collective\Html\FormFacade::class,
    'Html' => Collective\Html\HtmlFacade::class,
    'Extras' => \ShawnSandy\Extras\ExtrasFacade::class,
    'Gmap' => \ShawnSandy\Extras\Apps\Maps\MapsFacade::class,
    "Twitter" => \Thujohn\Twitter\Facades\Twitter::class,

   // ###
    ]

Routes

Route::group(['prefix' => "extras"], function () {
    Extras::routes();
});

Usage

Custom Error Pages

  if (env("APP_DEBUG") == false && env("APP_ENV") === "production"):

            return app(SystemErrors::class)->renderErrors($request, $exception);

  endif;

GMAPS (google maps) component

{{ Html::extrasMap(
    "1600 Pennsylvania Ave NW, Washington, DC 20500", //address
    ["height" => '680px'], // inline style
    ['zoom' => 17, 'scroll' => 'true' ] // options map-zoom / scroll
    )
    }}

Socialite SignIn

 {{ Html::networkLogin(

     "Connect Via Social Media",  // title
     ["facebook", "twitter"] // providers (facebook, twitter, linkedin, github)

     ) }}

Laravel login component displays a login form

{{ Html::extrasLogin("Login Title Here") }}

Dynamic Images with Glide

Output the full path to your image <img src="path/to/image?w=400 ?>

// from public/img
{{ Html::extrasImg("bg/01.jpg?w=500", ["class" => "img-circle", "alt" => "Glide image"]) }}

// from your storage directory
{{ Html::extrasImg("photo1.jpg?w=500", ["class" => "img-responsive", "alt" => "Glide image"], "/extras/img/") }}

SVG ICONS_

Material Icons

 {{ Html::materialIcon("material-add-circle") }

Entypo Icons

 {{ Html::entypoIcon("entypo-adjust") }}

Change log

Please see CHANGELOG for more information what has changed recently.

Testing

// $ composer test

Contributing

Please see CONTRIBUTING and CONDUCT for details.

Security

If you discover any security related issues, please email shawnsandy04@gmail.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.