dev-master
9999999-devLaravel Providers and DB Migration for App4Less APPs
MIT
The Requires
by Pablo Martin
1.0.0
1.0.0.0Laravel Providers and DB Migration for App4Less APPs
MIT
The Requires
by Pablo Martin
Laravel Providers and DB Migration for App4Less APPs
This package makes it easy to send app4less/reskyt push notifications with Laravel., (*1)
You can install the package via composer:, (*2)
``` bash composer require webimpacto/laravel-app4less, (*3)
First you must install the service provider (skip for Laravel>=5.5): ``` php // config/app.php 'providers' => [ ... \Webimpacto\LaravelApp4Less\Providers\App4LessServiceProvider::class, ],
Launch artisan migrate, to create the Database Tables. ``` bash php artisan migrate, (*4)
Add the \Webimpacto\LaravelApp4Less\Middleware\App4lessSaveToken middleware to web group in the Http Kernel, this will be store the tokens in App4less table. ``` php // app/Http/Kernel.php protected $middlewareGroups = [ ... \Webimpacto\LaravelApp4Less\Middleware\App4lessSaveToken::class ],
Set .env variables for you App user and App API KEY if you want to send Push Notifications, (*5)
``` php APP4LESS_USER=userapp APP4LESS_APIKEY=user_api_key, (*6)
## Usage Now you can use the channel in your via() method inside the notification as well as send a app4less push notification: ``` php use Illuminate\Notifications\Notification; use Webimpacto\LaravelApp4Less\Channel\App4LessPushChannel; use Webimpacto\LaravelApp4Less\Channel\App4LessPushMessage; class AccountApproved extends Notification { public function via($notifiable) { return [App4LessPushChannel::class]; } public function toApp4LessPush($notifiable) { $user = User::find($this->friend->user_from); return (new App4LessPushMessage) ->title('Notification Title') ->url('Notification URL') ->utm('UTM-Analytics'); } }
Laravel Providers and DB Migration for App4Less APPs
MIT
Laravel Providers and DB Migration for App4Less APPs
MIT