Cambios generales, a ver si volvemos al desarrollo
This commit is contained in:
@@ -3,25 +3,27 @@ APP_ENV=local
|
|||||||
APP_KEY=
|
APP_KEY=
|
||||||
APP_DEBUG=true
|
APP_DEBUG=true
|
||||||
APP_URL=http://localhost
|
APP_URL=http://localhost
|
||||||
|
|
||||||
|
APP_LOCALE=es
|
||||||
APP_TIMEZONE=America/Santiago
|
APP_TIMEZONE=America/Santiago
|
||||||
|
|
||||||
LOG_CHANNEL=stack
|
LOG_CHANNEL=stack
|
||||||
LOG_SLACK_WEBHOOK_URL=
|
|
||||||
|
|
||||||
DB_CONNECTION=postgresql
|
DB_CONNECTION=pgsql
|
||||||
DB_HOST=127.0.0.1
|
DB_HOST=127.0.0.1
|
||||||
DB_PORT=5432
|
DB_PORT=5432
|
||||||
DB_DATABASE=restaurant
|
DB_DATABASE=restaurant
|
||||||
DB_USERNAME=user
|
DB_USERNAME=user
|
||||||
DB_PASSWORD=password
|
DB_PASSWORD=password
|
||||||
|
|
||||||
CACHE_DRIVER=file
|
CACHE_DRIVER=redis
|
||||||
|
REDIS_CLIENT=predis
|
||||||
|
|
||||||
QUEUE_CONNECTION=sync
|
QUEUE_CONNECTION=sync
|
||||||
|
|
||||||
AUTH0_DOMAIN=https://super-domain.auth0.com/
|
AUTH0_DOMAIN=https://super-domain.auth0.com/
|
||||||
AUTH0_AUD=https://audience
|
AUTH0_AUD=https://audience
|
||||||
|
|
||||||
|
|
||||||
AUTH0_API_AUD=https://super-domain.auth0.com/api/v2/
|
AUTH0_API_AUD=https://super-domain.auth0.com/api/v2/
|
||||||
AUTH0_CLIENT_ID=secret
|
AUTH0_CLIENT_ID=secret
|
||||||
AUTH0_CLIENT_SECRET=secret
|
AUTH0_CLIENT_SECRET=secret
|
||||||
|
|||||||
@@ -5,25 +5,8 @@ namespace App\Console;
|
|||||||
use Illuminate\Console\Scheduling\Schedule;
|
use Illuminate\Console\Scheduling\Schedule;
|
||||||
use Laravel\Lumen\Console\Kernel as ConsoleKernel;
|
use Laravel\Lumen\Console\Kernel as ConsoleKernel;
|
||||||
|
|
||||||
class Kernel extends ConsoleKernel
|
class Kernel extends ConsoleKernel {
|
||||||
{
|
protected $commands = [];
|
||||||
/**
|
|
||||||
* The Artisan commands provided by your application.
|
|
||||||
*
|
|
||||||
* @var array
|
|
||||||
*/
|
|
||||||
protected $commands = [
|
|
||||||
//
|
|
||||||
];
|
|
||||||
|
|
||||||
/**
|
protected function schedule(Schedule $schedule) {}
|
||||||
* Define the application's command schedule.
|
|
||||||
*
|
|
||||||
* @param \Illuminate\Console\Scheduling\Schedule $schedule
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
protected function schedule(Schedule $schedule)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ namespace App\Events;
|
|||||||
|
|
||||||
use Illuminate\Queue\SerializesModels;
|
use Illuminate\Queue\SerializesModels;
|
||||||
|
|
||||||
abstract class Event
|
abstract class Event {
|
||||||
{
|
|
||||||
use SerializesModels;
|
use SerializesModels;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,15 +2,6 @@
|
|||||||
|
|
||||||
namespace App\Events;
|
namespace App\Events;
|
||||||
|
|
||||||
class ExampleEvent extends Event
|
class ExampleEvent extends Event {
|
||||||
{
|
public function __construct() {}
|
||||||
/**
|
|
||||||
* Create a new event instance.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function __construct()
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,13 +9,7 @@ use Laravel\Lumen\Exceptions\Handler as ExceptionHandler;
|
|||||||
use Symfony\Component\HttpKernel\Exception\HttpException;
|
use Symfony\Component\HttpKernel\Exception\HttpException;
|
||||||
use Throwable;
|
use Throwable;
|
||||||
|
|
||||||
class Handler extends ExceptionHandler
|
class Handler extends ExceptionHandler {
|
||||||
{
|
|
||||||
/**
|
|
||||||
* A list of the exception types that should not be reported.
|
|
||||||
*
|
|
||||||
* @var array
|
|
||||||
*/
|
|
||||||
protected $dontReport = [
|
protected $dontReport = [
|
||||||
AuthorizationException::class,
|
AuthorizationException::class,
|
||||||
HttpException::class,
|
HttpException::class,
|
||||||
@@ -23,32 +17,11 @@ class Handler extends ExceptionHandler
|
|||||||
ValidationException::class,
|
ValidationException::class,
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
public function report(Throwable $exception) {
|
||||||
* Report or log an exception.
|
|
||||||
*
|
|
||||||
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
|
|
||||||
*
|
|
||||||
* @param \Throwable $exception
|
|
||||||
* @return void
|
|
||||||
*
|
|
||||||
* @throws \Exception
|
|
||||||
*/
|
|
||||||
public function report(Throwable $exception)
|
|
||||||
{
|
|
||||||
parent::report($exception);
|
parent::report($exception);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function render($request, Throwable $exception) {
|
||||||
* Render an exception into an HTTP response.
|
|
||||||
*
|
|
||||||
* @param \Illuminate\Http\Request $request
|
|
||||||
* @param \Throwable $exception
|
|
||||||
* @return \Illuminate\Http\Response|\Illuminate\Http\JsonResponse
|
|
||||||
*
|
|
||||||
* @throws \Throwable
|
|
||||||
*/
|
|
||||||
public function render($request, Throwable $exception)
|
|
||||||
{
|
|
||||||
return parent::render($request, $exception);
|
return parent::render($request, $exception);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,8 +5,7 @@ namespace App\Http\Controllers;
|
|||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Laravel\Lumen\Routing\Controller as BaseController;
|
use Laravel\Lumen\Routing\Controller as BaseController;
|
||||||
|
|
||||||
class Controller extends BaseController
|
class Controller extends BaseController {
|
||||||
{
|
|
||||||
protected function buildFailedValidationResponse(Request $request, array $errors) {
|
protected function buildFailedValidationResponse(Request $request, array $errors) {
|
||||||
return ["error" => "validation_error", "message" => $errors];
|
return ["error" => "validation_error", "message" => $errors];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,36 +5,14 @@ namespace App\Http\Middleware;
|
|||||||
use Closure;
|
use Closure;
|
||||||
use Illuminate\Contracts\Auth\Factory as Auth;
|
use Illuminate\Contracts\Auth\Factory as Auth;
|
||||||
|
|
||||||
class Authenticate
|
class Authenticate {
|
||||||
{
|
|
||||||
/**
|
|
||||||
* The authentication guard factory instance.
|
|
||||||
*
|
|
||||||
* @var \Illuminate\Contracts\Auth\Factory
|
|
||||||
*/
|
|
||||||
protected $auth;
|
protected $auth;
|
||||||
|
|
||||||
/**
|
public function __construct(Auth $auth) {
|
||||||
* Create a new middleware instance.
|
|
||||||
*
|
|
||||||
* @param \Illuminate\Contracts\Auth\Factory $auth
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function __construct(Auth $auth)
|
|
||||||
{
|
|
||||||
$this->auth = $auth;
|
$this->auth = $auth;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function handle($request, Closure $next, $guard = null) {
|
||||||
* Handle an incoming request.
|
|
||||||
*
|
|
||||||
* @param \Illuminate\Http\Request $request
|
|
||||||
* @param \Closure $next
|
|
||||||
* @param string|null $guard
|
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
public function handle($request, Closure $next, $guard = null)
|
|
||||||
{
|
|
||||||
if ($this->auth->guard($guard)->guest()) {
|
if ($this->auth->guard($guard)->guest()) {
|
||||||
return response('Unauthorized.', 401);
|
return response('Unauthorized.', 401);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Http\Middleware;
|
|
||||||
|
|
||||||
use Closure;
|
|
||||||
|
|
||||||
class ExampleMiddleware
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Handle an incoming request.
|
|
||||||
*
|
|
||||||
* @param \Illuminate\Http\Request $request
|
|
||||||
* @param \Closure $next
|
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
public function handle($request, Closure $next)
|
|
||||||
{
|
|
||||||
return $next($request);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -2,25 +2,8 @@
|
|||||||
|
|
||||||
namespace App\Jobs;
|
namespace App\Jobs;
|
||||||
|
|
||||||
class ExampleJob extends Job
|
class ExampleJob extends Job {
|
||||||
{
|
public function __construct() {}
|
||||||
/**
|
|
||||||
* Create a new job instance.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function __construct()
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
public function handle() {}
|
||||||
* Execute the job.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function handle()
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,18 +7,6 @@ use Illuminate\Contracts\Queue\ShouldQueue;
|
|||||||
use Illuminate\Queue\InteractsWithQueue;
|
use Illuminate\Queue\InteractsWithQueue;
|
||||||
use Illuminate\Queue\SerializesModels;
|
use Illuminate\Queue\SerializesModels;
|
||||||
|
|
||||||
abstract class Job implements ShouldQueue
|
abstract class Job implements ShouldQueue {
|
||||||
{
|
|
||||||
/*
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
| Queueable Jobs
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
|
|
|
||||||
| This job base class provides a central location to place any logic that
|
|
||||||
| is shared across all of your jobs. The trait included with the class
|
|
||||||
| provides access to the "queueOn" and "delay" queue helper methods.
|
|
||||||
|
|
|
||||||
*/
|
|
||||||
|
|
||||||
use InteractsWithQueue, Queueable, SerializesModels;
|
use InteractsWithQueue, Queueable, SerializesModels;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,26 +6,8 @@ use App\Events\ExampleEvent;
|
|||||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||||
use Illuminate\Queue\InteractsWithQueue;
|
use Illuminate\Queue\InteractsWithQueue;
|
||||||
|
|
||||||
class ExampleListener
|
class ExampleListener {
|
||||||
{
|
public function __construct() {}
|
||||||
/**
|
|
||||||
* Create the event listener.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function __construct()
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
public function handle(ExampleEvent $event) {}
|
||||||
* Handle the event.
|
|
||||||
*
|
|
||||||
* @param \App\Events\ExampleEvent $event
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function handle(ExampleEvent $event)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,15 +6,8 @@ use App\Services\Auth0Service;
|
|||||||
use App\Services\PaginatorService;
|
use App\Services\PaginatorService;
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
|
||||||
class AppServiceProvider extends ServiceProvider
|
class AppServiceProvider extends ServiceProvider {
|
||||||
{
|
public function register() {
|
||||||
/**
|
|
||||||
* Register any application services.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function register()
|
|
||||||
{
|
|
||||||
$this->app->singleton(Auth0Service::class, function($app) {
|
$this->app->singleton(Auth0Service::class, function($app) {
|
||||||
return new Auth0Service($app);
|
return new Auth0Service($app);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,39 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Providers;
|
|
||||||
|
|
||||||
use App\Models\User;
|
|
||||||
use Illuminate\Support\Facades\Gate;
|
|
||||||
use Illuminate\Support\ServiceProvider;
|
|
||||||
|
|
||||||
class AuthServiceProvider extends ServiceProvider
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Register any application services.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function register()
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Boot the authentication services for the application.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function boot()
|
|
||||||
{
|
|
||||||
// Here you may define how you wish users to be authenticated for your Lumen
|
|
||||||
// application. The callback which receives the incoming request instance
|
|
||||||
// should return either a User instance or null. You're free to obtain
|
|
||||||
// the User instance via an API token or any other method necessary.
|
|
||||||
|
|
||||||
$this->app['auth']->viaRequest('api', function ($request) {
|
|
||||||
if ($request->input('api_token')) {
|
|
||||||
return User::where('api_token', $request->input('api_token'))->first();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -4,13 +4,7 @@ namespace App\Providers;
|
|||||||
|
|
||||||
use Laravel\Lumen\Providers\EventServiceProvider as ServiceProvider;
|
use Laravel\Lumen\Providers\EventServiceProvider as ServiceProvider;
|
||||||
|
|
||||||
class EventServiceProvider extends ServiceProvider
|
class EventServiceProvider extends ServiceProvider {
|
||||||
{
|
|
||||||
/**
|
|
||||||
* The event listener mappings for the application.
|
|
||||||
*
|
|
||||||
* @var array
|
|
||||||
*/
|
|
||||||
protected $listen = [
|
protected $listen = [
|
||||||
\App\Events\ExampleEvent::class => [
|
\App\Events\ExampleEvent::class => [
|
||||||
\App\Listeners\ExampleListener::class,
|
\App\Listeners\ExampleListener::class,
|
||||||
|
|||||||
@@ -3,14 +3,6 @@
|
|||||||
namespace App\Traits;
|
namespace App\Traits;
|
||||||
|
|
||||||
trait UuidPrimaryKey {
|
trait UuidPrimaryKey {
|
||||||
|
public function getKeyType() { return 'string'; }
|
||||||
public function getKeyType()
|
public function getIncrementing() { return false; }
|
||||||
{
|
|
||||||
return 'string';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getIncrementing()
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
559
backend/composer.lock
generated
559
backend/composer.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -2,15 +2,8 @@
|
|||||||
|
|
||||||
use Laravel\Lumen\Testing\TestCase as BaseTestCase;
|
use Laravel\Lumen\Testing\TestCase as BaseTestCase;
|
||||||
|
|
||||||
abstract class TestCase extends BaseTestCase
|
abstract class TestCase extends BaseTestCase {
|
||||||
{
|
public function createApplication() {
|
||||||
/**
|
|
||||||
* Creates the application.
|
|
||||||
*
|
|
||||||
* @return \Laravel\Lumen\Application
|
|
||||||
*/
|
|
||||||
public function createApplication()
|
|
||||||
{
|
|
||||||
return require __DIR__.'/../bootstrap/app.php';
|
return require __DIR__.'/../bootstrap/app.php';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user