Come BackEnd

This commit is contained in:
saeid_01
2019-04-18 20:18:13 +04:30
parent dfbefad4a4
commit 03a135305b
61 changed files with 3266 additions and 58 deletions
+5 -2
View File
@@ -4,6 +4,7 @@ namespace App\Providers;
use Illuminate\Support\Facades\Gate;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
use Laravel\Passport\Passport;
class AuthServiceProvider extends ServiceProvider
{
@@ -13,7 +14,9 @@ class AuthServiceProvider extends ServiceProvider
* @var array
*/
protected $policies = [
// 'App\Model' => 'App\Policies\ModelPolicy',
'App\MedicalCenter' => 'App\Policies\MedicalCenterPolicy',
'App\User' => 'App\Policies\UserPolicy',
'App\TestType' => 'App\Policies\TestTypePolicy',
];
/**
@@ -25,6 +28,6 @@ class AuthServiceProvider extends ServiceProvider
{
$this->registerPolicies();
//
Passport::routes();
}
}
+28
View File
@@ -0,0 +1,28 @@
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
class MessageServiceProvider extends ServiceProvider
{
protected $defer = true;
public function register()
{
$this->app->singleton('messages', function() {
return new \App\Appended\Classes\Common\Response\MessageResponse;
});
}
/**
* Get the services provided by the provider.
*
* @return array
*/
public function provides()
{
return [MessageResponse::class];
}
}
+19 -3
View File
@@ -35,6 +35,9 @@ class RouteServiceProvider extends ServiceProvider
*/
public function map()
{
$this->mapRoutes();
$this->mapApiRoutes();
$this->mapWebRoutes();
@@ -66,8 +69,21 @@ class RouteServiceProvider extends ServiceProvider
protected function mapApiRoutes()
{
Route::prefix('api')
->middleware('api')
->namespace($this->namespace)
->group(base_path('routes/api.php'));
->middleware('api')
->namespace($this->namespace)
->group(base_path('routes/api.php'));
}
/**
* Define the routes without middleware for the application.
*
* These routes are typically stateless.
*
* @return void
*/
protected function mapRoutes()
{
Route::namespace($this->namespace)
->group(base_path('routes/routes.php'));
}
}