1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Edofre\Fullcalendar; |
4
|
|
|
|
5
|
|
|
use Illuminate\Support\ServiceProvider; |
6
|
|
|
|
7
|
|
|
/** |
8
|
|
|
* Class FullcalendarServiceProvider |
9
|
|
|
* @package Edofre\Fullcalendar |
10
|
|
|
*/ |
11
|
|
|
class FullcalendarServiceProvider extends ServiceProvider |
12
|
|
|
{ |
13
|
|
|
/** Identifier for the service */ |
14
|
|
|
const IDENTIFIER = 'laravel-fullcalendar'; |
15
|
|
|
|
16
|
|
|
/** |
17
|
|
|
* Register bindings in the container. |
18
|
|
|
* |
19
|
|
|
* @return void |
20
|
|
|
*/ |
21
|
|
|
public function register() |
22
|
|
|
{ |
23
|
|
|
$this->app->bind(self::IDENTIFIER, function ($app) { |
24
|
|
|
return $app->make(Fullcalendar::class); |
25
|
|
|
}); |
26
|
|
|
} |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* Bootstrap any application services. |
30
|
|
|
* |
31
|
|
|
* @return void |
32
|
|
|
*/ |
33
|
|
|
public function boot() |
34
|
|
|
{ |
35
|
|
|
// specify from where we want to load the views |
36
|
|
|
$this->loadViewsFrom(__DIR__ . '/views/', 'fullcalendar'); |
37
|
|
|
|
38
|
|
|
// publish the config file |
39
|
|
|
$this->publishes([ |
40
|
|
|
__DIR__ . '/config/fullcalendar.php' => config_path('fullcalendar.php'), |
41
|
|
|
], 'config'); |
42
|
|
|
|
43
|
|
|
// publish all the required files to generate the calendar |
44
|
|
|
$this->publishes([ |
45
|
|
|
// fullcalendar library |
46
|
|
|
__DIR__ . '/../../../npm-asset/fullcalendar/dist/fullcalendar.css' => public_path('css/fullcalendar.css'), |
47
|
|
|
__DIR__ . '/../../../npm-asset/fullcalendar/dist/fullcalendar.print.css' => public_path('css/fullcalendar.print.css'), |
48
|
|
|
__DIR__ . '/../../../npm-asset/fullcalendar/dist/fullcalendar.js' => public_path('js/fullcalendar.js'), |
49
|
|
|
__DIR__ . '/../../../npm-asset/fullcalendar/dist/locale-all.js' => public_path('js/locale-all.js'), |
50
|
|
|
__DIR__ . '/../../../npm-asset/fullcalendar/dist/gcal.js' => public_path('js/gcal.js'), |
51
|
|
|
// moment library |
52
|
|
|
__DIR__ . '/../../../npm-asset/moment/moment.js' => public_path('js/moment.js'), |
53
|
|
|
], 'fullcalendar'); |
54
|
|
|
} |
55
|
|
|
|
56
|
|
|
/** |
57
|
|
|
* @return array |
58
|
|
|
*/ |
59
|
|
|
public function provides() |
60
|
|
|
{ |
61
|
|
|
return [self::IDENTIFIER]; |
62
|
|
|
} |
63
|
|
|
} |