PHP code example of vis / subscribe_manager_l5

1. Go to this page and download the library: Download vis/subscribe_manager_l5 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/ */

    

vis / subscribe_manager_l5 example snippets


    Vis\SubscribeManager\SubscribeManagerServiceProvider::class,

    @

array(
    'title' => 'Подписки',
    'icon'  => 'group',
    'check' => function() {
        return Sentinel::hasAccess('admin.vis_subscribers.view');
    },
    'submenu' => array(
        array(
            'title' => 'Подписчики',
            'link'  => '/vis_subscribers', 
            'check' => function() {
                return Sentinel::hasAccess('admin.vis_subscribers.view');
            }
        ),
        array(
            'title' => 'Типы подписок',
            'link'  => '/vis_subscribe_entities',
            'check' => function() {
                return Sentinel::hasAccess('admin.vis_subscribe_entities.view');
            }
        ),
    )
),

    'Подписчики' => array(
        'admin.vis_subscribers.view'   => 'Просмотр',
        'admin.vis_subscribers.create' => 'Создание',
        'admin.vis_subscribers.update' => 'Редактирование',
        'admin.vis_subscribers.delete' => 'Удаление',
    ),
    'Типы подписок' => array(
        'admin.vis_subscribe_entities.view'   => 'Просмотр',
        'admin.vis_subscribe_entities.create' => 'Создание',
        'admin.vis_subscribe_entities.update' => 'Редактирование',
        'admin.vis_subscribe_entities.delete' => 'Удаление',
    ),

    View::composer('partials.subscribe', function ($view) {
        $subscribeEntities = Cache::tags('vis_subscribe_entities')->rememberForever('vis_subscribe_entities', function() {
            return Vis\SubscribeManager\SubscribeEntity::active()->get();
        });
    
        $view->with('subscribeEntities', $subscribeEntities);
    });

    use Vis\SubscribeManager\Subscriber;

   $subscribers = Subscriber::filterEntitySlug($entitySlug)->filterLang($lang)->active->get();

    namespace Vis\SubscribeManager;
    
    use Illuminate\Database\Eloquent\Model;
    
    class SubscribeEntity extends Model
    {
        use \Vis\Builder\Helpers\Traits\TranslateTrait;
       
        protected $table = 'vis_subscribe_entities';
    }

	protected $table = 'vis_subscribe_entities';

    public function subscribers()

    public function scopeFilterSlug($query, $slug)

    public function scopeActive($query)

    
    namespace Vis\SubscribeManager;

    use Illuminate\Database\Eloquent\Model;
    
    class Subscriber extends Model
    {   
       protected $table = 'vis_subscribers';
    }

	protected $table = 'vis_subscribers';

    public function entities()

    public function scopeFilterEntitySlug($query, $entitySlug)

    public function scopeActive($query)

    public function scopeFilterLang($query, $lang)

    public function scopeFilterEmail($query, $email)
json
   php artisan migrate --path=vendor/vis/subscribe_manager_l5/src/Migrations
json
    php artisan vendor:publish --provider="Vis\SubscribeManager\SubscribeManagerServiceProvider" --force
js
SubscribeManager.setForms(['quick_subscribe']);