-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jean Pierre
authored and
Jean Pierre
committed
Jul 16, 2020
1 parent
28aefe9
commit 5a96ca1
Showing
98 changed files
with
96,932 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
indent_style = space | ||
indent_size = 4 | ||
trim_trailing_whitespace = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false | ||
|
||
[*.{yml,yaml}] | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
APP_NAME=Laravel | ||
APP_ENV=local | ||
APP_KEY= | ||
APP_DEBUG=true | ||
APP_URL=http://localhost | ||
|
||
LOG_CHANNEL=stack | ||
|
||
DB_CONNECTION=mysql | ||
DB_HOST=127.0.0.1 | ||
DB_PORT=3306 | ||
DB_DATABASE=laravel | ||
DB_USERNAME=root | ||
DB_PASSWORD= | ||
|
||
BROADCAST_DRIVER=log | ||
CACHE_DRIVER=file | ||
QUEUE_CONNECTION=sync | ||
SESSION_DRIVER=file | ||
SESSION_LIFETIME=120 | ||
|
||
REDIS_HOST=127.0.0.1 | ||
REDIS_PASSWORD=null | ||
REDIS_PORT=6379 | ||
|
||
MAIL_MAILER=smtp | ||
MAIL_HOST=smtp.mailtrap.io | ||
MAIL_PORT=2525 | ||
MAIL_USERNAME=null | ||
MAIL_PASSWORD=null | ||
MAIL_ENCRYPTION=null | ||
MAIL_FROM_ADDRESS=null | ||
MAIL_FROM_NAME="${APP_NAME}" | ||
|
||
AWS_ACCESS_KEY_ID= | ||
AWS_SECRET_ACCESS_KEY= | ||
AWS_DEFAULT_REGION=us-east-1 | ||
AWS_BUCKET= | ||
|
||
PUSHER_APP_ID= | ||
PUSHER_APP_KEY= | ||
PUSHER_APP_SECRET= | ||
PUSHER_APP_CLUSTER=mt1 | ||
|
||
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" | ||
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
* text=auto | ||
*.css linguist-vendored | ||
*.scss linguist-vendored | ||
*.js linguist-vendored | ||
CHANGELOG.md export-ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/node_modules | ||
/public/hot | ||
/public/storage | ||
/storage/*.key | ||
/vendor | ||
.env | ||
.env.backup | ||
.phpunit.result.cache | ||
Homestead.json | ||
Homestead.yaml | ||
npm-debug.log | ||
yarn-error.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
php: | ||
preset: laravel | ||
disabled: | ||
- unused_use | ||
finder: | ||
not-name: | ||
- index.php | ||
- server.php | ||
js: | ||
finder: | ||
not-name: | ||
- webpack.mix.js | ||
css: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
namespace App; | ||
|
||
use Illuminate\Database\Eloquent\Model; | ||
|
||
class Cliente extends Model | ||
{ | ||
public function transferencias(){ | ||
return $this->hasMany('App\Transferencia'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
namespace App\Console; | ||
|
||
use Illuminate\Console\Scheduling\Schedule; | ||
use Illuminate\Foundation\Console\Kernel as ConsoleKernel; | ||
|
||
class Kernel extends ConsoleKernel | ||
{ | ||
/** | ||
* The Artisan commands provided by your application. | ||
* | ||
* @var array | ||
*/ | ||
protected $commands = [ | ||
// | ||
]; | ||
|
||
/** | ||
* Define the application's command schedule. | ||
* | ||
* @param \Illuminate\Console\Scheduling\Schedule $schedule | ||
* @return void | ||
*/ | ||
protected function schedule(Schedule $schedule) | ||
{ | ||
// $schedule->command('inspire')->hourly(); | ||
} | ||
|
||
/** | ||
* Register the commands for the application. | ||
* | ||
* @return void | ||
*/ | ||
protected function commands() | ||
{ | ||
$this->load(__DIR__.'/Commands'); | ||
|
||
require base_path('routes/console.php'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?php | ||
|
||
namespace App\Exceptions; | ||
|
||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; | ||
use Throwable; | ||
|
||
class Handler extends ExceptionHandler | ||
{ | ||
/** | ||
* A list of the exception types that are not reported. | ||
* | ||
* @var array | ||
*/ | ||
protected $dontReport = [ | ||
// | ||
]; | ||
|
||
/** | ||
* A list of the inputs that are never flashed for validation exceptions. | ||
* | ||
* @var array | ||
*/ | ||
protected $dontFlash = [ | ||
'password', | ||
'password_confirmation', | ||
]; | ||
|
||
/** | ||
* Report or log an exception. | ||
* | ||
* @param \Throwable $exception | ||
* @return void | ||
* | ||
* @throws \Exception | ||
*/ | ||
public function report(Throwable $exception) | ||
{ | ||
parent::report($exception); | ||
} | ||
|
||
/** | ||
* Render an exception into an HTTP response. | ||
* | ||
* @param \Illuminate\Http\Request $request | ||
* @param \Throwable $exception | ||
* @return \Symfony\Component\HttpFoundation\Response | ||
* | ||
* @throws \Throwable | ||
*/ | ||
public function render($request, Throwable $exception) | ||
{ | ||
return parent::render($request, $exception); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers; | ||
|
||
use Illuminate\Http\Request; | ||
use App\Cliente; | ||
|
||
class ClienteController extends Controller | ||
{ | ||
public function index(){ | ||
$cliente = Cliente::firstOrFail(); | ||
return response()->json($cliente->load('transferencias'), 200); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers; | ||
|
||
use Illuminate\Foundation\Auth\Access\AuthorizesRequests; | ||
use Illuminate\Foundation\Bus\DispatchesJobs; | ||
use Illuminate\Foundation\Validation\ValidatesRequests; | ||
use Illuminate\Routing\Controller as BaseController; | ||
|
||
class Controller extends BaseController | ||
{ | ||
use AuthorizesRequests, DispatchesJobs, ValidatesRequests; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers; | ||
|
||
use Illuminate\Http\Request; | ||
use App\Transferencia; | ||
use App\Cliente; | ||
|
||
class TransferenciaController extends Controller | ||
{ | ||
public function store(Request $request){ | ||
$cliente = Cliente::find($request->cliente_id); | ||
$cliente->money = $cliente->money + $request->amount; | ||
$cliente->update(); | ||
|
||
$transferencia = new Transferencia(); | ||
$transferencia->description = $request->description; | ||
$transferencia->amount = $request->amount; | ||
$transferencia->cliente_id = $request->cliente_id; | ||
$transferencia->save(); | ||
|
||
return response()->json($transferencia, 201); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<?php | ||
|
||
namespace App\Http; | ||
|
||
use Illuminate\Foundation\Http\Kernel as HttpKernel; | ||
|
||
class Kernel extends HttpKernel | ||
{ | ||
/** | ||
* The application's global HTTP middleware stack. | ||
* | ||
* These middleware are run during every request to your application. | ||
* | ||
* @var array | ||
*/ | ||
protected $middleware = [ | ||
// \App\Http\Middleware\TrustHosts::class, | ||
\App\Http\Middleware\TrustProxies::class, | ||
\Fruitcake\Cors\HandleCors::class, | ||
\App\Http\Middleware\CheckForMaintenanceMode::class, | ||
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class, | ||
\App\Http\Middleware\TrimStrings::class, | ||
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class, | ||
]; | ||
|
||
/** | ||
* The application's route middleware groups. | ||
* | ||
* @var array | ||
*/ | ||
protected $middlewareGroups = [ | ||
'web' => [ | ||
\App\Http\Middleware\EncryptCookies::class, | ||
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, | ||
\Illuminate\Session\Middleware\StartSession::class, | ||
// \Illuminate\Session\Middleware\AuthenticateSession::class, | ||
\Illuminate\View\Middleware\ShareErrorsFromSession::class, | ||
\App\Http\Middleware\VerifyCsrfToken::class, | ||
\Illuminate\Routing\Middleware\SubstituteBindings::class, | ||
], | ||
|
||
'api' => [ | ||
'throttle:60,1', | ||
\Illuminate\Routing\Middleware\SubstituteBindings::class, | ||
], | ||
]; | ||
|
||
/** | ||
* The application's route middleware. | ||
* | ||
* These middleware may be assigned to groups or used individually. | ||
* | ||
* @var array | ||
*/ | ||
protected $routeMiddleware = [ | ||
'auth' => \App\Http\Middleware\Authenticate::class, | ||
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, | ||
'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class, | ||
'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class, | ||
'can' => \Illuminate\Auth\Middleware\Authorize::class, | ||
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, | ||
'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class, | ||
'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class, | ||
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, | ||
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class, | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
namespace App\Http\Middleware; | ||
|
||
use Illuminate\Auth\Middleware\Authenticate as Middleware; | ||
|
||
class Authenticate extends Middleware | ||
{ | ||
/** | ||
* Get the path the user should be redirected to when they are not authenticated. | ||
* | ||
* @param \Illuminate\Http\Request $request | ||
* @return string|null | ||
*/ | ||
protected function redirectTo($request) | ||
{ | ||
if (! $request->expectsJson()) { | ||
return route('login'); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
namespace App\Http\Middleware; | ||
|
||
use Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode as Middleware; | ||
|
||
class CheckForMaintenanceMode extends Middleware | ||
{ | ||
/** | ||
* The URIs that should be reachable while maintenance mode is enabled. | ||
* | ||
* @var array | ||
*/ | ||
protected $except = [ | ||
// | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
namespace App\Http\Middleware; | ||
|
||
use Illuminate\Cookie\Middleware\EncryptCookies as Middleware; | ||
|
||
class EncryptCookies extends Middleware | ||
{ | ||
/** | ||
* The names of the cookies that should not be encrypted. | ||
* | ||
* @var array | ||
*/ | ||
protected $except = [ | ||
// | ||
]; | ||
} |
Oops, something went wrong.