Skip to content
This repository was archived by the owner on Dec 11, 2020. It is now read-only.

Commit c91e4d6

Browse files
committed
initial commit with everything in place
0 parents  commit c91e4d6

File tree

86 files changed

+6400
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+6400
-0
lines changed

.env.example

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
APP_ENV=local
2+
APP_KEY=
3+
APP_DEBUG=true
4+
APP_LOG_LEVEL=debug
5+
APP_URL=http://localhost
6+
7+
DB_CONNECTION=mysql
8+
DB_HOST=127.0.0.1
9+
DB_PORT=3306
10+
DB_DATABASE=homestead
11+
DB_USERNAME=homestead
12+
DB_PASSWORD=secret
13+
14+
BROADCAST_DRIVER=log
15+
CACHE_DRIVER=file
16+
SESSION_DRIVER=file
17+
QUEUE_DRIVER=sync
18+
19+
REDIS_HOST=127.0.0.1
20+
REDIS_PASSWORD=null
21+
REDIS_PORT=6379
22+
23+
MAIL_DRIVER=smtp
24+
MAIL_HOST=mailtrap.io
25+
MAIL_PORT=2525
26+
MAIL_USERNAME=null
27+
MAIL_PASSWORD=null
28+
MAIL_ENCRYPTION=null
29+
30+
PUSHER_KEY=
31+
PUSHER_SECRET=
32+
PUSHER_APP_ID=

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
* text=auto
2+
*.css linguist-vendored
3+
*.scss linguist-vendored

.gitignore

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

app/Console/Kernel.php

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?php
2+
3+
namespace App\Console;
4+
5+
use Illuminate\Console\Scheduling\Schedule;
6+
use Illuminate\Foundation\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+
// $schedule->command('inspire')
28+
// ->hourly();
29+
}
30+
31+
/**
32+
* Register the Closure based commands for the application.
33+
*
34+
* @return void
35+
*/
36+
protected function commands()
37+
{
38+
require base_path('routes/console.php');
39+
}
40+
}

app/Data/.gitkeep

Whitespace-only changes.

app/Data/Models/User.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\Data\Models;
4+
5+
use Illuminate\Notifications\Notifiable;
6+
use Illuminate\Foundation\Auth\User as Authenticatable;
7+
8+
class User extends Authenticatable
9+
{
10+
use Notifiable;
11+
12+
/**
13+
* The attributes that are mass assignable.
14+
*
15+
* @var array
16+
*/
17+
protected $fillable = [
18+
'name', 'email', 'password',
19+
];
20+
21+
/**
22+
* The attributes that should be hidden for arrays.
23+
*
24+
* @var array
25+
*/
26+
protected $hidden = [
27+
'password', 'remember_token',
28+
];
29+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
3+
namespace App\Domains\Http\Jobs;
4+
5+
use Illuminate\Routing\ResponseFactory;
6+
7+
class RespondWithJsonErrorJob extends RespondWithJsonJob
8+
{
9+
public function __construct($message = 'An error occurred', $code = 400, $status = 400, $headers = [], $options = 0)
10+
{
11+
$this->content = [
12+
'status' => $status,
13+
'error' => [
14+
'code' => $code,
15+
'message' => $message,
16+
],
17+
];
18+
19+
$this->status = $status;
20+
$this->headers = $headers;
21+
$this->options = $options;
22+
}
23+
24+
public function handle(ResponseFactory $response)
25+
{
26+
return $response->json($this->content, $this->status, $this->headers, $this->options);
27+
}
28+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
namespace App\Domains\Http\Jobs;
4+
5+
use Lucid\Foundation\Job;
6+
use Illuminate\Routing\ResponseFactory;
7+
8+
class RespondWithJsonJob extends Job
9+
{
10+
private $status;
11+
private $content;
12+
private $headers;
13+
private $options;
14+
15+
public function __construct($content, $status = 200, array $headers = [], $options = 0)
16+
{
17+
$this->content = $content;
18+
$this->status = $status;
19+
$this->headers = $headers;
20+
$this->options = $options;
21+
}
22+
23+
public function handle(ResponseFactory $factory)
24+
{
25+
$response = [
26+
'data' => $this->content,
27+
'status' => $this->status,
28+
];
29+
30+
return $factory->json($response, $this->status, $this->headers, $this->options);
31+
}
32+
}

app/Exceptions/Handler.php

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

app/Features/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)