PHP code example of webimpacto / laravel-app4less

1. Go to this page and download the library: Download webimpacto/laravel-app4less library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

webimpacto / laravel-app4less example snippets

 php
// config/app.php
'providers' => [
    ...
    \Webimpacto\LaravelApp4Less\Providers\App4LessServiceProvider::class,

],
 bash
php artisan migrate
 php
// app/Http/Kernel.php
protected $middlewareGroups = [
    ...
    \Webimpacto\LaravelApp4Less\Middleware\App4lessSaveToken::class

],
 php
APP4LESS_USER=userapp
APP4LESS_APIKEY=user_api_key
 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');
    }
}