mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
* Fixes for datatables * Implement a BaseModel * Working on reusable header data model * Working on adding session variables * Clean up header data * Random Data Seeder * working on searching datatables across relationships. * Working on transforming primary keys between client and server facinglogic * Updated assets
30 lines
659 B
PHP
30 lines
659 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Traits;
|
|
|
|
use App\Models\User;
|
|
use Illuminate\Support\Facades\Auth;
|
|
|
|
trait VerifiesUserEmail
|
|
{
|
|
|
|
public function confirm($code)
|
|
{
|
|
$user = User::where('confirmation_code', $code)->first();
|
|
|
|
if ($user) {
|
|
|
|
$user->email_verified_at = now();
|
|
$user->confirmation_code = null;
|
|
$user->save();
|
|
|
|
Auth::loginUsingId($user->id, true);
|
|
|
|
return redirect()->route('dashboard.index')->with('message', trans('texts.security_confirmation'));
|
|
|
|
}
|
|
|
|
return redirect()->route('login')->with('message', trans('texts.wrong_confirmation'));
|
|
|
|
}
|
|
} |