Skip to content

Commit af9a2dd

Browse files
Merge pull request #13 from creativetimofficial/develop
Develop
2 parents a5ab981 + f99f4bc commit af9a2dd

File tree

276 files changed

+57297
-3501
lines changed

Some content is hidden

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

276 files changed

+57297
-3501
lines changed

.env.example

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ LOG_LEVEL=debug
1010
DB_CONNECTION=mysql
1111
DB_HOST=127.0.0.1
1212
DB_PORT=3306
13-
DB_DATABASE=laravel
14-
DB_USERNAME=root
13+
DB_DATABASE=softui
14+
DB_USERNAME=
1515
DB_PASSWORD=
1616

1717
BROADCAST_DRIVER=log
@@ -26,14 +26,6 @@ REDIS_HOST=127.0.0.1
2626
REDIS_PASSWORD=null
2727
REDIS_PORT=6379
2828

29-
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}"
3729

3830
AWS_ACCESS_KEY_ID=
3931
AWS_SECRET_ACCESS_KEY=
@@ -47,3 +39,12 @@ PUSHER_APP_CLUSTER=mt1
4739

4840
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
4941
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
42+
43+
MAIL_MAILER=smtp
44+
MAIL_HOST=smtp.mailtrap.io
45+
MAIL_PORT=2525
46+
MAIL_USERNAME=
47+
MAIL_PASSWORD=
48+
MAIL_ENCRYPTION=tls
49+
50+
IS_DEMO=true

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"liveServer.settings.port": 5501
3+
}

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Change Log
2+
All notable changes to `Soft UI Dashboard Laravel` will be documented in this file.
3+
4+
## [1.0.0]
5+
### Original Release
6+
- Soft UI Dashboard Free
7+
- Login
8+
- Register
9+
- Forgot password
10+
- Profile edit

LICENCE.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
MIT License
2+
3+
Copyright (c) 2020 [Creative Tim](https://www.creative-tim.com)
4+
5+
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:
6+
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8+
9+
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: 286 additions & 42 deletions
Large diffs are not rendered by default.
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<?php
2+
3+
namespace App\Http\Livewire\Auth;
4+
5+
use Livewire\Component;
6+
use App\Models\User;
7+
8+
use Illuminate\Notifications\Notifiable;
9+
use App\Notifications\ResetPassword;
10+
11+
class ForgotPassword extends Component
12+
{
13+
use Notifiable;
14+
15+
public $email = '';
16+
17+
public $showSuccesNotification = false;
18+
public $showFailureNotification = false;
19+
20+
public $showDemoNotification = false;
21+
22+
protected $rules = [
23+
'email' => 'required|email',
24+
];
25+
26+
public function mount() {
27+
if(auth()->user()){
28+
redirect('/dashboard');
29+
}
30+
}
31+
32+
public function routeNotificationForMail() {
33+
return $this->email;
34+
}
35+
36+
public function recoverPassword() {
37+
if(env('IS_DEMO')) {
38+
$this->showDemoNotification = true;
39+
} else {
40+
$this->validate();
41+
$user = User::where('email', $this->email)->first();
42+
if($user){
43+
$this->notify(new ResetPassword($user->id));
44+
$this->showSuccesNotification = true;
45+
$this->showFailureNotification = false;
46+
} else {
47+
$this->showFailureNotification = true;
48+
}
49+
}
50+
}
51+
52+
public function render()
53+
{
54+
return view('livewire.auth.forgot-password')->layout('layouts.base');
55+
}
56+
}

app/Http/Livewire/Auth/Login.php

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

app/Http/Livewire/Auth/Logout.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
namespace App\Http\Livewire\Auth;
4+
5+
use App\Http\Livewire\Auth;
6+
use Livewire\Component;
7+
8+
class Logout extends Component
9+
{
10+
public function logout() {
11+
auth()->logout();
12+
return redirect('/login');
13+
}
14+
15+
public function render()
16+
{
17+
return view('livewire.auth.logout');
18+
}
19+
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<?php
2+
3+
namespace App\Http\Livewire\Auth;
4+
5+
use App\Models\User;
6+
7+
use Illuminate\Support\Facades\Hash;
8+
use Illuminate\Support\Facades\Route;
9+
use Illuminate\Support\Facades\URL;
10+
use Illuminate\Support\Facades\Request;
11+
use Livewire\Component;
12+
13+
class ResetPassword extends Component
14+
{
15+
public $email = '';
16+
public $password = '';
17+
public $passwordConfirmation = '';
18+
19+
public $showSuccesNotification = false;
20+
public $showFailureNotification = false;
21+
22+
public $showDemoNotification = false;
23+
24+
public $urlID = '';
25+
26+
protected $rules = [
27+
'email' => 'required|email',
28+
'password' => 'required|min:6|same:passwordConfirmation'
29+
];
30+
31+
public function mount($id) {
32+
$existingUser = User::find($id);
33+
$this->urlID = intval($existingUser->id);
34+
}
35+
36+
public function resetPassword() {
37+
$this->validate();
38+
$existingUser = User::where('email', $this->email)->first();
39+
if($existingUser && $existingUser->id == $this->urlID) {
40+
$existingUser->update([
41+
'password' => Hash::make($this->password)
42+
]);
43+
$this->showSuccesNotification = true;
44+
$this->showFailureNotification = false;
45+
} else {
46+
$this->showFailureNotification = true;
47+
}
48+
}
49+
50+
public function render()
51+
{
52+
return view('livewire.auth.reset-password')->layout('layouts.base');
53+
}
54+
}

app/Http/Livewire/Auth/SignIn.php

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

0 commit comments

Comments
 (0)