build version 400

This commit is contained in:
Mohit Panjwani
2020-12-02 17:54:08 +05:30
parent 326508e567
commit 89ee58590c
963 changed files with 62887 additions and 48868 deletions

View File

@ -14,6 +14,7 @@ class AppServiceProvider extends ServiceProvider
public function boot()
{
Paginator::useBootstrapThree();
$this->loadJsonTranslationsFrom(resource_path('assets/js/plugins'));
}
/**
@ -23,11 +24,6 @@ class AppServiceProvider extends ServiceProvider
*/
public function register()
{
/*ADD THIS LINES*/
$this->commands([
\Laravel\Passport\Console\InstallCommand::class,
\Laravel\Passport\Console\KeysCommand::class,
\Laravel\Passport\Console\ClientCommand::class,
]);
//
}
}

View File

@ -2,7 +2,6 @@
namespace Crater\Providers;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
use Laravel\Passport\Passport;
class AuthServiceProvider extends ServiceProvider
{
@ -23,7 +22,5 @@ class AuthServiceProvider extends ServiceProvider
public function boot()
{
$this->registerPolicies();
Passport::routes();
}
}

View File

@ -0,0 +1,39 @@
<?php
namespace Crater\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Storage;
use League\Flysystem\Filesystem;
use Spatie\Dropbox\Client as DropboxClient;
use Spatie\FlysystemDropbox\DropboxAdapter;
class DropboxServiceProvider extends ServiceProvider
{
/**
* Register services.
*
* @return void
*/
public function register()
{
//
}
/**
* Bootstrap services.
*
* @return void
*/
public function boot()
{
Storage::extend('dropbox', function ($app, $config) {
$client = new DropboxClient(
$config['token']
);
return new Filesystem(new DropboxAdapter($client));
});
}
}

View File

@ -1,19 +1,32 @@
<?php
namespace Crater\Providers;
use Illuminate\Cache\RateLimiting\Limit;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\RateLimiter;
use Illuminate\Support\Facades\Route;
class RouteServiceProvider extends ServiceProvider
{
/**
* This namespace is applied to your controller routes.
* The path to the "home" route for your application.
*
* In addition, it is set as the URL generator's root namespace.
* This is used by Laravel authentication to redirect users after login.
*
* @var string
*/
protected $namespace = 'Crater\Http\Controllers';
public const HOME = '/admin/dashboard';
/**
* The controller namespace for the application.
*
* When present, controller route declarations will automatically be prefixed with this namespace.
*
* @var string|null
*/
// protected $namespace = 'Crater\\Http\\Controllers';
/**
* Define your route model bindings, pattern filters, etc.
@ -22,51 +35,29 @@ class RouteServiceProvider extends ServiceProvider
*/
public function boot()
{
//
$this->configureRateLimiting();
parent::boot();
$this->routes(function () {
Route::prefix('api')
->middleware('api')
->namespace($this->namespace)
->group(base_path('routes/api.php'));
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/web.php'));
});
}
/**
* Define the routes for the application.
* Configure the rate limiters for the application.
*
* @return void
*/
public function map()
protected function configureRateLimiting()
{
$this->mapApiRoutes();
$this->mapWebRoutes();
//
RateLimiter::for('api', function (Request $request) {
return Limit::perMinute(60);
});
}
/**
* Define the "web" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @return void
*/
protected function mapWebRoutes()
{
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/web.php'));
}
/**
* Define the "api" routes for the application.
*
* These routes are typically stateless.
*
* @return void
*/
protected function mapApiRoutes()
{
Route::prefix('api')
->middleware('api')
->namespace($this->namespace)
->group(base_path('routes/api.php'));
}
}
}