@ -1,32 +0,0 @@ | |||
<?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'); | |||
} | |||
} |
@ -1,39 +0,0 @@ | |||
<?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'); | |||
} | |||
} |
@ -1,72 +0,0 @@ | |||
<?php | |||
namespace App\Http\Controllers\Auth; | |||
use App\User; | |||
use App\Http\Controllers\Controller; | |||
use Illuminate\Support\Facades\Hash; | |||
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|string|max:255', | |||
'email' => 'required|string|email|max:255|unique:users', | |||
'password' => 'required|string|min:6|confirmed', | |||
]); | |||
} | |||
/** | |||
* Create a new user instance after a valid registration. | |||
* | |||
* @param array $data | |||
* @return \App\User | |||
*/ | |||
protected function create(array $data) | |||
{ | |||
return User::create([ | |||
'name' => $data['name'], | |||
'email' => $data['email'], | |||
'password' => Hash::make($data['password']), | |||
]); | |||
} | |||
} |
@ -1,39 +0,0 @@ | |||
<?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'); | |||
} | |||
} |
@ -1,41 +0,0 @@ | |||
<?php | |||
namespace App\Http\Controllers\Auth; | |||
use App\Http\Controllers\Controller; | |||
use Illuminate\Foundation\Auth\VerifiesEmails; | |||
class VerificationController extends Controller | |||
{ | |||
/* | |||
|-------------------------------------------------------------------------- | |||
| Email Verification Controller | |||
|-------------------------------------------------------------------------- | |||
| | |||
| This controller is responsible for handling email verification for any | |||
| user that recently registered with the application. Emails may also | |||
| be re-sent if the user didn't receive the original email message. | |||
| | |||
*/ | |||
use VerifiesEmails; | |||
/** | |||
* Where to redirect users after verification. | |||
* | |||
* @var string | |||
*/ | |||
protected $redirectTo = '/home'; | |||
/** | |||
* Create a new controller instance. | |||
* | |||
* @return void | |||
*/ | |||
public function __construct() | |||
{ | |||
$this->middleware('auth'); | |||
$this->middleware('signed')->only('verify'); | |||
$this->middleware('throttle:6,1')->only('verify', 'resend'); | |||
} | |||
} |
@ -1,19 +0,0 @@ | |||
<?php | |||
namespace App\Http\Middleware; | |||
use Illuminate\Auth\Middleware\Authenticate as Middleware; | |||
class Authenticate extends Middleware | |||
{ | |||
/** | |||
* Get the path the user should be redirected to when they are not authenticated. | |||
* | |||
* @param \Illuminate\Http\Request $request | |||
* @return string | |||
*/ | |||
protected function redirectTo($request) | |||
{ | |||
return route('login'); | |||
} | |||
} |
@ -1,26 +0,0 @@ | |||
<?php | |||
namespace App\Http\Middleware; | |||
use Closure; | |||
use Illuminate\Support\Facades\Auth; | |||
class RedirectIfAuthenticated | |||
{ | |||
/** | |||
* 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 (Auth::guard($guard)->check()) { | |||
return redirect('/home'); | |||
} | |||
return $next($request); | |||
} | |||
} |
@ -1,23 +0,0 @@ | |||
<?php | |||
namespace App\Http\Middleware; | |||
use Illuminate\Http\Request; | |||
use Fideloper\Proxy\TrustProxies as Middleware; | |||
class TrustProxies extends Middleware | |||
{ | |||
/** | |||
* The trusted proxies for this application. | |||
* | |||
* @var array | |||
*/ | |||
protected $proxies; | |||
/** | |||
* The headers that should be used to detect proxies. | |||
* | |||
* @var int | |||
*/ | |||
protected $headers = Request::HEADER_X_FORWARDED_ALL; | |||
} |
@ -1,30 +0,0 @@ | |||
<?php | |||
namespace App\Providers; | |||
use Illuminate\Support\Facades\Gate; | |||
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider; | |||
class AuthServiceProvider extends ServiceProvider | |||
{ | |||
/** | |||
* The policy mappings for the application. | |||
* | |||
* @var array | |||
*/ | |||
protected $policies = [ | |||
'App\Model' => 'App\Policies\ModelPolicy', | |||
]; | |||
/** | |||
* Register any authentication / authorization services. | |||
* | |||
* @return void | |||
*/ | |||
public function boot() | |||
{ | |||
$this->registerPolicies(); | |||
// | |||
} | |||
} |
@ -1,21 +0,0 @@ | |||
<?php | |||
namespace App\Providers; | |||
use Illuminate\Support\ServiceProvider; | |||
use Illuminate\Support\Facades\Broadcast; | |||
class BroadcastServiceProvider extends ServiceProvider | |||
{ | |||
/** | |||
* Bootstrap any application services. | |||
* | |||
* @return void | |||
*/ | |||
public function boot() | |||
{ | |||
Broadcast::routes(); | |||
require base_path('routes/channels.php'); | |||
} | |||
} |
@ -1,30 +0,0 @@ | |||
<?php | |||
namespace App; | |||
use Illuminate\Notifications\Notifiable; | |||
use Illuminate\Contracts\Auth\MustVerifyEmail; | |||
use Illuminate\Foundation\Auth\User as Authenticatable; | |||
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', | |||
]; | |||
} |
@ -1,59 +0,0 @@ | |||
<?php | |||
return [ | |||
/* | |||
|-------------------------------------------------------------------------- | |||
| Default Broadcaster | |||
|-------------------------------------------------------------------------- | |||
| | |||
| This option controls the default broadcaster that will be used by the | |||
| framework when an event needs to be broadcast. You may set this to | |||
| any of the connections defined in the "connections" array below. | |||
| | |||
| Supported: "pusher", "redis", "log", "null" | |||
| | |||
*/ | |||
'default' => env('BROADCAST_DRIVER', 'null'), | |||
/* | |||
|-------------------------------------------------------------------------- | |||
| Broadcast Connections | |||
|-------------------------------------------------------------------------- | |||
| | |||
| Here you may define all of the broadcast connections that will be used | |||
| to broadcast events to other systems or over websockets. Samples of | |||
| each available type of connection are provided inside this array. | |||
| | |||
*/ | |||
'connections' => [ | |||
'pusher' => [ | |||
'driver' => 'pusher', | |||
'key' => env('PUSHER_APP_KEY'), | |||
'secret' => env('PUSHER_APP_SECRET'), | |||
'app_id' => env('PUSHER_APP_ID'), | |||
'options' => [ | |||
'cluster' => env('PUSHER_APP_CLUSTER'), | |||
'encrypted' => true, | |||
], | |||
], | |||
'redis' => [ | |||
'driver' => 'redis', | |||
'connection' => 'default', | |||
], | |||
'log' => [ | |||
'driver' => 'log', | |||
], | |||
'null' => [ | |||
'driver' => 'null', | |||
], | |||
], | |||
]; |
@ -1,24 +0,0 @@ | |||
<?php | |||
use Faker\Generator as Faker; | |||
/* | |||
|-------------------------------------------------------------------------- | |||
| Model Factories | |||
|-------------------------------------------------------------------------- | |||
| | |||
| This directory should contain each of the model factory definitions for | |||
| your application. Factories provide a convenient way to generate new | |||
| model instances for testing / seeding your application's database. | |||
| | |||
*/ | |||
$factory->define(App\User::class, function (Faker $faker) { | |||
return [ | |||
'name' => $faker->name, | |||
'email' => $faker->unique()->safeEmail, | |||
'email_verified_at' => now(), | |||
'password' => '$2y$10$TKh8H1.PfQx37YgCzwiKb.KjNyWgaHb9cbcoQgdIVFlYg7B77UdFm', // secret | |||
'remember_token' => str_random(10), | |||
]; | |||
}); |
@ -1,36 +0,0 @@ | |||
<?php | |||
use Illuminate\Support\Facades\Schema; | |||
use Illuminate\Database\Schema\Blueprint; | |||
use Illuminate\Database\Migrations\Migration; | |||
class CreateUsersTable extends Migration | |||
{ | |||
/** | |||
* Run the migrations. | |||
* | |||
* @return void | |||
*/ | |||
public function up() | |||
{ | |||
Schema::create('users', function (Blueprint $table) { | |||
$table->increments('id'); | |||
$table->string('name'); | |||
$table->string('email')->unique(); | |||
$table->timestamp('email_verified_at')->nullable(); | |||
$table->string('password'); | |||
$table->rememberToken(); | |||
$table->timestamps(); | |||
}); | |||
} | |||
/** | |||
* Reverse the migrations. | |||
* | |||
* @return void | |||
*/ | |||
public function down() | |||
{ | |||
Schema::dropIfExists('users'); | |||
} | |||
} |
@ -1,32 +0,0 @@ | |||
<?php | |||
use Illuminate\Support\Facades\Schema; | |||
use Illuminate\Database\Schema\Blueprint; | |||
use Illuminate\Database\Migrations\Migration; | |||
class CreatePasswordResetsTable extends Migration | |||
{ | |||
/** | |||
* Run the migrations. | |||
* | |||
* @return void | |||
*/ | |||
public function up() | |||
{ | |||
Schema::create('password_resets', function (Blueprint $table) { | |||
$table->string('email')->index(); | |||
$table->string('token'); | |||
$table->timestamp('created_at')->nullable(); | |||
}); | |||
} | |||
/** | |||
* Reverse the migrations. | |||
* | |||
* @return void | |||
*/ | |||
public function down() | |||
{ | |||
Schema::dropIfExists('password_resets'); | |||
} | |||
} |
@ -1,22 +0,0 @@ | |||
/** | |||
* First we will load all of this project's JavaScript dependencies which | |||
* includes Vue and other libraries. It is a great starting point when | |||
* building robust, powerful web applications using Vue and Laravel. | |||
*/ | |||
require('./bootstrap'); | |||
window.Vue = require('vue'); | |||
/** | |||
* Next, we will create a fresh Vue application instance and attach it to | |||
* the page. Then, you may begin adding components to this application | |||
* or customize the JavaScript scaffolding to fit your unique needs. | |||
*/ | |||
Vue.component('example-component', require('./components/ExampleComponent.vue')); | |||
const app = new Vue({ | |||
el: '#app' | |||
}); |
@ -1,56 +0,0 @@ | |||
window._ = require('lodash'); | |||
window.Popper = require('popper.js').default; | |||
/** | |||
* We'll load jQuery and the Bootstrap jQuery plugin which provides support | |||
* for JavaScript based Bootstrap features such as modals and tabs. This | |||
* code may be modified to fit the specific needs of your application. | |||
*/ | |||
try { | |||
window.$ = window.jQuery = require('jquery'); | |||
require('bootstrap'); | |||
} catch (e) {} | |||
/** | |||
* We'll load the axios HTTP library which allows us to easily issue requests | |||
* to our Laravel back-end. This library automatically handles sending the | |||
* CSRF token as a header based on the value of the "XSRF" token cookie. | |||
*/ | |||
window.axios = require('axios'); | |||
window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; | |||
/** | |||
* Next we will register the CSRF Token as a common header with Axios so that | |||
* all outgoing HTTP requests automatically have it attached. This is just | |||
* a simple convenience so we don't have to attach every token manually. | |||
*/ | |||
let token = document.head.querySelector('meta[name="csrf-token"]'); | |||
if (token) { | |||
window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content; | |||
} else { | |||
console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token'); | |||
} | |||
/** | |||
* Echo exposes an expressive API for subscribing to channels and listening | |||
* for events that are broadcast by Laravel. Echo and event broadcasting | |||
* allows your team to easily build robust real-time web applications. | |||
*/ | |||
// import Echo from 'laravel-echo' | |||
// window.Pusher = require('pusher-js'); | |||
// window.Echo = new Echo({ | |||
// broadcaster: 'pusher', | |||
// key: process.env.MIX_PUSHER_APP_KEY, | |||
// cluster: process.env.MIX_PUSHER_APP_CLUSTER, | |||
// encrypted: true | |||
// }); |
@ -1,23 +0,0 @@ | |||
<template> | |||
<div class="container"> | |||
<div class="row justify-content-center"> | |||
<div class="col-md-8"> | |||
<div class="card card-default"> | |||
<div class="card-header">Example Component</div> | |||
<div class="card-body"> | |||
I'm an example component. | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
</template> | |||
<script> | |||
export default { | |||
mounted() { | |||
console.log('Component mounted.') | |||
} | |||
} | |||
</script> |
@ -1,19 +0,0 @@ | |||
<?php | |||
return [ | |||
/* | |||
|-------------------------------------------------------------------------- | |||
| Authentication Language Lines | |||
|-------------------------------------------------------------------------- | |||
| | |||
| The following language lines are used during authentication for various | |||
| messages that we need to display to the user. You are free to modify | |||
| these language lines according to your application's requirements. | |||
| | |||
*/ | |||
'failed' => 'These credentials do not match our records.', | |||
'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', | |||
]; |
@ -1,19 +0,0 @@ | |||
<?php | |||
return [ | |||
/* | |||
|-------------------------------------------------------------------------- | |||
| Pagination Language Lines | |||
|-------------------------------------------------------------------------- | |||
| | |||
| The following language lines are used by the paginator library to build | |||
| the simple pagination links. You are free to change them to anything | |||
| you want to customize your views to better match your application. | |||
| | |||
*/ | |||
'previous' => '« Previous', | |||
'next' => 'Next »', | |||
]; |
@ -1,22 +0,0 @@ | |||
<?php | |||
return [ | |||
/* | |||
|-------------------------------------------------------------------------- | |||
| Password Reset Language Lines | |||
|-------------------------------------------------------------------------- | |||
| | |||
| The following language lines are the default lines which match reasons | |||
| that are given by the password broker for a password update attempt | |||
| has failed, such as for an invalid token or invalid new password. | |||
| | |||
*/ | |||
'password' => 'Passwords must be at least six characters and match the confirmation.', | |||
'reset' => 'Your password has been reset!', | |||
'sent' => 'We have e-mailed your password reset link!', | |||
'token' => 'This password reset token is invalid.', | |||
'user' => "We can't find a user with that e-mail address.", | |||
]; |
@ -1,18 +0,0 @@ | |||
<?php | |||
use Illuminate\Http\Request; | |||
/* | |||
|-------------------------------------------------------------------------- | |||
| API Routes | |||
|-------------------------------------------------------------------------- | |||
| | |||
| Here is where you can register API routes for your application. These | |||
| routes are loaded by the RouteServiceProvider within a group which | |||
| is assigned the "api" middleware group. Enjoy building your API! | |||
| | |||
*/ | |||
Route::middleware('auth:api')->get('/user', function (Request $request) { | |||
return $request->user(); | |||
}); |
@ -1,16 +0,0 @@ | |||
<?php | |||
/* | |||
|-------------------------------------------------------------------------- | |||
| Broadcast Channels | |||
|-------------------------------------------------------------------------- | |||
| | |||
| Here you may register all of the event broadcasting channels that your | |||
| application supports. The given channel authorization callbacks are | |||
| used to check if an authenticated user can listen to the channel. | |||
| | |||
*/ | |||
Broadcast::channel('App.User.{id}', function ($user, $id) { | |||
return (int) $user->id === (int) $id; | |||
}); |
@ -1,21 +0,0 @@ | |||
<?php | |||
namespace Tests\Feature; | |||
use Tests\TestCase; | |||
use Illuminate\Foundation\Testing\RefreshDatabase; | |||
class ExampleTest extends TestCase | |||
{ | |||
/** | |||
* A basic test example. | |||
* | |||
* @return void | |||
*/ | |||
public function testBasicTest() | |||
{ | |||
$response = $this->get('/'); | |||
$response->assertStatus(200); | |||
} | |||
} |
@ -1,19 +0,0 @@ | |||
<?php | |||
namespace Tests\Unit; | |||
use Tests\TestCase; | |||
use Illuminate\Foundation\Testing\RefreshDatabase; | |||
class ExampleTest extends TestCase | |||
{ | |||
/** | |||
* A basic test example. | |||
* | |||
* @return void | |||
*/ | |||
public function testBasicTest() | |||
{ | |||
$this->assertTrue(true); | |||
} | |||
} |
@ -1,15 +0,0 @@ | |||
const mix = require('laravel-mix'); | |||
/* | |||
|-------------------------------------------------------------------------- | |||
| Mix Asset Management | |||
|-------------------------------------------------------------------------- | |||
| | |||
| Mix provides a clean, fluent API for defining some Webpack build steps | |||
| for your Laravel application. By default, we are compiling the Sass | |||
| file for the application as well as bundling up all the JS files. | |||
| | |||
*/ | |||
mix.js('resources/js/app.js', 'public/js') | |||
.sass('resources/sass/app.scss', 'public/css'); |