-
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.
Adaptando projeto para framework Lumen v8.0
- Loading branch information
1 parent
778bb48
commit e7d9f8f
Showing
92 changed files
with
5,627 additions
and
28,157 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,19 @@ | ||
APP_NAME=Lumen | ||
APP_ENV=local | ||
APP_KEY= | ||
APP_DEBUG=true | ||
APP_URL=http://localhost | ||
APP_TIMEZONE=UTC | ||
|
||
LOG_CHANNEL=stack | ||
LOG_SLACK_WEBHOOK_URL= | ||
|
||
DB_CONNECTION=mysql | ||
DB_HOST=127.0.0.1 | ||
DB_PORT=3306 | ||
DB_DATABASE=homestead | ||
DB_USERNAME=homestead | ||
DB_PASSWORD=secret | ||
|
||
CACHE_DRIVER=file | ||
QUEUE_CONNECTION=sync |
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 |
---|---|---|
@@ -1,3 +1,6 @@ | ||
.idea/ | ||
|
||
vendor/ | ||
/vendor | ||
/.idea | ||
Homestead.json | ||
Homestead.yaml | ||
.env | ||
.phpunit.result.cache |
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,6 @@ | ||
php: | ||
preset: laravel | ||
disabled: | ||
- unused_use | ||
js: true | ||
css: true |
Empty file.
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,29 @@ | ||
<?php | ||
|
||
namespace App\Console; | ||
|
||
use Illuminate\Console\Scheduling\Schedule; | ||
use Laravel\Lumen\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) | ||
{ | ||
// | ||
} | ||
} |
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,10 @@ | ||
<?php | ||
|
||
namespace App\Events; | ||
|
||
use Illuminate\Queue\SerializesModels; | ||
|
||
abstract class Event | ||
{ | ||
use SerializesModels; | ||
} |
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 | ||
|
||
namespace App\Events; | ||
|
||
class ExampleEvent extends Event | ||
{ | ||
/** | ||
* Create a new event instance. | ||
* | ||
* @return void | ||
*/ | ||
public function __construct() | ||
{ | ||
// | ||
} | ||
} |
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,54 @@ | ||
<?php | ||
|
||
namespace App\Exceptions; | ||
|
||
use Illuminate\Auth\Access\AuthorizationException; | ||
use Illuminate\Database\Eloquent\ModelNotFoundException; | ||
use Illuminate\Validation\ValidationException; | ||
use Laravel\Lumen\Exceptions\Handler as ExceptionHandler; | ||
use Symfony\Component\HttpKernel\Exception\HttpException; | ||
use Throwable; | ||
|
||
class Handler extends ExceptionHandler | ||
{ | ||
/** | ||
* A list of the exception types that should not be reported. | ||
* | ||
* @var array | ||
*/ | ||
protected $dontReport = [ | ||
AuthorizationException::class, | ||
HttpException::class, | ||
ModelNotFoundException::class, | ||
ValidationException::class, | ||
]; | ||
|
||
/** | ||
* 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); | ||
} | ||
|
||
/** | ||
* 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); | ||
} | ||
} |
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,10 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers; | ||
|
||
use Laravel\Lumen\Routing\Controller as BaseController; | ||
|
||
class Controller extends BaseController | ||
{ | ||
// | ||
} |
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 | ||
|
||
namespace App\Http\Controllers; | ||
|
||
class ExampleController extends Controller | ||
{ | ||
/** | ||
* Create a new controller instance. | ||
* | ||
* @return void | ||
*/ | ||
public function __construct() | ||
{ | ||
// | ||
} | ||
|
||
// | ||
} |
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,44 @@ | ||
<?php | ||
|
||
namespace App\Http\Middleware; | ||
|
||
use Closure; | ||
use Illuminate\Contracts\Auth\Factory as Auth; | ||
|
||
class Authenticate | ||
{ | ||
/** | ||
* The authentication guard factory instance. | ||
* | ||
* @var \Illuminate\Contracts\Auth\Factory | ||
*/ | ||
protected $auth; | ||
|
||
/** | ||
* Create a new middleware instance. | ||
* | ||
* @param \Illuminate\Contracts\Auth\Factory $auth | ||
* @return void | ||
*/ | ||
public function __construct(Auth $auth) | ||
{ | ||
$this->auth = $auth; | ||
} | ||
|
||
/** | ||
* 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()) { | ||
return response('Unauthorized.', 401); | ||
} | ||
|
||
return $next($request); | ||
} | ||
} |
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,20 @@ | ||
<?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); | ||
} | ||
} |
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,26 @@ | ||
<?php | ||
|
||
namespace App\Jobs; | ||
|
||
class ExampleJob extends Job | ||
{ | ||
/** | ||
* Create a new job instance. | ||
* | ||
* @return void | ||
*/ | ||
public function __construct() | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Execute the job. | ||
* | ||
* @return void | ||
*/ | ||
public function handle() | ||
{ | ||
// | ||
} | ||
} |
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\Jobs; | ||
|
||
use Illuminate\Bus\Queueable; | ||
use Illuminate\Contracts\Queue\ShouldQueue; | ||
use Illuminate\Queue\InteractsWithQueue; | ||
use Illuminate\Queue\SerializesModels; | ||
|
||
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; | ||
} |
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,31 @@ | ||
<?php | ||
|
||
namespace App\Listeners; | ||
|
||
use App\Events\ExampleEvent; | ||
use Illuminate\Contracts\Queue\ShouldQueue; | ||
use Illuminate\Queue\InteractsWithQueue; | ||
|
||
class ExampleListener | ||
{ | ||
/** | ||
* Create the event listener. | ||
* | ||
* @return void | ||
*/ | ||
public function __construct() | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Handle the event. | ||
* | ||
* @param \App\Events\ExampleEvent $event | ||
* @return void | ||
*/ | ||
public function handle(ExampleEvent $event) | ||
{ | ||
// | ||
} | ||
} |
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,33 @@ | ||
<?php | ||
|
||
namespace App\Models; | ||
|
||
use Illuminate\Auth\Authenticatable; | ||
use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract; | ||
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract; | ||
use Illuminate\Database\Eloquent\Factories\HasFactory; | ||
use Illuminate\Database\Eloquent\Model; | ||
use Laravel\Lumen\Auth\Authorizable; | ||
|
||
class User extends Model implements AuthenticatableContract, AuthorizableContract | ||
{ | ||
use Authenticatable, Authorizable, HasFactory; | ||
|
||
/** | ||
* The attributes that are mass assignable. | ||
* | ||
* @var array | ||
*/ | ||
protected $fillable = [ | ||
'name', 'email', | ||
]; | ||
|
||
/** | ||
* The attributes excluded from the model's JSON form. | ||
* | ||
* @var array | ||
*/ | ||
protected $hidden = [ | ||
'password', | ||
]; | ||
} |
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 | ||
|
||
namespace App\Providers; | ||
|
||
use Illuminate\Support\ServiceProvider; | ||
|
||
class AppServiceProvider extends ServiceProvider | ||
{ | ||
/** | ||
* Register any application services. | ||
* | ||
* @return void | ||
*/ | ||
public function register() | ||
{ | ||
// | ||
} | ||
} |
Oops, something went wrong.