Download the PHP package alfred-nutile-inc/notifications without Composer

On this page you can find all versions of the php package alfred-nutile-inc/notifications. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package notifications

Notification API

video here

Install

Composer

composer require alfred-nutile-inc/notifications:dev-master

Add the provider

Publish Migrations

Publish Assets

Then use as needed and seen in video

I also have a main angular config file that sets these constants

#config.js
    function constants() {
        return {
            'pusher_public_key': window.pusher_public_key,
            'sauce_key': window.sauce_key,
            'sauce_user': window.sauce_user,
            'profile': window.profile,
            'js_root': '/assets/js/',
            'debug': window.debug,
            'messages': window.messages
        };
    }

Add if you want the public notifications javascript to your angular area and include the js files into your app.

Then update your nav so people can get to the main ui and the drop down

#Main ui nav
  • Notifications
  • And load it in the main angular controller so on page load we listen for pusher notifications
    

    controller.js

    /**
     * @NOTE Noty is better than toaster for this one thing
     */
    function MainCtrl($window, PusherService, Noty, ProjectsService, localStorageService, ENV) {
    
        var vm = this;
        vm.localStorageService = localStorageService;
        vm.Noty = Noty;
        vm.ENV = ENV;
        vm.messages = [];
        vm.PusherService = PusherService;
        vm.ProjectsService = ProjectsService;
        vm.loadProjects = loadProjects;
        vm.setOriginalMessages = setOriginalMessages;
        vm.maintenanceNotification = maintenanceNotification;
        vm.noticeMessage = noticeMessage;
        vm.ringBell = ringBell;
    
        vm.profile = {};
        vm.projects = [];
        vm.activate = activate;
        vm.activate();
    
        ///////
    
        activate();
    
        function activate() {
            vm.profile = $window.profile;
            vm.PusherService.setPusher('maintenance', 'behat', vm.maintenanceNotification);
            vm.loadProjects();
            if(vm.localStorageService.isSupported) {
                console.log('supported');
                console.log(vm.localStorageService.keys());
            }
            vm.setOriginalMessages();
            vm.PusherService.setPusher('notifications', ENV.profile.id, vm.noticeMessage);
        }
    
        function setOriginalMessages()
        {
            angular.forEach(vm.ENV.messages, function(v,i){
                vm.messages.push( { "id": v.id, "message": v.notification_message.message } );
            });
        }
    
        function noticeMessage(data)
        {
    
            if(!angular.isUndefined(data))
            {
                vm.messages.push(data[0]);
                vm.toaster.pop("info", "Message", data[0].message, 5000, 'trustedHtml');
                vm.ringBell();
                $rootScope.$apply();
            }
        }
    
        function ringBell()
        {
            var audio = $('#notificationAudio');
            if (audio.length == 0) {
                $('<audio id="notificationAudio"><source src="/js/lib/notifications/notify.mp3" type="audio/mpeg"></audio>').appendTo('body');
                audio = $('#notificationAudio');
            }
            audio[0].play();
        }
    
        function loadProjects()
        {
            if(vm.projects.length < 1)
            {
                vm.ProjectsService.index().then(function(results) {
                    vm.projects = results.data;
                });
            }
        }
    
        function maintenanceNotification(data)
        {
            if(!angular.isUndefined(data))
            {
                vm.Noty(data, "information", true, false, false);
            }
        }
    
    }
    
    /**
     *
     * Pass all functions into module
     */
    angular
        .module('app')
        .controller('MainCtrl ', MainCtrl);

    ~~


    All versions of notifications with dependencies

    PHP Build Version
    Package Version
    Requires php Version >=5.4.0
    ramsey/uuid Version ^3.4
    vlucas/phpdotenv Version *
    Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

    The package alfred-nutile-inc/notifications contains the following files

    Loading the files please wait ....