Skip to content

Commit b5f46dc

Browse files
ajayinfyommitulgolakiya
authored andcommitted
feat(auth): implemented user email verify (#791)
1 parent 2770e1f commit b5f46dc

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

src/Commands/Publish/LayoutPublishCommand.php

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace InfyOm\Generator\Commands\Publish;
44

5+
use Illuminate\Support\Str;
56
use InfyOm\Generator\Utils\FileUtil;
67
use Symfony\Component\Console\Input\InputOption;
78

@@ -64,7 +65,7 @@ private function createDirectories($viewsPath)
6465

6566
private function getViews()
6667
{
67-
return [
68+
$views = [
6869
'layouts/app' => 'layouts/app.blade.php',
6970
'layouts/sidebar' => 'layouts/sidebar.blade.php',
7071
'layouts/datatables_css' => 'layouts/datatables_css.blade.php',
@@ -77,6 +78,21 @@ private function getViews()
7778
'auth/reset' => 'auth/passwords/reset.blade.php',
7879
'emails/password' => 'auth/emails/password.blade.php',
7980
];
81+
82+
$version = $this->getApplication()->getVersion();
83+
if (Str::contains($version, '6.')) {
84+
$verifyView = [
85+
'auth/verify_6' => 'auth/verify.blade.php',
86+
];
87+
} else {
88+
$verifyView = [
89+
'auth/verify' => 'auth/verify.blade.php',
90+
];
91+
}
92+
93+
$views = array_merge($views, $verifyView);
94+
95+
return $views;
8096
}
8197

8298
private function getLocaleViews()

templates/routes/auth.stub

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
Auth::routes();
1+
Auth::routes(['verify' => true]);
22

3-
Route::get('/home', 'HomeController@index');
3+
Route::get('/home', 'HomeController@index')->middleware('verified');

0 commit comments

Comments
 (0)