This repository has been archived by the owner on Apr 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 128
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
0 parents
commit 6ffee67
Showing
84 changed files
with
12,316 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,32 @@ | ||
APP_ENV=local | ||
APP_KEY= | ||
APP_DEBUG=true | ||
APP_LOG_LEVEL=debug | ||
APP_URL=http://localhost | ||
|
||
DB_CONNECTION=mysql | ||
DB_HOST=127.0.0.1 | ||
DB_PORT=3306 | ||
DB_DATABASE=homestead | ||
DB_USERNAME=homestead | ||
DB_PASSWORD=secret | ||
|
||
BROADCAST_DRIVER=log | ||
CACHE_DRIVER=file | ||
SESSION_DRIVER=file | ||
QUEUE_DRIVER=sync | ||
|
||
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 | ||
|
||
PUSHER_APP_ID= | ||
PUSHER_APP_KEY= | ||
PUSHER_APP_SECRET= |
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,10 @@ | ||
/node_modules | ||
/public/storage | ||
/public/hot | ||
/storage/*.key | ||
/vendor | ||
/.idea | ||
/.vagrant | ||
Homestead.json | ||
Homestead.yaml | ||
.env |
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 | ||
|
||
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 Closure based commands for the application. | ||
* | ||
* @return void | ||
*/ | ||
protected function 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,46 @@ | ||
<?php | ||
|
||
namespace App\Events; | ||
|
||
use Illuminate\Broadcasting\Channel; | ||
use Illuminate\Queue\SerializesModels; | ||
use Illuminate\Broadcasting\PrivateChannel; | ||
use Illuminate\Broadcasting\PresenceChannel; | ||
use Illuminate\Foundation\Events\Dispatchable; | ||
use Illuminate\Broadcasting\InteractsWithSockets; | ||
use Illuminate\Contracts\Broadcasting\ShouldBroadcast; | ||
|
||
class StatusActionEvent implements ShouldBroadcast | ||
{ | ||
use Dispatchable, InteractsWithSockets, SerializesModels; | ||
|
||
public $username; | ||
|
||
public $verb; | ||
|
||
public $message; | ||
|
||
/** | ||
* Create a new event instance. | ||
* | ||
* @return void | ||
*/ | ||
public function __construct($username, $verb) | ||
{ | ||
$this->username = $username; | ||
|
||
$this->verb = $verb; | ||
|
||
$this->message = "{$username} {$verb} your status"; | ||
} | ||
|
||
/** | ||
* Get the channels the event should broadcast on. | ||
* | ||
* @return Channel|array | ||
*/ | ||
public function broadcastOn() | ||
{ | ||
return ['lwn-status-demo']; | ||
} | ||
} |
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,65 @@ | ||
<?php | ||
|
||
namespace App\Exceptions; | ||
|
||
use Exception; | ||
use Illuminate\Auth\AuthenticationException; | ||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; | ||
|
||
class Handler extends ExceptionHandler | ||
{ | ||
/** | ||
* A list of the exception types that should not be reported. | ||
* | ||
* @var array | ||
*/ | ||
protected $dontReport = [ | ||
\Illuminate\Auth\AuthenticationException::class, | ||
\Illuminate\Auth\Access\AuthorizationException::class, | ||
\Symfony\Component\HttpKernel\Exception\HttpException::class, | ||
\Illuminate\Database\Eloquent\ModelNotFoundException::class, | ||
\Illuminate\Session\TokenMismatchException::class, | ||
\Illuminate\Validation\ValidationException::class, | ||
]; | ||
|
||
/** | ||
* Report or log an exception. | ||
* | ||
* This is a great spot to send exceptions to Sentry, Bugsnag, etc. | ||
* | ||
* @param \Exception $exception | ||
* @return void | ||
*/ | ||
public function report(Exception $exception) | ||
{ | ||
parent::report($exception); | ||
} | ||
|
||
/** | ||
* Render an exception into an HTTP response. | ||
* | ||
* @param \Illuminate\Http\Request $request | ||
* @param \Exception $exception | ||
* @return \Illuminate\Http\Response | ||
*/ | ||
public function render($request, Exception $exception) | ||
{ | ||
return parent::render($request, $exception); | ||
} | ||
|
||
/** | ||
* Convert an authentication exception into an unauthenticated response. | ||
* | ||
* @param \Illuminate\Http\Request $request | ||
* @param \Illuminate\Auth\AuthenticationException $exception | ||
* @return \Illuminate\Http\Response | ||
*/ | ||
protected function unauthenticated($request, AuthenticationException $exception) | ||
{ | ||
if ($request->expectsJson()) { | ||
return response()->json(['error' => 'Unauthenticated.'], 401); | ||
} | ||
|
||
return redirect()->guest(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,32 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers\Auth; | ||
|
||
use App\Http\Controllers\Controller; | ||
use Illuminate\Foundation\Auth\SendsPasswordResetEmails; | ||
|
||
class ForgotPasswordController extends Controller | ||
{ | ||
/* | ||
|-------------------------------------------------------------------------- | ||
| Password Reset Controller | ||
|-------------------------------------------------------------------------- | ||
| | ||
| This controller is responsible for handling password reset emails and | ||
| includes a trait which assists in sending these notifications from | ||
| your application to your users. Feel free to explore this trait. | ||
| | ||
*/ | ||
|
||
use SendsPasswordResetEmails; | ||
|
||
/** | ||
* Create a new controller instance. | ||
* | ||
* @return void | ||
*/ | ||
public function __construct() | ||
{ | ||
$this->middleware('guest'); | ||
} | ||
} |
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,39 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers\Auth; | ||
|
||
use App\Http\Controllers\Controller; | ||
use Illuminate\Foundation\Auth\AuthenticatesUsers; | ||
|
||
class LoginController extends Controller | ||
{ | ||
/* | ||
|-------------------------------------------------------------------------- | ||
| Login Controller | ||
|-------------------------------------------------------------------------- | ||
| | ||
| This controller handles authenticating users for the application and | ||
| redirecting them to your home screen. The controller uses a trait | ||
| to conveniently provide its functionality to your applications. | ||
| | ||
*/ | ||
|
||
use AuthenticatesUsers; | ||
|
||
/** | ||
* Where to redirect users after login. | ||
* | ||
* @var string | ||
*/ | ||
protected $redirectTo = '/home'; | ||
|
||
/** | ||
* Create a new controller instance. | ||
* | ||
* @return void | ||
*/ | ||
public function __construct() | ||
{ | ||
$this->middleware('guest', ['except' => 'logout']); | ||
} | ||
} |
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,71 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers\Auth; | ||
|
||
use App\User; | ||
use App\Http\Controllers\Controller; | ||
use Illuminate\Support\Facades\Validator; | ||
use Illuminate\Foundation\Auth\RegistersUsers; | ||
|
||
class RegisterController extends Controller | ||
{ | ||
/* | ||
|-------------------------------------------------------------------------- | ||
| Register Controller | ||
|-------------------------------------------------------------------------- | ||
| | ||
| This controller handles the registration of new users as well as their | ||
| validation and creation. By default this controller uses a trait to | ||
| provide this functionality without requiring any additional code. | ||
| | ||
*/ | ||
|
||
use RegistersUsers; | ||
|
||
/** | ||
* Where to redirect users after registration. | ||
* | ||
* @var string | ||
*/ | ||
protected $redirectTo = '/home'; | ||
|
||
/** | ||
* Create a new controller instance. | ||
* | ||
* @return void | ||
*/ | ||
public function __construct() | ||
{ | ||
$this->middleware('guest'); | ||
} | ||
|
||
/** | ||
* Get a validator for an incoming registration request. | ||
* | ||
* @param array $data | ||
* @return \Illuminate\Contracts\Validation\Validator | ||
*/ | ||
protected function validator(array $data) | ||
{ | ||
return Validator::make($data, [ | ||
'name' => 'required|max:255', | ||
'email' => 'required|email|max:255|unique:users', | ||
'password' => 'required|min:6|confirmed', | ||
]); | ||
} | ||
|
||
/** | ||
* Create a new user instance after a valid registration. | ||
* | ||
* @param array $data | ||
* @return User | ||
*/ | ||
protected function create(array $data) | ||
{ | ||
return User::create([ | ||
'name' => $data['name'], | ||
'email' => $data['email'], | ||
'password' => bcrypt($data['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,39 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers\Auth; | ||
|
||
use App\Http\Controllers\Controller; | ||
use Illuminate\Foundation\Auth\ResetsPasswords; | ||
|
||
class ResetPasswordController extends Controller | ||
{ | ||
/* | ||
|-------------------------------------------------------------------------- | ||
| Password Reset Controller | ||
|-------------------------------------------------------------------------- | ||
| | ||
| This controller is responsible for handling password reset requests | ||
| and uses a simple trait to include this behavior. You're free to | ||
| explore this trait and override any methods you wish to tweak. | ||
| | ||
*/ | ||
|
||
use ResetsPasswords; | ||
|
||
/** | ||
* Where to redirect users after resetting their password. | ||
* | ||
* @var string | ||
*/ | ||
protected $redirectTo = '/home'; | ||
|
||
/** | ||
* Create a new controller instance. | ||
* | ||
* @return void | ||
*/ | ||
public function __construct() | ||
{ | ||
$this->middleware('guest'); | ||
} | ||
} |
Oops, something went wrong.