|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace CleaniqueCoders\OpenPayroll; |
|
4
|
|
|
|
|
5
|
|
|
use Illuminate\Support\ServiceProvider; |
|
6
|
|
|
|
|
7
|
|
|
class OpenPayrollServiceProvider extends ServiceProvider |
|
8
|
|
|
{ |
|
9
|
|
|
/** |
|
10
|
|
|
* Bootstrap the application services. |
|
11
|
|
|
*/ |
|
12
|
|
|
public function boot() |
|
13
|
|
|
{ |
|
14
|
|
|
/* |
|
15
|
|
|
* Configuration |
|
16
|
|
|
*/ |
|
17
|
|
|
$this->publishes([ |
|
18
|
|
|
__DIR__ . '/../config/open-payroll.php' => config_path('open-payroll.php'), |
|
19
|
|
|
], 'open-payroll-config'); |
|
20
|
|
|
|
|
21
|
|
|
/* |
|
22
|
|
|
* Database - Migrations, Factories and Seeders |
|
23
|
|
|
*/ |
|
24
|
|
|
if (! class_exists('CreatePayrollTable')) { |
|
25
|
|
|
$this->publishes([ |
|
26
|
|
|
__DIR__ . '/../database/factories/' => database_path('factories/'), |
|
27
|
|
|
__DIR__ . '/../database/migrations/create_payroll_table.php.stub' => database_path('migrations/' . date('Y_m_d_His', time()) . '_create_payroll_table.php'), |
|
28
|
|
|
__DIR__ . '/../database/migrations/create_positions_table.php.stub' => database_path('migrations/' . date('Y_m_d_His', time()) . '_create_positions_table.php'), |
|
29
|
|
|
__DIR__ . '/../database/migrations/create_salaries_table.php.stub' => database_path('migrations/' . date('Y_m_d_His', time()) . '_create_salaries_table.php'), |
|
30
|
|
|
], 'open-payroll-database'); |
|
31
|
|
|
} |
|
32
|
|
|
|
|
33
|
|
|
/* |
|
34
|
|
|
* Views |
|
35
|
|
|
*/ |
|
36
|
|
|
$this->publishes([ |
|
37
|
|
|
__DIR__ . '/../resources/views' => resource_path('views'), |
|
38
|
|
|
], 'open-payroll-views'); |
|
39
|
|
|
|
|
40
|
|
|
/* |
|
41
|
|
|
* Models & Controllers |
|
42
|
|
|
*/ |
|
43
|
|
|
$this->publishes([ |
|
44
|
|
|
__DIR__ . '/../stubs/Models' => app_path('Models'), |
|
45
|
|
|
__DIR__ . '/../stubs/Http/Controllers' => app_path('Http/Controllers'), |
|
46
|
|
|
], 'open-payroll-app'); |
|
47
|
|
|
|
|
48
|
|
|
/* |
|
49
|
|
|
* Commands |
|
50
|
|
|
*/ |
|
51
|
|
|
if ($this->app->runningInConsole()) { |
|
52
|
|
|
$this->commands([ |
|
53
|
|
|
Console\Commands\InstallCommand::class, |
|
54
|
|
|
Console\Commands\SeedOpenPayrollReferenceCommand::class, |
|
55
|
|
|
Console\Commands\SeedDemoDataCommand::class, |
|
56
|
|
|
]); |
|
57
|
|
|
} |
|
58
|
|
|
} |
|
59
|
|
|
|
|
60
|
|
|
/** |
|
61
|
|
|
* Register the application services. |
|
62
|
|
|
*/ |
|
63
|
|
|
public function register() |
|
64
|
|
|
{ |
|
65
|
|
|
$this->mergeConfigFrom( |
|
66
|
|
|
__DIR__ . '/../config/open-payroll.php', 'open-payroll' |
|
67
|
|
|
); |
|
68
|
|
|
} |
|
69
|
|
|
} |
|
70
|
|
|
|