-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Laravel): add framework + initial setup
- PHP CS Fixer - Package dependencies (Composer) - Pre commit script - .env - etc
- Loading branch information
Showing
66 changed files
with
7,803 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] | ||
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,36 @@ | ||
APP_NAME="VOST Portugal API" | ||
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=vost_api | ||
DB_USERNAME=homestead | ||
DB_PASSWORD=secret | ||
|
||
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_DRIVER=smtp | ||
MAIL_HOST=smtp.mailtrap.io | ||
MAIL_PORT=2525 | ||
MAIL_USERNAME=null | ||
MAIL_PASSWORD=null | ||
MAIL_ENCRYPTION=null | ||
|
||
AWS_ACCESS_KEY_ID= | ||
AWS_SECRET_ACCESS_KEY= | ||
AWS_DEFAULT_REGION=us-east-1 | ||
AWS_BUCKET= |
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,16 @@ | ||
/coverage | ||
/node_modules | ||
/public/hot | ||
/public/storage | ||
/storage/*.key | ||
/vendor | ||
/.idea | ||
/.vscode | ||
/.php_cs.cache | ||
.DS_Store | ||
.env | ||
.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,48 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
return PhpCsFixer\Config::create() | ||
->setRules([ | ||
'@PSR2' => true, | ||
'psr4' => true, | ||
'strict_param' => true, | ||
'declare_strict_types' => true, | ||
'fully_qualified_strict_types' => true, | ||
'single_quote' => true, | ||
'linebreak_after_opening_tag' => true, | ||
'logical_operators' => true, | ||
'lowercase_cast' => true, | ||
'short_scalar_cast' => true, | ||
'no_whitespace_in_blank_line' => true, | ||
'no_unused_imports' => true, | ||
'combine_consecutive_issets' => true, | ||
'not_operator_with_successor_space' => true, | ||
'combine_consecutive_unsets' => true, | ||
'native_function_casing' => true, | ||
'native_function_invocation' => true, | ||
'no_alias_functions' => true, | ||
'trailing_comma_in_multiline_array' => true, | ||
'mb_str_functions' => true, | ||
'ordered_imports' => [ | ||
'sort_algorithm' => 'alpha', | ||
], | ||
'return_type_declaration' => [ | ||
'space_before' => 'none', | ||
], | ||
'class_attributes_separation' => [ | ||
'elements' => [ | ||
'method', | ||
'property', | ||
], | ||
], | ||
'binary_operator_spaces' => [ | ||
'default' => 'align_single_space_minimal', | ||
], | ||
'array_syntax' => [ | ||
'syntax' => 'short', | ||
], | ||
'concat_space' => [ | ||
'spacing' => 'none', | ||
], | ||
]); |
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,37 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace VOSTPT\API\Console; | ||
|
||
use Illuminate\Console\Scheduling\Schedule; | ||
use Illuminate\Foundation\Console\Kernel as ConsoleKernel; | ||
|
||
class Kernel extends ConsoleKernel | ||
{ | ||
/** | ||
* {@inheritDoc} | ||
*/ | ||
protected $commands = [ | ||
// | ||
]; | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
protected function schedule(Schedule $schedule) | ||
{ | ||
// $schedule->command('inspire') | ||
// ->hourly(); | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
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,19 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace VOSTPT\API\Exceptions; | ||
|
||
use Exception; | ||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; | ||
|
||
class Handler extends ExceptionHandler | ||
{ | ||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public function render($request, Exception $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,16 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace VOSTPT\API\Http\Controllers; | ||
|
||
use Illuminate\Foundation\Auth\Access\AuthorizesRequests; | ||
use Illuminate\Foundation\Bus\DispatchesJobs; | ||
use Illuminate\Foundation\Validation\ValidatesRequests; | ||
|
||
abstract class Controller | ||
{ | ||
use AuthorizesRequests; | ||
use DispatchesJobs; | ||
use 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,48 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace VOSTPT\API\Http; | ||
|
||
use Illuminate\Foundation\Http\Kernel as HttpKernel; | ||
|
||
class Kernel extends HttpKernel | ||
{ | ||
/** | ||
* {@inheritDoc} | ||
*/ | ||
protected $middleware = [ | ||
Middleware\CheckForMaintenanceMode::class, | ||
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class, | ||
Middleware\TrimStrings::class, | ||
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class, | ||
Middleware\TrustProxies::class, | ||
]; | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
protected $middlewareGroups = [ | ||
'web' => [], | ||
|
||
'api' => [ | ||
'throttle:60,1', | ||
'bindings', | ||
], | ||
]; | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
protected $routeMiddleware = [ | ||
'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class, | ||
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, | ||
]; | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
protected $middlewarePriority = [ | ||
\Illuminate\Routing\Middleware\SubstituteBindings::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,17 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace VOSTPT\API\Http\Middleware; | ||
|
||
use Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode as Middleware; | ||
|
||
class CheckForMaintenanceMode extends Middleware | ||
{ | ||
/** | ||
* {@inheritDoc} | ||
*/ | ||
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,18 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace VOSTPT\API\Http\Middleware; | ||
|
||
use Illuminate\Foundation\Http\Middleware\TrimStrings as Middleware; | ||
|
||
class TrimStrings extends Middleware | ||
{ | ||
/** | ||
* {@inheritDoc} | ||
*/ | ||
protected $except = [ | ||
'password', | ||
'password_confirmation', | ||
]; | ||
} |
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 | ||
|
||
declare(strict_types=1); | ||
|
||
namespace VOSTPT\API\Http\Middleware; | ||
|
||
use Fideloper\Proxy\TrustProxies as Middleware; | ||
use Illuminate\Http\Request; | ||
|
||
class TrustProxies extends Middleware | ||
{ | ||
/** | ||
* {@inheritDoc} | ||
*/ | ||
protected $proxies = '*'; | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
protected $headers = Request::HEADER_X_FORWARDED_ALL; | ||
} |
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,40 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace VOSTPT\API\Models; | ||
|
||
use Illuminate\Foundation\Auth\User as Authenticatable; | ||
use Illuminate\Notifications\Notifiable; | ||
|
||
class User extends Authenticatable | ||
{ | ||
use Notifiable; | ||
|
||
/** | ||
* The attributes that are mass assignable. | ||
* | ||
* @var array | ||
*/ | ||
protected $fillable = [ | ||
'name', 'email', 'password', | ||
]; | ||
|
||
/** | ||
* The attributes that should be hidden for arrays. | ||
* | ||
* @var array | ||
*/ | ||
protected $hidden = [ | ||
'password', 'remember_token', | ||
]; | ||
|
||
/** | ||
* The attributes that should be cast to native types. | ||
* | ||
* @var array | ||
*/ | ||
protected $casts = [ | ||
'email_verified_at' => 'datetime', | ||
]; | ||
} |
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,28 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace VOSTPT\API\Providers; | ||
|
||
use Illuminate\Support\ServiceProvider; | ||
|
||
class AppServiceProvider extends ServiceProvider | ||
{ | ||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public function register() | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Bootstrap any application services. | ||
* | ||
* @return void | ||
*/ | ||
public function boot() | ||
{ | ||
// | ||
} | ||
} |
Oops, something went wrong.