Skip to content

Commit 12d0755

Browse files
Merge pull request #11 from themesberg/develop
Develop
2 parents 4ac7d3a + 66e0e55 commit 12d0755

File tree

754 files changed

+289927
-23828
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

754 files changed

+289927
-23828
lines changed

.env.example

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
IS_DEMO=false
2+
13
APP_NAME=Laravel
24
APP_ENV=local
35
APP_KEY=
@@ -10,8 +12,8 @@ LOG_LEVEL=debug
1012
DB_CONNECTION=mysql
1113
DB_HOST=127.0.0.1
1214
DB_PORT=3306
13-
DB_DATABASE=laravel
14-
DB_USERNAME=root
15+
DB_DATABASE=
16+
DB_USERNAME=
1517
DB_PASSWORD=
1618

1719
BROADCAST_DRIVER=log
@@ -27,12 +29,10 @@ REDIS_PASSWORD=null
2729
REDIS_PORT=6379
2830

2931
MAIL_MAILER=smtp
30-
MAIL_HOST=mailhog
31-
MAIL_PORT=1025
32-
MAIL_USERNAME=null
33-
MAIL_PASSWORD=null
34-
MAIL_ENCRYPTION=null
35-
MAIL_FROM_ADDRESS=null
36-
MAIL_FROM_NAME="${APP_NAME}"
32+
MAIL_HOST=smtp.mailtrap.io
33+
MAIL_PORT=2525
34+
MAIL_USERNAME=
35+
MAIL_PASSWORD=
36+
MAIL_ENCRYPTION=tls
3737

3838
IS_DEMO=false

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Change Log
2+
3+
## Version 1.0.0
4+
5+
### Added
6+
- Volt Dashboard Free
7+
- Login
8+
- Register
9+
- Profile edit

LICENSE.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Copyright 2021 Themesberg (Crafty Dwarf LLC)
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4+
5+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6+
7+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 365 additions & 42 deletions
Large diffs are not rendered by default.

app/Http/Livewire/Auth/Login.php

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?php
2+
3+
namespace App\Http\Livewire\Auth;
4+
5+
use App\Models\User;
6+
use Livewire\Component;
7+
8+
class Login extends Component
9+
{
10+
11+
public $email = '';
12+
public $password = '';
13+
public $remember_me = false;
14+
15+
protected $rules = [
16+
'email' => 'required|email:rfc,dns',
17+
'password' => 'required|min:6',
18+
];
19+
20+
//This mounts the default credentials for the admin. Remove this section if you want to make it public.
21+
public function mount()
22+
{
23+
if (auth()->user()) {
24+
return redirect()->intended('/dashboard');
25+
}
26+
$this->fill([
27+
'email' => 'admin@volt.com',
28+
'password' => 'secret',
29+
]);
30+
}
31+
32+
public function login()
33+
{
34+
$credentials = $this->validate();
35+
if (auth()->attempt(['email' => $this->email, 'password' => $this->password], $this->remember_me)) {
36+
$user = User::where(['email' => $this->email])->first();
37+
auth()->login($user, $this->remember_me);
38+
return redirect()->intended('/dashboard');
39+
} else {
40+
return $this->addError('email', trans('auth.failed'));
41+
}
42+
}
43+
44+
public function render()
45+
{
46+
return view('livewire.auth.login');
47+
}
48+
}

app/Http/Livewire/Register.php renamed to app/Http/Livewire/Auth/Register.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace App\Http\Livewire;
3+
namespace App\Http\Livewire\Auth;
44

55
use Livewire\Component;
66
use App\Models\User;
@@ -14,9 +14,16 @@ class Register extends Component
1414
public $password = '';
1515
public $passwordConfirmation = '';
1616

17+
public function mount()
18+
{
19+
if (auth()->user()) {
20+
return redirect()->intended('/dashboard');
21+
}
22+
}
23+
1724
public function updatedEmail()
1825
{
19-
$this->validate(['email'=>'required|email|unique:users']);
26+
$this->validate(['email'=>'required|email:rfc,dns|unique:users']);
2027
}
2128

2229
public function register()
@@ -39,7 +46,6 @@ public function register()
3946

4047
public function render()
4148
{
42-
return view('livewire.auth.register')
43-
->layout('layouts.base');
49+
return view('livewire.auth.register');
4450
}
4551
}

app/Http/Livewire/BootstrapTables.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
namespace App\Http\Livewire;
4+
5+
use Livewire\Component;
6+
7+
class BootstrapTables extends Component
8+
{
9+
public function render()
10+
{
11+
return view('bootstrap-tables');
12+
}
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
namespace App\Http\Livewire\Components;
4+
5+
use Livewire\Component;
6+
7+
class Buttons extends Component
8+
{
9+
public function render()
10+
{
11+
return view('components.buttons');
12+
}
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
namespace App\Http\Livewire\Components;
4+
5+
use Livewire\Component;
6+
7+
class Forms extends Component
8+
{
9+
public function render()
10+
{
11+
return view('components.forms');
12+
}
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
namespace App\Http\Livewire\Components;
4+
5+
use Livewire\Component;
6+
7+
class Modals extends Component
8+
{
9+
public function render()
10+
{
11+
return view('components.modals');
12+
}
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
namespace App\Http\Livewire\Components;
4+
5+
use Livewire\Component;
6+
7+
class Notifications extends Component
8+
{
9+
public function render()
10+
{
11+
return view('components.notifications');
12+
}
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
namespace App\Http\Livewire\Components;
4+
5+
use Livewire\Component;
6+
7+
class Typography extends Component
8+
{
9+
public function render()
10+
{
11+
return view('components.typography');
12+
}
13+
}

app/Http/Livewire/Dashboard.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
namespace App\Http\Livewire;
4+
5+
use Livewire\Component;
6+
7+
class Dashboard extends Component
8+
{
9+
public function render()
10+
{
11+
return view('dashboard');
12+
}
13+
}

app/Http/Livewire/Err404.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
namespace App\Http\Livewire;
4+
5+
use Livewire\Component;
6+
7+
class Err404 extends Component
8+
{
9+
public function render()
10+
{
11+
return view('404');
12+
}
13+
}

app/Http/Livewire/Err500.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
namespace App\Http\Livewire;
4+
5+
use Livewire\Component;
6+
7+
class Err500 extends Component
8+
{
9+
public function render()
10+
{
11+
return view('500');
12+
}
13+
}

app/Http/Livewire/ForgotPassword.php

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,43 @@ class ForgotPassword extends Component
1414
use Notifiable;
1515

1616
public $mailSentAlert = false;
17+
public $showDemoNotification = false;
1718
public $email='';
1819
public $rules=[
1920
'email' => 'required|email|exists:users'
2021
];
2122
protected $messages = [
2223
'email.exists' => 'The Email Address must be in our database.',
2324
];
25+
26+
public function mount()
27+
{
28+
if (auth()->user()) {
29+
return redirect()->intended('/dashboard');
30+
}
31+
}
32+
33+
public function updatedEmail()
34+
{
35+
$this->validate(['email'=>'required|email|exists:users']);
36+
}
2437
public function routeNotificationForMail() {
2538
return $this->email;
2639
}
2740
public function recoverPassword() {
28-
$this->validate();
29-
$user=User::where('email', $this->email)->first();
30-
$this->notify(new ResetPassword($user->remember_token));
31-
$this->mailSentAlert = true;
41+
if(env('IS_DEMO')) {
42+
$this->showDemoNotification = true;
43+
}
44+
else {
45+
$this->validate();
46+
$user=User::where('email', $this->email)->first();
47+
$this->notify(new ResetPassword($user->id));
48+
$this->mailSentAlert = true;
49+
}
3250
}
3351

3452
public function render()
3553
{
36-
return view('livewire.forgot-password')
37-
->layout('layouts.base');
54+
return view('livewire.forgot-password');
3855
}
3956
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
namespace App\Http\Livewire;
4+
5+
use Livewire\Component;
6+
7+
class ForgotPasswordExample extends Component
8+
{
9+
public function render()
10+
{
11+
return view('livewire.forgot-password-example');
12+
}
13+
}

app/Http/Livewire/Index.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
namespace App\Http\Livewire;
4+
5+
use Livewire\Component;
6+
7+
class Index extends Component
8+
{
9+
public function render()
10+
{
11+
return view('livewire.index');
12+
}
13+
}

app/Http/Livewire/Lock.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
namespace App\Http\Livewire;
4+
5+
use Livewire\Component;
6+
7+
class Lock extends Component
8+
{
9+
public function render()
10+
{
11+
return view('lock');
12+
}
13+
}

app/Http/Livewire/Login.php

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)