PHP Classes
elePHPant
Icontem

File: src/JaxonServiceProvider.php

Recommend this page to a friend!
  Classes of Thierry Feuzeu  >  Jaxon for Laravel  >  src/JaxonServiceProvider.php  >  Download  
File: src/JaxonServiceProvider.php
Role: Class source
Content type: text/plain
Description: Class source
Class: Jaxon for Laravel
Laravel plugin to call PHP classes from with AJAX
Author: By
Last change: Removed code which is duplicated in the jaxon-framework package.
Implemented the abstract httpResponse() method, defined in the
PluginTrait trait.
Removed the Response class.
Date: 3 years ago
Size: 1,280 bytes
 

 

Contents

Class file image Download
<?php

namespace Jaxon\Laravel;

use
Illuminate\Support\ServiceProvider;

class
JaxonServiceProvider extends ServiceProvider
{
   
/**
     * Indicates if loading of the provider is deferred.
     *
     * @var bool
     */
   
protected $defer = false;

   
/**
     * Bootstrap the application events.
     *
     * @return void
     */
   
public function boot()
    {
       
// Config source and destination files
       
$configSrcFile = __DIR__ . '/../config/config.php';
       
$configDstFile = config_path('jaxon.php');
       
// Publish assets and config
       
$this->publishes([
           
$configSrcFile => $configDstFile,
        ],
'config');
       
// Load package routes
       
if(!$this->app->routesAreCached())
        {
            require(
__DIR__ . '/Http/routes.php');
        }
    }

   
/**
     * Register the service provider.
     *
     * @return void
     */
   
public function register()
    {
       
// Register the Jaxon singleton
       
$this->app->singleton('jaxon', function ($app)
        {
            return new
Jaxon();
        });
    }

   
/**
     * Get the services provided by the provider.
     *
     * @return array
     */
   
public function provides()
    {
        return array(
           
'jaxon'
       
);
    }
}