@@ -62,52 +62,62 @@ public function offerPublishing(): void
62
62
63
63
private function publishEnums (): void
64
64
{
65
+ $ publishPath = $ this ->app ->basePath (config ('repository.path.relative.enums ' , 'app/Models/Enums/ ' ));
66
+
65
67
$ this ->publishes ([
66
- $ this ->baseModelStubPath . '/Enums/Enum.stub ' => $ this -> app -> basePath ( ' app/Models/Enums/ Enum.php ') ,
68
+ $ this ->baseModelStubPath . '/Enums/Enum.stub ' => $ publishPath . ' Enum.php ' ,
67
69
], ['repository-base-classes ' , 'repository-base-enum ' ]);
68
70
69
71
$ this ->publishes ([
70
- $ this ->baseModelStubPath . '/Enums/GriewFilterOperator.stub ' => $ this -> app -> basePath ( ' app/Models/Enums/ GriewFilterOperator.php ') ,
72
+ $ this ->baseModelStubPath . '/Enums/GriewFilterOperator.stub ' => $ publishPath . ' GriewFilterOperator.php ' ,
71
73
], ['repository-base-classes ' , 'repository-griew-enums ' ]);
72
74
}
73
75
74
76
private function publishEntities (): void
75
77
{
78
+ $ publishPath = $ this ->app ->basePath (config ('repository.path.relative.entities ' , 'app/Models/Entities/ ' ));
79
+
76
80
$ this ->publishes ([
77
- $ this ->baseModelStubPath . '/Entity/Entity.stub ' => $ this -> app -> basePath ( ' app/Models/Entities/ Entity.php ') ,
81
+ $ this ->baseModelStubPath . '/Entity/Entity.stub ' => $ publishPath . ' Entity.php ' ,
78
82
], ['repository-base-classes ' , 'repository-base-entity ' ]);
79
83
}
80
84
81
85
private function publishFactories (): void
82
86
{
87
+ $ publishPath = $ this ->app ->basePath (config ('repository.path.relative.factories ' , 'app/Models/Factories/ ' ));
88
+
83
89
$ this ->publishes ([
84
- $ this ->baseModelStubPath . '/Factory/Factory.stub ' => $ this -> app -> basePath ( ' app/Models/Factories/ Factory.php ') ,
90
+ $ this ->baseModelStubPath . '/Factory/Factory.stub ' => $ publishPath . ' Factory.php ' ,
85
91
], ['repository-base-classes ' , 'repository-base-factory ' ]);
86
92
87
93
$ this ->publishes ([
88
- $ this ->baseModelStubPath . '/Factory/IFactory.stub ' => $ this -> app -> basePath ( ' app/Models/Factories/ IFactory.php ') ,
94
+ $ this ->baseModelStubPath . '/Factory/IFactory.stub ' => $ publishPath . ' IFactory.php ' ,
89
95
], ['repository-base-classes ' , 'repository-base-factory ' ]);
90
96
}
91
97
92
98
private function publishResources (): void
93
99
{
100
+ $ publishPath = $ this ->app ->basePath (config ('repository.path.relative.resources ' , 'app/Models/Resources/ ' ));
101
+
94
102
$ this ->publishes ([
95
- $ this ->baseModelStubPath . '/Resource/Resource.stub ' => $ this -> app -> basePath ( ' app/Models/Resources/ Resource.php ') ,
103
+ $ this ->baseModelStubPath . '/Resource/Resource.stub ' => $ publishPath . ' Resource.php ' ,
96
104
], ['repository-base-classes ' , 'repository-base-resource ' ]);
97
105
98
106
$ this ->publishes ([
99
- $ this ->baseModelStubPath . '/Resource/IResource.stub ' => $ this -> app -> basePath ( ' app/Models/Resources/ IResource.php ') ,
107
+ $ this ->baseModelStubPath . '/Resource/IResource.stub ' => $ publishPath . ' IResource.php ' ,
100
108
], ['repository-base-classes ' , 'repository-base-resource ' ]);
101
109
}
102
110
103
111
private function publishRepositories (): void
104
112
{
113
+ $ publishPath = $ this ->app ->basePath (config ('repository.path.relative.repositories ' , 'app/Models/Repositories/ ' ));
114
+
105
115
$ this ->publishes ([
106
- $ this ->baseModelStubPath . '/Repository/MySqlRepository.stub ' => $ this -> app -> basePath ( ' app/Models/Repositories/ MySqlRepository.php ') ,
116
+ $ this ->baseModelStubPath . '/Repository/MySqlRepository.stub ' => $ publishPath . ' MySqlRepository.php ' ,
107
117
], ['repository-base-classes ' , 'repository-base-mysql-repository ' ]);
108
118
109
119
$ this ->publishes ([
110
- $ this ->baseModelStubPath . '/Repository/RedisRepository.stub ' => $ this -> app -> basePath ( ' app/Models/Repositories/ RedisRepository.php ') ,
120
+ $ this ->baseModelStubPath . '/Repository/RedisRepository.stub ' => $ publishPath . ' RedisRepository.php ' ,
111
121
], ['repository-base-classes ' , 'repository-base-redis-repository ' ]);
112
122
}
113
123
0 commit comments