Skip to content

Commit 968a53c

Browse files
committed
first commit
0 parents  commit 968a53c

40 files changed

+6022
-0
lines changed

.editorconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
insert_final_newline = true
7+
indent_style = space
8+
indent_size = 4
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false
13+
14+
[*.{yml,yaml}]
15+
indent_size = 2

.env.example

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
APP_NAME=Lumen
2+
APP_ENV=local
3+
APP_KEY=
4+
APP_DEBUG=true
5+
APP_URL=http://localhost
6+
APP_TIMEZONE=UTC
7+
8+
LOG_CHANNEL=stack
9+
LOG_SLACK_WEBHOOK_URL=
10+
11+
DB_CONNECTION=mysql
12+
DB_HOST=127.0.0.1
13+
DB_PORT=3306
14+
DB_DATABASE=homestead
15+
DB_USERNAME=homestead
16+
DB_PASSWORD=secret
17+
18+
CACHE_DRIVER=file
19+
QUEUE_CONNECTION=sync

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/vendor
2+
/.idea
3+
Homestead.json
4+
Homestead.yaml
5+
.env
6+
.phpunit.result.cache

.styleci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
php:
2+
preset: laravel
3+
disabled:
4+
- unused_use
5+
js: true
6+
css: true

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Lumen PHP Framework
2+
3+
[![Build Status](https://travis-ci.org/laravel/lumen-framework.svg)](https://travis-ci.org/laravel/lumen-framework)
4+
[![Total Downloads](https://poser.pugx.org/laravel/lumen-framework/d/total.svg)](https://packagist.org/packages/laravel/lumen-framework)
5+
[![Latest Stable Version](https://poser.pugx.org/laravel/lumen-framework/v/stable.svg)](https://packagist.org/packages/laravel/lumen-framework)
6+
[![License](https://poser.pugx.org/laravel/lumen-framework/license.svg)](https://packagist.org/packages/laravel/lumen-framework)
7+
8+
Laravel Lumen is a stunningly fast PHP micro-framework for building web applications with expressive, elegant syntax. We believe development must be an enjoyable, creative experience to be truly fulfilling. Lumen attempts to take the pain out of development by easing common tasks used in the majority of web projects, such as routing, database abstraction, queueing, and caching.
9+
10+
## Official Documentation
11+
12+
Documentation for the framework can be found on the [Lumen website](https://lumen.laravel.com/docs).
13+
14+
## Contributing
15+
16+
Thank you for considering contributing to Lumen! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions).
17+
18+
## Security Vulnerabilities
19+
20+
If you discover a security vulnerability within Lumen, please send an e-mail to Taylor Otwell at [email protected]. All security vulnerabilities will be promptly addressed.
21+
22+
## License
23+
24+
The Lumen framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
25+
# lumen-rest-api

app/Console/Commands/.gitkeep

Whitespace-only changes.

app/Console/Kernel.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
3+
namespace App\Console;
4+
5+
use Illuminate\Console\Scheduling\Schedule;
6+
use Laravel\Lumen\Console\Kernel as ConsoleKernel;
7+
8+
class Kernel extends ConsoleKernel
9+
{
10+
/**
11+
* The Artisan commands provided by your application.
12+
*
13+
* @var array
14+
*/
15+
protected $commands = [
16+
//
17+
];
18+
19+
/**
20+
* Define the application's command schedule.
21+
*
22+
* @param \Illuminate\Console\Scheduling\Schedule $schedule
23+
* @return void
24+
*/
25+
protected function schedule(Schedule $schedule)
26+
{
27+
//
28+
}
29+
}

app/Events/Event.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
namespace App\Events;
4+
5+
use Illuminate\Queue\SerializesModels;
6+
7+
abstract class Event
8+
{
9+
use SerializesModels;
10+
}

app/Events/ExampleEvent.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
namespace App\Events;
4+
5+
class ExampleEvent extends Event
6+
{
7+
/**
8+
* Create a new event instance.
9+
*
10+
* @return void
11+
*/
12+
public function __construct()
13+
{
14+
//
15+
}
16+
}

app/Exceptions/Handler.php

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<?php
2+
3+
namespace App\Exceptions;
4+
5+
use http\Exception;
6+
use Illuminate\Auth\Access\AuthorizationException;
7+
use Illuminate\Database\Eloquent\ModelNotFoundException;
8+
use Illuminate\Validation\ValidationException;
9+
use Laravel\Lumen\Exceptions\Handler as ExceptionHandler;
10+
use Symfony\Component\HttpKernel\Exception\HttpException;
11+
use Throwable;
12+
13+
class Handler extends ExceptionHandler
14+
{
15+
16+
/**
17+
* A list of the exception types that should not be reported.
18+
*
19+
* @var array
20+
*/
21+
protected $dontReport = [
22+
AuthorizationException::class,
23+
HttpException::class,
24+
ModelNotFoundException::class,
25+
ValidationException::class,
26+
];
27+
28+
/**
29+
* Report or log an exception.
30+
*
31+
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
32+
*
33+
* @param \Throwable $exception
34+
*
35+
* @return void
36+
*
37+
* @throws \Exception
38+
*/
39+
public function report(Throwable $exception)
40+
{
41+
42+
parent::report($exception);
43+
}
44+
45+
/**
46+
* Render an exception into an HTTP response.
47+
*
48+
* @param \Illuminate\Http\Request $request
49+
* @param \Throwable $exception
50+
*
51+
* @return \Illuminate\Http\Response|\Illuminate\Http\JsonResponse
52+
*
53+
* @throws \Throwable
54+
*/
55+
public function render($request, Exception $e)
56+
{
57+
58+
$rendered = parent::render($request, $e);
59+
60+
return response()->json([
61+
'error' => [
62+
'code' => $rendered->getStatusCode(),
63+
'message' => $e->getMessage(),
64+
]
65+
], $rendered->getStatusCode());
66+
}
67+
}

0 commit comments

Comments
 (0)