This repository has been archived by the owner on Jan 13, 2024. It is now read-only.
/
CRUDBoosterServiceProvider.php
85 lines (64 loc) · 2.93 KB
/
CRUDBoosterServiceProvider.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<?php
namespace crocodicstudio\crudbooster;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\ServiceProvider;
class CRUDBoosterServiceProvider extends ServiceProvider
{
/**
* Bootstrap the application services.
*
* @return void
*/
public function boot()
{
$this->loadViewsFrom(__DIR__.'/views', 'crudbooster');
$this->publishes([ __DIR__.'/configs/crudbooster.php' => config_path('crudbooster.php')],'cb_config');
$this->publishes([__DIR__.'/localization' => resource_path('lang')], 'cb_localization');
$this->publishes([__DIR__.'/assets' => public_path('vendor/crudbooster')], 'cb_public');
$this->publishes([__DIR__.'/database' => base_path('database')],'cb_migration');
/* Integrate LFM to CRUDBooster */
$this->publishes([
__DIR__.'/laravel-filemanager' => base_path('vendor/unisharp/laravel-filemanager'),
],'cb_lfm');
$this->publishes([
__DIR__.'/laravel-filemanager/public' => public_path('vendor/laravel-filemanager'),
],'cb_lfm');
$this->publishes([
__DIR__.'/laravel-filemanager/src/config/lfm.php' => config_path('lfm.php'),
],'cb_lfm_config');
$this->publishes([
__DIR__.'/laravel-filemanager/src/views/script.blade.php' => resource_path('views/vendor/laravel-filemanager/script.blade.php'),
],'cb_lfm_config');
$this->publishes([
__DIR__.'/userfiles/views/vendor/crudbooster/type_components/readme.txt' => resource_path('views/vendor/crudbooster/type_components/readme.txt'),
],'cb_type_components');
if(!file_exists(app_path('Http/Controllers/CBHook.php'))) {
$this->publishes([__DIR__.'/userfiles/controllers/CBHook.php' => app_path('Http/Controllers/CBHook.php')],'CBHook');
}
if(!file_exists(app_path('Http/Controllers/AdminCmsUsersController.php'))) {
$this->publishes([__DIR__.'/userfiles/controllers/AdminCmsUsersController.php' => app_path('Http/Controllers/AdminCmsUsersController.php')],'AdminCmsUsersController');
}
require __DIR__.'/validations/validation.php';
require __DIR__.'/routes.php';
$this->app->booted(function () {
$schedule = $this->app->make(\Illuminate\Console\Scheduling\Schedule::class);
$schedule->command('mailqueues')->cron("* * * * * *");
});
}
/**
* Register the application services.
*
* @return void
*/
public function register()
{
require __DIR__.'/helpers/Helper.php';
$this->app['crudbooster'] = $this->app->share(function ()
{
return true;
});
$this->commands([
commands\Mailqueues::class
]);
}
}