mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Refactor signup flow (#2465)
This commit is contained in:
parent
e4f46c2a4e
commit
64041fb3cb
38
app/Events/Account/AccountCreated.php
Normal file
38
app/Events/Account/AccountCreated.php
Normal file
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace App\Events\Account;
|
||||
|
||||
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 AccountCreated
|
||||
{
|
||||
use Dispatchable, InteractsWithSockets, SerializesModels;
|
||||
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($user)
|
||||
{
|
||||
$this->user = $user;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the channels the event should broadcast on.
|
||||
*
|
||||
* @return \Illuminate\Broadcasting\Channel|array
|
||||
*/
|
||||
public function broadcastOn()
|
||||
{
|
||||
return new PrivateChannel('channel-name');
|
||||
}
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\Events;
|
||||
namespace App\Events\User;
|
||||
|
||||
use Illuminate\Broadcasting\Channel;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
@ -10,7 +10,7 @@ use Illuminate\Foundation\Events\Dispatchable;
|
||||
use Illuminate\Broadcasting\InteractsWithSockets;
|
||||
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
|
||||
|
||||
class UserSignedUp
|
||||
class UserCreated
|
||||
{
|
||||
use Dispatchable, InteractsWithSockets, SerializesModels;
|
||||
|
99
app/Http/Controllers/AccountController.php
Normal file
99
app/Http/Controllers/AccountController.php
Normal file
@ -0,0 +1,99 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\Requests\Account\CreateAccountRequest;
|
||||
use App\Jobs\Account\CreateAccount;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class AccountController extends Controller
|
||||
{
|
||||
use DispatchesJobs;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('guest');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
return view('signup.index');
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param \App\Http\Requests\SignupRequest $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(CreateAccountRequest $request)
|
||||
{
|
||||
|
||||
CreateAccount::dispatchNow($request);
|
||||
|
||||
//todo redirect to localization setup workflow
|
||||
return redirect()->route('user.dashboard');
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
@ -2,7 +2,9 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\Requests\Company\CreateCompanyRequest;
|
||||
use App\Http\Requests\SignupRequest;
|
||||
use App\Jobs\Company\CreateCompany;
|
||||
use App\Jobs\RegisterNewAccount;
|
||||
use Illuminate\Foundation\Bus\DispatchesJobs;
|
||||
use Illuminate\Http\Request;
|
||||
@ -45,13 +47,10 @@ class CompanyController extends Controller
|
||||
* @param \App\Http\Requests\SignupRequest $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(SignupRequest $request)
|
||||
public function store(CreateCompanyRequest $request)
|
||||
{
|
||||
|
||||
$user = RegisterNewAccount::dispatchNow($request);
|
||||
|
||||
//log user in
|
||||
Auth::guard('user')->login($user, true);
|
||||
CreateCompany::dispatchNow($request);
|
||||
|
||||
//todo redirect to localization setup workflow
|
||||
return redirect()->route('user.dashboard');
|
||||
|
@ -1,12 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
namespace App\Http\Requests\Account;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
use App\Http\ValidationRules\UniqueUserRule;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
|
||||
class SignupRequest extends Request
|
||||
class CreateAccountRequest extends Request
|
||||
{
|
||||
|
||||
/**
|
64
app/Jobs/Account/CreateAccount.php
Normal file
64
app/Jobs/Account/CreateAccount.php
Normal file
@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
namespace App\Jobs\Account;
|
||||
|
||||
use App\Events\Account\AccountCreated;
|
||||
use App\Jobs\User\CreateUser;
|
||||
use App\Jobs\Company\CreateCompany;
|
||||
|
||||
use App\Models\UserCompany;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Models\Account;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
|
||||
class CreateAccount
|
||||
{
|
||||
|
||||
use Dispatchable;
|
||||
|
||||
protected $request;
|
||||
|
||||
/**
|
||||
* Create a new job instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
|
||||
public function __construct(Request $request)
|
||||
{
|
||||
$this->request = $request;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the job.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
|
||||
$account = Account::create($this->request->toArray());
|
||||
|
||||
$user = CreateUser::dispatchNow($this->request, $account);
|
||||
|
||||
$company = CreateCompany::dispatchNow($this->request, $account);
|
||||
|
||||
UserCompany::create([
|
||||
'user_id' => $user->id,
|
||||
'account_id' => $account->id,
|
||||
'company_id' => $company->id,
|
||||
'is_admin' => true,
|
||||
'is_owner' => true,
|
||||
'permissions' => '',
|
||||
|
||||
]);
|
||||
|
||||
Auth::loginUsingId($user->id, true);
|
||||
|
||||
event(new AccountCreated());
|
||||
|
||||
return $user;
|
||||
}
|
||||
}
|
55
app/Jobs/Company/CreateCompany.php
Normal file
55
app/Jobs/Company/CreateCompany.php
Normal file
@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
namespace App\Jobs\Company;
|
||||
|
||||
use App\Events\Company\CompanyCreated;
|
||||
use App\Events\UserSignedUp;
|
||||
use App\Jobs\Account\CreateAccount;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Models\Account;
|
||||
use App\Models\Company;
|
||||
use App\Models\User;
|
||||
use App\Models\UserCompany;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
|
||||
class CreateCompany
|
||||
{
|
||||
|
||||
use Dispatchable;
|
||||
|
||||
protected $request;
|
||||
|
||||
protected $account;
|
||||
|
||||
/**
|
||||
* Create a new job instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
|
||||
public function __construct(Request $request, $account = false)
|
||||
{
|
||||
$this->request = $request;
|
||||
$this->account = $account;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the job.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
|
||||
$company = new Company();
|
||||
$company->name = $this->request->first_name . ' ' . $this->request->last_name;
|
||||
$company->account_id = $this->account->id;
|
||||
$company->company_key = strtolower(str_random(RANDOM_KEY_LENGTH));
|
||||
$company->ip = $this->request->ip();
|
||||
$company->save();
|
||||
|
||||
|
||||
return $company;
|
||||
}
|
||||
}
|
@ -1,81 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Jobs;
|
||||
|
||||
use App\Events\UserSignedUp;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Models\Account;
|
||||
use App\Models\Company;
|
||||
use App\Models\User;
|
||||
use App\Models\UserCompany;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
|
||||
class RegisterNewAccount
|
||||
{
|
||||
|
||||
use Dispatchable;
|
||||
|
||||
protected $request;
|
||||
|
||||
/**
|
||||
* Create a new job instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
|
||||
public function __construct(Request $request)
|
||||
{
|
||||
$this->request = $request;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the job.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
|
||||
$ac = new Account();
|
||||
$ac->utm_source = $this->request->input('utm_source');
|
||||
$ac->utm_medium = $this->request->input('utm_medium');
|
||||
$ac->utm_campaign = $this->request->input('utm_campaign');
|
||||
$ac->utm_term = $this->request->input('utm_term');
|
||||
$ac->utm_content = $this->request->input('utm_content');
|
||||
$ac->save();
|
||||
|
||||
$company = new Company();
|
||||
$company->account_id = $ac->id;
|
||||
$company->name = $this->request->first_name . ' ' . $this->request->last_name;
|
||||
$company->company_key = strtolower(str_random(RANDOM_KEY_LENGTH));
|
||||
$company->ip = $this->request->ip();
|
||||
$company->save();
|
||||
|
||||
$user = new User();
|
||||
$user->account_id = $ac->id;
|
||||
$user->password = Hash::make($this->request->input('password'));
|
||||
$user->accepted_terms_version = config('ninja.terms_version');
|
||||
$user->confirmation_code = strtolower(str_random(RANDOM_KEY_LENGTH));
|
||||
$user->db = config('database.default');
|
||||
$user->fill($this->request->all());
|
||||
$user->save();
|
||||
|
||||
$user_account = new UserCompany();
|
||||
$user_account->user_id = $user->id;
|
||||
$user_account->account_id = $ac->id;
|
||||
$user_account->company_id = $company->id;
|
||||
$user_account->is_owner = TRUE;
|
||||
$user_account->is_admin = TRUE;
|
||||
$user_account->permissions = '';
|
||||
$user_account->save();
|
||||
|
||||
$ac->default_company_id = $ac->id;
|
||||
$ac->save();
|
||||
|
||||
//fire account created job
|
||||
event(new UserSignedUp($user));
|
||||
|
||||
return $user;
|
||||
}
|
||||
}
|
50
app/Jobs/User/CreateUser.php
Normal file
50
app/Jobs/User/CreateUser.php
Normal file
@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace App\Jobs\User;
|
||||
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Models\Account;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
|
||||
class CreateUser
|
||||
{
|
||||
|
||||
use Dispatchable;
|
||||
|
||||
protected $request;
|
||||
|
||||
protected $account;
|
||||
/**
|
||||
* Create a new job instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
|
||||
public function __construct(Request $request, $account)
|
||||
{
|
||||
$this->request = $request;
|
||||
$this->account = $account;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the job.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
|
||||
$user = new User();
|
||||
$user->account_id = $this->account->id;
|
||||
$user->password = Hash::make($this->request->input('password'));
|
||||
$user->accepted_terms_version = config('ninja.terms_version');
|
||||
$user->confirmation_code = strtolower(str_random(RANDOM_KEY_LENGTH));
|
||||
$user->db = config('database.default');
|
||||
$user->fill($this->request->all());
|
||||
$user->save();
|
||||
|
||||
|
||||
return $user;
|
||||
}
|
||||
}
|
@ -2,10 +2,11 @@
|
||||
|
||||
namespace App\Listeners;
|
||||
|
||||
use App\Libraries\MultiDB;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
|
||||
class SendConfirmationNotification
|
||||
class SendVerificationNotification
|
||||
{
|
||||
/**
|
||||
* Create the event listener.
|
||||
@ -26,5 +27,7 @@ class SendConfirmationNotification
|
||||
public function handle($event)
|
||||
{
|
||||
//send confirmation email using $event->user
|
||||
MultiDB::setDB($event->user->db);
|
||||
|
||||
}
|
||||
}
|
@ -26,6 +26,11 @@ class Account extends Model
|
||||
'plan_paid',
|
||||
'plan_started',
|
||||
'plan_expires',
|
||||
'utm_source',
|
||||
'utm_medium',
|
||||
'utm_campaign',
|
||||
'utm_term',
|
||||
'utm_content',
|
||||
];
|
||||
|
||||
/**
|
||||
|
@ -9,7 +9,7 @@ use Illuminate\Contracts\Auth\MustVerifyEmail;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Laracasts\Presenter\PresentableTrait;
|
||||
|
||||
class User extends Authenticatable
|
||||
class User extends Authenticatable implements MustVerifyEmail
|
||||
{
|
||||
use Notifiable;
|
||||
use SoftDeletes;
|
||||
|
@ -6,5 +6,6 @@ use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class UserCompany extends Model
|
||||
{
|
||||
//
|
||||
protected $guarded = ['id'];
|
||||
|
||||
}
|
||||
|
@ -2,11 +2,11 @@
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Listeners\SendConfirmationNotification;
|
||||
use App\Events\User\UserCreated;
|
||||
use App\Listeners\SendVerificationNotification;
|
||||
use Illuminate\Auth\Events\Registered;
|
||||
use Illuminate\Auth\Listeners\SendEmailVerificationNotification;
|
||||
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
|
||||
use App\Events\UserSignedUp;
|
||||
|
||||
class EventServiceProvider extends ServiceProvider
|
||||
{
|
||||
@ -17,10 +17,10 @@ class EventServiceProvider extends ServiceProvider
|
||||
*/
|
||||
protected $listen = [
|
||||
Registered::class => [
|
||||
SendEmailVerificationNotification::class,
|
||||
SendVerificationNotification::class,
|
||||
],
|
||||
UserSignedUp::class => [
|
||||
SendConfirmationNotification::class,
|
||||
UserCreated::class => [
|
||||
SendVerificationNotification::class,
|
||||
]
|
||||
];
|
||||
|
||||
|
51
app/Providers/TelescopeServiceProvider.php
Normal file
51
app/Providers/TelescopeServiceProvider.php
Normal file
@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Laravel\Telescope\EntryType;
|
||||
use Laravel\Telescope\Telescope;
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
use Laravel\Telescope\IncomingEntry;
|
||||
use Laravel\Telescope\Contracts\EntriesRepository;
|
||||
use Laravel\Telescope\TelescopeApplicationServiceProvider;
|
||||
|
||||
class TelescopeServiceProvider extends TelescopeApplicationServiceProvider
|
||||
{
|
||||
/**
|
||||
* Register any application services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
// Telescope::night();
|
||||
|
||||
Telescope::filter(function (IncomingEntry $entry) {
|
||||
if ($this->app->environment() == 'local') {
|
||||
return true;
|
||||
}
|
||||
|
||||
return $entry->isReportableException() ||
|
||||
$entry->isFailedJob() ||
|
||||
$entry->isScheduledTask() ||
|
||||
$entry->hasMonitoredTag();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the Telescope gate.
|
||||
*
|
||||
* This gate determines who can access Telescope in non-local environments.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function gate()
|
||||
{
|
||||
Gate::define('viewTelescope', function ($user) {
|
||||
return in_array($user->email, [
|
||||
config('ninja.contact.email'),
|
||||
'turbo124@gmail.com'
|
||||
]);
|
||||
});
|
||||
}
|
||||
}
|
8
app/Repositories/AccountRepository.php
Normal file
8
app/Repositories/AccountRepository.php
Normal file
@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repositories;
|
||||
|
||||
class AccountRepository
|
||||
{
|
||||
|
||||
}
|
@ -25,6 +25,7 @@
|
||||
"laracasts/presenter": "^0.2.1",
|
||||
"laravel/framework": "5.7.*",
|
||||
"laravel/socialite": "^3.1",
|
||||
"laravel/telescope": "^0.1.1",
|
||||
"laravel/tinker": "^1.0",
|
||||
"nwidart/laravel-modules": "^4.0",
|
||||
"predis/predis": "^1.1",
|
||||
|
160
composer.lock
generated
160
composer.lock
generated
@ -4,7 +4,7 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "9701bf39988e968400a53c290122596f",
|
||||
"content-hash": "3cec8c5c70a52bc9011baabe117ac56c",
|
||||
"packages": [
|
||||
{
|
||||
"name": "asgrim/ofxparser",
|
||||
@ -796,16 +796,16 @@
|
||||
},
|
||||
{
|
||||
"name": "laravel/framework",
|
||||
"version": "v5.7.9",
|
||||
"version": "v5.7.10",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/laravel/framework.git",
|
||||
"reference": "172f69f86bb86e107fb9fafff293b4b01291cf05"
|
||||
"reference": "7d748c33b8c409b9b0c96704d6493853de41754d"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/laravel/framework/zipball/172f69f86bb86e107fb9fafff293b4b01291cf05",
|
||||
"reference": "172f69f86bb86e107fb9fafff293b4b01291cf05",
|
||||
"url": "https://api.github.com/repos/laravel/framework/zipball/7d748c33b8c409b9b0c96704d6493853de41754d",
|
||||
"reference": "7d748c33b8c409b9b0c96704d6493853de41754d",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -887,6 +887,7 @@
|
||||
"doctrine/dbal": "Required to rename columns and drop SQLite columns (^2.6).",
|
||||
"ext-pcntl": "Required to use all features of the queue worker.",
|
||||
"ext-posix": "Required to use all features of the queue worker.",
|
||||
"filp/whoops": "Required for friendly error pages in development (^2.1.4).",
|
||||
"fzaninotto/faker": "Required to use the eloquent factory builder (^1.4).",
|
||||
"guzzlehttp/guzzle": "Required to use the Mailgun and Mandrill mail drivers and the ping methods on schedules (^6.0).",
|
||||
"laravel/tinker": "Required to use the tinker console command (^1.0).",
|
||||
@ -934,20 +935,20 @@
|
||||
"framework",
|
||||
"laravel"
|
||||
],
|
||||
"time": "2018-10-09T13:28:28+00:00"
|
||||
"time": "2018-10-23T14:05:19+00:00"
|
||||
},
|
||||
{
|
||||
"name": "laravel/socialite",
|
||||
"version": "v3.1.1",
|
||||
"version": "v3.2.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/laravel/socialite.git",
|
||||
"reference": "65f771ff4f266ebae23de1a3f18efd80a1da2f8d"
|
||||
"reference": "7194c0cd9fb2ce449669252b8ec316b85b7de481"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/laravel/socialite/zipball/65f771ff4f266ebae23de1a3f18efd80a1da2f8d",
|
||||
"reference": "65f771ff4f266ebae23de1a3f18efd80a1da2f8d",
|
||||
"url": "https://api.github.com/repos/laravel/socialite/zipball/7194c0cd9fb2ce449669252b8ec316b85b7de481",
|
||||
"reference": "7194c0cd9fb2ce449669252b8ec316b85b7de481",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -997,7 +998,65 @@
|
||||
"laravel",
|
||||
"oauth"
|
||||
],
|
||||
"time": "2018-08-16T12:51:21+00:00"
|
||||
"time": "2018-10-18T03:39:04+00:00"
|
||||
},
|
||||
{
|
||||
"name": "laravel/telescope",
|
||||
"version": "v0.1.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/laravel/telescope.git",
|
||||
"reference": "77deb0410a18af3b3dcf64cdc99eec62179db16a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/laravel/telescope/zipball/77deb0410a18af3b3dcf64cdc99eec62179db16a",
|
||||
"reference": "77deb0410a18af3b3dcf64cdc99eec62179db16a",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-json": "*",
|
||||
"moontoast/math": "^1.1",
|
||||
"php": "^7.1.3",
|
||||
"symfony/var-dumper": "^4.1"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.0-dev"
|
||||
},
|
||||
"laravel": {
|
||||
"providers": [
|
||||
"Laravel\\Telescope\\TelescopeServiceProvider"
|
||||
]
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Laravel\\Telescope\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Taylor Otwell",
|
||||
"email": "taylor@laravel.com"
|
||||
},
|
||||
{
|
||||
"name": "Mohamed Said",
|
||||
"email": "mohamed@laravel.com"
|
||||
}
|
||||
],
|
||||
"description": "An elegant debug assistant for the Laravel framework.",
|
||||
"keywords": [
|
||||
"debugging",
|
||||
"laravel",
|
||||
"monitoring"
|
||||
],
|
||||
"time": "2018-10-23T18:09:26+00:00"
|
||||
},
|
||||
{
|
||||
"name": "laravel/tinker",
|
||||
@ -1287,6 +1346,55 @@
|
||||
],
|
||||
"time": "2017-06-19T01:22:40+00:00"
|
||||
},
|
||||
{
|
||||
"name": "moontoast/math",
|
||||
"version": "1.1.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/ramsey/moontoast-math.git",
|
||||
"reference": "c2792a25df5cad4ff3d760dd37078fc5b6fccc79"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/ramsey/moontoast-math/zipball/c2792a25df5cad4ff3d760dd37078fc5b6fccc79",
|
||||
"reference": "c2792a25df5cad4ff3d760dd37078fc5b6fccc79",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-bcmath": "*",
|
||||
"php": ">=5.3.3"
|
||||
},
|
||||
"require-dev": {
|
||||
"jakub-onderka/php-parallel-lint": "^0.9.0",
|
||||
"phpunit/phpunit": "^4.7|>=5.0 <5.4",
|
||||
"satooshi/php-coveralls": "^0.6.1",
|
||||
"squizlabs/php_codesniffer": "^2.3"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Moontoast\\Math\\": "src/Moontoast/Math/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"Apache-2.0"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Ben Ramsey",
|
||||
"email": "ben@benramsey.com",
|
||||
"homepage": "https://benramsey.com"
|
||||
}
|
||||
],
|
||||
"description": "A mathematics library, providing functionality for large numbers",
|
||||
"homepage": "https://github.com/ramsey/moontoast-math",
|
||||
"keywords": [
|
||||
"bcmath",
|
||||
"math"
|
||||
],
|
||||
"time": "2017-02-16T16:54:46+00:00"
|
||||
},
|
||||
{
|
||||
"name": "nesbot/carbon",
|
||||
"version": "1.34.0",
|
||||
@ -3270,16 +3378,16 @@
|
||||
},
|
||||
{
|
||||
"name": "filp/whoops",
|
||||
"version": "2.3.0",
|
||||
"version": "2.3.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/filp/whoops.git",
|
||||
"reference": "a9f129b99df316f847584d482c89c14a9f796e2b"
|
||||
"reference": "bc0fd11bc455cc20ee4b5edabc63ebbf859324c7"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/filp/whoops/zipball/a9f129b99df316f847584d482c89c14a9f796e2b",
|
||||
"reference": "a9f129b99df316f847584d482c89c14a9f796e2b",
|
||||
"url": "https://api.github.com/repos/filp/whoops/zipball/bc0fd11bc455cc20ee4b5edabc63ebbf859324c7",
|
||||
"reference": "bc0fd11bc455cc20ee4b5edabc63ebbf859324c7",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -3327,7 +3435,7 @@
|
||||
"throwable",
|
||||
"whoops"
|
||||
],
|
||||
"time": "2018-10-20T09:00:00+00:00"
|
||||
"time": "2018-10-23T09:00:00+00:00"
|
||||
},
|
||||
{
|
||||
"name": "fzaninotto/faker",
|
||||
@ -3922,16 +4030,16 @@
|
||||
},
|
||||
{
|
||||
"name": "phpunit/php-code-coverage",
|
||||
"version": "6.1.1",
|
||||
"version": "6.1.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
|
||||
"reference": "b097681a19a48e52706f57e47a09594bac4f7cab"
|
||||
"reference": "4d3ae9b21a7d7e440bd0cf65565533117976859f"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/b097681a19a48e52706f57e47a09594bac4f7cab",
|
||||
"reference": "b097681a19a48e52706f57e47a09594bac4f7cab",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/4d3ae9b21a7d7e440bd0cf65565533117976859f",
|
||||
"reference": "4d3ae9b21a7d7e440bd0cf65565533117976859f",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -3981,7 +4089,7 @@
|
||||
"testing",
|
||||
"xunit"
|
||||
],
|
||||
"time": "2018-10-18T09:01:38+00:00"
|
||||
"time": "2018-10-23T05:59:32+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpunit/php-file-iterator",
|
||||
@ -4174,16 +4282,16 @@
|
||||
},
|
||||
{
|
||||
"name": "phpunit/phpunit",
|
||||
"version": "7.4.1",
|
||||
"version": "7.4.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/phpunit.git",
|
||||
"reference": "c5a120ade60992bd671a912188ee9ee9f8083bbd"
|
||||
"reference": "c151651fb6ed264038d486ea262e243af72e5e64"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c5a120ade60992bd671a912188ee9ee9f8083bbd",
|
||||
"reference": "c5a120ade60992bd671a912188ee9ee9f8083bbd",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c151651fb6ed264038d486ea262e243af72e5e64",
|
||||
"reference": "c151651fb6ed264038d486ea262e243af72e5e64",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -4254,7 +4362,7 @@
|
||||
"testing",
|
||||
"xunit"
|
||||
],
|
||||
"time": "2018-10-18T09:02:52+00:00"
|
||||
"time": "2018-10-23T05:57:41+00:00"
|
||||
},
|
||||
{
|
||||
"name": "sebastian/code-unit-reverse-lookup",
|
||||
|
@ -177,6 +177,7 @@ return [
|
||||
App\Providers\AuthServiceProvider::class,
|
||||
// App\Providers\BroadcastServiceProvider::class,
|
||||
App\Providers\EventServiceProvider::class,
|
||||
App\Providers\TelescopeServiceProvider::class,
|
||||
App\Providers\RouteServiceProvider::class,
|
||||
|
||||
],
|
||||
|
92
config/telescope.php
Normal file
92
config/telescope.php
Normal file
@ -0,0 +1,92 @@
|
||||
<?php
|
||||
|
||||
use Laravel\Telescope\Watchers;
|
||||
use Laravel\Telescope\Http\Middleware\Authorize;
|
||||
|
||||
return [
|
||||
|
||||
'path' => 'telescope',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Telescope Storage Driver
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This configuration options determines the storage driver that will
|
||||
| be used to store Telescope's data. In addition, you may set any
|
||||
| custom options as needed by the particular driver you choose.
|
||||
|
|
||||
*/
|
||||
|
||||
'driver' => env('TELESCOPE_DRIVER', 'database'),
|
||||
|
||||
'storage' => [
|
||||
'database' => [
|
||||
'connection' => env('DB_CONNECTION', 'mysql'),
|
||||
]
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Record Pruning
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This configuration options determines how many Telescope records of
|
||||
| a given type will be kept in storage. This allows you to control
|
||||
| the amount of disk space claimed by Telescope's entry storage.
|
||||
|
|
||||
| When "null", records will not be pruned.
|
||||
|
|
||||
*/
|
||||
|
||||
'limit' => env('TELESCOPE_LIMIT', 100),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Telescope Route Middleware
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| These middleware will be assigned to every Telescope route, giving you
|
||||
| the chance to add your own middleware to this list or change any of
|
||||
| the existing middleware. Or, you can simply stick with this list.
|
||||
|
|
||||
*/
|
||||
|
||||
'middleware' => [
|
||||
'web',
|
||||
Authorize::class,
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Telescope Watchers
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The following array lists the "watchers" that will be registered with
|
||||
| Telescope. The watchers gather the application's profile data when
|
||||
| a request or task is executed. Feel free to customize this list.
|
||||
|
|
||||
*/
|
||||
|
||||
'watchers' => [
|
||||
Watchers\CacheWatcher::class => env('TELESCOPE_CACHE_WATCHER', true),
|
||||
Watchers\CommandWatcher::class => env('TELESCOPE_COMMAND_WATCHER', true),
|
||||
Watchers\DumpWatcher::class => env('TELESCOPE_DUMP_WATCHER', true),
|
||||
Watchers\EventWatcher::class => env('TELESCOPE_EVENT_WATCHER', true),
|
||||
Watchers\ExceptionWatcher::class => env('TELESCOPE_EXCEPTION_WATCHER', true),
|
||||
Watchers\JobWatcher::class => env('TELESCOPE_JOB_WATCHER', true),
|
||||
Watchers\LogWatcher::class => env('TELESCOPE_LOG_WATCHER', true),
|
||||
Watchers\MailWatcher::class => env('TELESCOPE_MAIL_WATCHER', true),
|
||||
Watchers\ModelWatcher::class => env('TELESCOPE_MODEL_WATCHER', true),
|
||||
Watchers\NotificationWatcher::class => env('TELESCOPE_NOTIFICATION_WATCHER', true),
|
||||
|
||||
Watchers\QueryWatcher::class => [
|
||||
'enabled' => env('TELESCOPE_QUERY_WATCHER', true),
|
||||
'slow' => 100,
|
||||
],
|
||||
|
||||
Watchers\RedisWatcher::class => env('TELESCOPE_REDIS_WATCHER', true),
|
||||
Watchers\RequestWatcher::class => env('TELESCOPE_REQUEST_WATCHER', true),
|
||||
Watchers\ScheduleWatcher::class => env('TELESCOPE_SCHEDULE_WATCHER', true),
|
||||
],
|
||||
];
|
@ -158,7 +158,7 @@ class CreateUsersTable extends Migration
|
||||
$table->unsignedInteger('account_id');
|
||||
$table->unsignedInteger('user_id')->index();
|
||||
$table->text('permissions');
|
||||
$table->boolean('is_owner');
|
||||
$table->boolean('is_owner')->default(false);
|
||||
$table->boolean('is_admin');
|
||||
$table->boolean('is_locked')->default(false); // locks user out of account
|
||||
$table->timestamps();
|
||||
|
@ -13,8 +13,8 @@ Route::post('logout', 'Auth\LoginController@logout')->name('logout');
|
||||
*/
|
||||
|
||||
Route::redirect('/', '/login', 301);
|
||||
Route::get('signup', 'CompanyController@index')->name('signup');
|
||||
Route::post('signup', 'CompanyController@store')->name('signup.submit');
|
||||
Route::get('signup', 'AccountController@index')->name('signup');
|
||||
Route::post('signup', 'AccountController@store')->name('signup.submit');
|
||||
Route::get('contact/login', 'Auth\ContactLoginController@showLoginForm')->name('contact.login');
|
||||
Route::post('contact/login', 'Auth\ContactLoginController@login')->name('contact.login.submit');
|
||||
|
||||
@ -38,6 +38,9 @@ Route::get('auth/{provider}/callback', 'Auth\LoginController@handleProviderCallb
|
||||
* Authenticated User Routes
|
||||
*/
|
||||
|
||||
Auth::routes(['verify' => true]);
|
||||
|
||||
|
||||
Route::group(['middleware' => ['auth:user', 'db']], function () {
|
||||
|
||||
Route::get('dashboard', 'HomeController@user')->name('user.dashboard');
|
||||
|
Loading…
x
Reference in New Issue
Block a user