codigo actual del servidor, con avances de joan

This commit is contained in:
Jose Sanchez
2023-08-07 15:52:04 -04:00
commit 3cd9b8bbe8
3070 changed files with 532255 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Schema;
use Illuminate\Pagination\Paginator;
class AppServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
Schema::defaultStringLength(191);
Paginator::useBootstrap();
}
/**
* Register any application services.
*
* @return void
*/
public function register()
{
//
}
}

View File

@@ -0,0 +1,33 @@
<?php
namespace App\Providers;
use Illuminate\Support\Facades\Gate;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
class AuthServiceProvider extends ServiceProvider
{
/**
* The policy mappings for the application.
*
* @var array
*/
protected $policies = [
'App\Model' => 'App\Policies\ModelPolicy',
];
/**
* Register any authentication / authorization services.
*
* @return void
*/
public function boot()
{
$this->registerPolicies();
// Implicitly grant "Super Admin" role all permissions
Gate::before(function ($user, $ability) {
return $user->hasRole('Super Admin') ? true : null;
});
}
}

View File

@@ -0,0 +1,21 @@
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Broadcast;
class BroadcastServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
Broadcast::routes();
require base_path('routes/channels.php');
}
}

View File

@@ -0,0 +1,34 @@
<?php
namespace App\Providers;
use Illuminate\Support\Facades\Event;
use Illuminate\Auth\Events\Registered;
use Illuminate\Auth\Listeners\SendEmailVerificationNotification;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
class EventServiceProvider extends ServiceProvider
{
/**
* The event listener mappings for the application.
*
* @var array
*/
protected $listen = [
Registered::class => [
SendEmailVerificationNotification::class,
],
];
/**
* Register any events for your application.
*
* @return void
*/
public function boot()
{
parent::boot();
//
}
}

View File

@@ -0,0 +1,363 @@
<?php
namespace App\Providers;
use Illuminate\Cache\RateLimiting\Limit;
use Illuminate\Support\Facades\Route;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\RateLimiter;
class RouteServiceProvider extends ServiceProvider
{
/**
* This namespace is applied to your controller routes.
*
* In addition, it is set as the URL generator's root namespace.
*
* @var string
*/
protected $namespace = null;
/**
* Define your route model bindings, pattern filters, etc.
*
* @return void
*/
public function boot()
{
//
parent::boot();
$this->configureRateLimiting();
}
/**
* Define the routes for the application.
*
* @return void
*/
public function map()
{
$this->mapApiRoutes();
$this->mapApiSellerRoutes();
$this->mapAdminRoutes();
$this->mapSellerRoutes();
$this->mapAffiliateRoutes();
$this->mapRefundRoutes();
$this->mapClubPointsRoutes();
$this->mapOtpRoutes();
$this->mapOfflinePaymentRoutes();
$this->mapAfricanPaymentGatewayRoutes();
$this->mapPaytmRoutes();
$this->mapPosRoutes();
$this->mapSellerPackageRoutes();
$this->mapDeliveryBoyRoutes();
$this->mapAuctionRoutes();
$this->mapWholesaleRoutes();
$this->mapWebRoutes();
// $this->mapInstallRoutes();
//$this->mapUpdateRoutes();
}
/**
* Define the "b2b" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @return void
*/
protected function mapWholesaleRoutes()
{
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/wholesale.php'));
}
/**
* Define the "delivery boy" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @return void
*/
protected function mapDeliveryBoyRoutes()
{
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/delivery_boy.php'));
}
/**
* Define the "auction" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @return void
*/
protected function mapAuctionRoutes()
{
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/auction.php'));
}
/**
* Define the "seller package" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @return void
*/
protected function mapSellerPackageRoutes()
{
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/seller_package.php'));
}
/**
* Define the "affiliate" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @return void
*/
protected function mapAffiliateRoutes()
{
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/affiliate.php'));
}
/**
* Define the "offline payment" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @return void
*/
protected function mapOfflinePaymentRoutes()
{
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/offline_payment.php'));
}
/**
* Define the "offline payment" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @return void
*/
protected function mapPaytmRoutes()
{
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/paytm.php'));
}
/**
* Define the "offline payment" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @return void
*/
protected function mapAfricanPaymentGatewayRoutes()
{
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/african_pg.php'));
}
/**
* Define the "refund" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @return void
*/
protected function mapRefundRoutes()
{
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/refund_request.php'));
}
/**
* Define the "club points" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @return void
*/
protected function mapClubPointsRoutes()
{
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/club_points.php'));
}
/**
* Define the "OTP System" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @return void
*/
protected function mapOtpRoutes()
{
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/otp.php'));
}
/**
* Define the "POS System" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @return void
*/
protected function mapPosRoutes()
{
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/pos.php'));
}
/**
* Define the "updating" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @return void
*/
protected function mapUpdateRoutes()
{
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/update.php'));
}
/**
* Define the "installation" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @return void
*/
protected function mapInstallRoutes()
{
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/install.php'));
}
/**
* 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 "admin" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @return void
*/
protected function mapAdminRoutes()
{
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/admin.php'));
}
/**
* Define the "seller" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @return void
*/
protected function mapSellerRoutes()
{
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/seller.php'));
}
/**
* Define the "api" routes for the application.
*
* These routes are typically stateless.
*
* @return void
*/
protected function mapApiSellerRoutes()
{
Route::prefix('api')
->middleware('api')
->namespace($this->namespace)
->group(base_path('routes/api_seller.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'));
}
/**
* Configure the rate limiters for the application.
*
* @return void
*/
protected function configureRateLimiting()
{
RateLimiter::for('api', function (Request $request) {
return Limit::perMinute(600)->by(optional($request->user())->id ?: $request->ip());
});
}
}

View File

@@ -0,0 +1,363 @@
<?php
namespace App\Providers;
use Illuminate\Cache\RateLimiting\Limit;
use Illuminate\Support\Facades\Route;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\RateLimiter;
class RouteServiceProvider extends ServiceProvider
{
/**
* This namespace is applied to your controller routes.
*
* In addition, it is set as the URL generator's root namespace.
*
* @var string
*/
protected $namespace = null;
/**
* Define your route model bindings, pattern filters, etc.
*
* @return void
*/
public function boot()
{
//
parent::boot();
$this->configureRateLimiting();
}
/**
* Define the routes for the application.
*
* @return void
*/
public function map()
{
$this->mapApiRoutes();
$this->mapApiSellerRoutes();
$this->mapAdminRoutes();
$this->mapSellerRoutes();
$this->mapAffiliateRoutes();
$this->mapRefundRoutes();
$this->mapClubPointsRoutes();
$this->mapOtpRoutes();
$this->mapOfflinePaymentRoutes();
$this->mapAfricanPaymentGatewayRoutes();
$this->mapPaytmRoutes();
$this->mapPosRoutes();
$this->mapSellerPackageRoutes();
$this->mapDeliveryBoyRoutes();
$this->mapAuctionRoutes();
$this->mapWholesaleRoutes();
$this->mapWebRoutes();
// $this->mapInstallRoutes();
//$this->mapUpdateRoutes();
}
/**
* Define the "b2b" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @return void
*/
protected function mapWholesaleRoutes()
{
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/wholesale.php'));
}
/**
* Define the "delivery boy" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @return void
*/
protected function mapDeliveryBoyRoutes()
{
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/delivery_boy.php'));
}
/**
* Define the "auction" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @return void
*/
protected function mapAuctionRoutes()
{
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/auction.php'));
}
/**
* Define the "seller package" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @return void
*/
protected function mapSellerPackageRoutes()
{
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/seller_package.php'));
}
/**
* Define the "affiliate" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @return void
*/
protected function mapAffiliateRoutes()
{
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/affiliate.php'));
}
/**
* Define the "offline payment" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @return void
*/
protected function mapOfflinePaymentRoutes()
{
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/offline_payment.php'));
}
/**
* Define the "offline payment" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @return void
*/
protected function mapPaytmRoutes()
{
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/paytm.php'));
}
/**
* Define the "offline payment" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @return void
*/
protected function mapAfricanPaymentGatewayRoutes()
{
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/african_pg.php'));
}
/**
* Define the "refund" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @return void
*/
protected function mapRefundRoutes()
{
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/refund_request.php'));
}
/**
* Define the "club points" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @return void
*/
protected function mapClubPointsRoutes()
{
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/club_points.php'));
}
/**
* Define the "OTP System" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @return void
*/
protected function mapOtpRoutes()
{
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/otp.php'));
}
/**
* Define the "POS System" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @return void
*/
protected function mapPosRoutes()
{
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/pos.php'));
}
/**
* Define the "updating" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @return void
*/
protected function mapUpdateRoutes()
{
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/update.php'));
}
/**
* Define the "installation" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @return void
*/
protected function mapInstallRoutes()
{
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/install.php'));
}
/**
* 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 "admin" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @return void
*/
protected function mapAdminRoutes()
{
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/admin.php'));
}
/**
* Define the "seller" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @return void
*/
protected function mapSellerRoutes()
{
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/seller.php'));
}
/**
* Define the "api" routes for the application.
*
* These routes are typically stateless.
*
* @return void
*/
protected function mapApiSellerRoutes()
{
Route::prefix('api')
->middleware('api')
->namespace($this->namespace)
->group(base_path('routes/api_seller.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'));
}
/**
* Configure the rate limiters for the application.
*
* @return void
*/
protected function configureRateLimiting()
{
RateLimiter::for('api', function (Request $request) {
return Limit::perMinute(600)->by(optional($request->user())->id ?: $request->ip());
});
}
}