Skip to content

Commit 8f40324

Browse files
committed
Added conditions for welcome page
1 parent 4203534 commit 8f40324

File tree

5 files changed

+212
-6
lines changed

5 files changed

+212
-6
lines changed

CHANGELOG.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Change Log
2+
3+
## [2.0.0] 2017-12-11
4+
### Major Release
5+
- update to Bootstrap 4 Beta
6+
- added new icons by Nucleo
7+
- bug fixes and improvements
8+
- code refactoring
9+
10+
## [1.4.0] 2017-11-02
11+
### Library Updates
12+
- jQuery - `3.2.1`
13+
- bootstrap - `3.3.7`
14+
- chartist - `0.11.0`
15+
16+
### Bug Fixing
17+
- replaced old javascript checkboxes and radios with only css checkboxes and radios
18+
- fixed responsive sidebar
19+
- small bug fixes
20+
21+
## [1.3.1] 2017-01-19
22+
- switched to MIT license
23+
24+
## [1.3] 2016-01-22
25+
### New Template page + Video Tutorial [current version]
26+
- added the default template page + youtube video tutorial on how to create an Admin Template (link: https://www.youtube.com/watch...)
27+
28+
## [1.2] 2016-01-17
29+
### New Page
30+
- for those who want to upsell inside their dashboard we added a new page "Upgrade to PRO" with a pricing and options table
31+
32+
## [1.1] 2015-09-08
33+
### Bug Fixing
34+
- added company name/logo inside the sidebar for small screens
35+
- fixed bug for notification with close button on small screens
36+
- fix live preview bug for download on small screens
37+
- fix table responsive for small screens
38+
- added new labels for chartist on small screens
39+
40+
## [1.0] 2015-08-20
41+
### Initial Release

license.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) 2019 [Updivision](https://updivision.com) [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: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
# Light Bootstrap Frontend Preset For Laravel Framework 5.5 and Up
2+
3+
Light Bootstrap Frontend Preset For Laravel Framework 5.5 and Up
4+
5+
*Current version*: Light Bootstrap v1.0.10. More info at https://www.creative-tim.com/product/light-bootstrap-dashboard-laravel.
6+
7+
## Note
8+
9+
We recommend installing this preset on a project that you are starting from scratch, otherwise your project's design might break.
10+
11+
## Prerequisites
12+
13+
If you don't already have an Apache local environment with PHP and MySQL, use one of the following links:
14+
15+
- Windows: https://updivision.com/blog/post/beginner-s-guide-to-setting-up-your-local-development-environment-on-windows
16+
- Linux: https://howtoubuntu.org/how-to-install-lamp-on-ubuntu
17+
- Mac: https://wpshout.com/quick-guides/how-to-install-mamp-on-your-mac/
18+
19+
Also, you will need to install Composer: https://getcomposer.org/doc/00-intro.md
20+
And Laravel: https://laravel.com/docs/5.8/installation
21+
22+
## Installation
23+
24+
After initializing a fresh instance of Laravel (and making all the necessary configurations), install the preset using one of the provided methods:
25+
26+
### Via composer
27+
28+
1. `Cd` to your Laravel app
29+
2. Install this preset via `composer require laravel-frontend-presets/light-bootstrap`. No need to register the service provider. Laravel 5.5 & up can auto detect the package.
30+
3. Run `php artisan preset light-bootstrap` command to install the Light Bootstrap preset. This will install all the necessary assets and also the custom auth views, it will also add the auth route in `routes/web.php`
31+
(NOTE: If you run this command several times, be sure to clean up the duplicate Auth entries in routes/web.php)
32+
4. In your terminal run `composer dump-autoload`
33+
5. Run `php artisan migrate --seed` to create basic users table
34+
35+
### By using the archive
36+
37+
1. In your application's root create a **presets** folder
38+
2. [Download an archive](https://github.com/laravel-frontend-presets/light-bootstrap-laravel/archive/master.zip) of the repo and unzip it
39+
3. Copy and paste **light-bootstrap-master** folder in presets (created in step 2) and rename it to **light-bootstrap**
40+
4. Open `composer.json` file
41+
5. Add `"LaravelFrontendPresets\\LightBootstrapPreset\\": "presets/light-bootstrap/src"` to `autoload/psr-4` and to `autoload-dev/psr-4`
42+
6. Add `LaravelFrontendPresets\LightBootstrapPreset\LightBootstrapPresetServiceProvider::class` to `config/app.php` file
43+
7. In your terminal run `composer dump-autoload`
44+
8. Run `php artisan preset light-bootstrap` command to install the Light Bootstrap preset. This will install all the necessary assets and also the custom auth views, it will also add the auth route in `routes/web.php`
45+
(NOTE: If you run this command several times, be sure to clean up the duplicate Auth entries in routes/web.php)
46+
9. Run `php artisan migrate --seed` to create basic users table
47+
48+
49+
## Usage
50+
51+
Register a user or login using **[email protected]** and **secret** and start testing the preset (make sure to run the migrations and seeders for these credentials to be available).
52+
53+
Besides the dashboard and the auth pages this preset also has a user management example and an edit profile page. All the necessary files (controllers, requests, views) are installed out of the box and all the needed routes are added to `routes/web.php`. Keep in mind that all of the features can be viewed once you login using the credentials provided above or by registering your own user.
54+
55+
### Dashboard
56+
57+
You can access the dashboard either by using the "**Dashboard**" link in the left sidebar or by adding **/home** in the url.
58+
59+
### Profile edit
60+
61+
You have the option to edit the current logged in user's profile (change name, email and password). To access this page just click the "**User profile**" link in the left sidebar or by adding **/profile** in the url.
62+
63+
The `App\Htttp\Controlers\ProfileController` handles the update of the user information.
64+
65+
```
66+
public function update(ProfileRequest $request)
67+
{
68+
auth()->user()->update($request->all());
69+
70+
return back()->withStatus(__('Profile successfully updated.'));
71+
}
72+
```
73+
74+
Also you shouldn't worry about entering wrong data in the inputs when editing the profile, validation rules were added to prevent this (see `App\Http\Requests\ProfileRequest`). If you try to change the password you will see that other validation rules were added in `App\Http\Requests\PasswordRequest`. Notice that in this file you have a custom validation rule that can be found in `App\Rules\CurrentPasswordCheckRule`.
75+
76+
```
77+
public function rules()
78+
{
79+
return [
80+
'old_password' => ['required', 'min:6', new CurrentPasswordCheckRule],
81+
'password' => ['required', 'min:6', 'confirmed', 'different:old_password'],
82+
'password_confirmation' => ['required', 'min:6'],
83+
];
84+
}
85+
```
86+
87+
### User management
88+
89+
The preset comes with a user management option out of the box. To access this click the "**User Management**" link in the left sidebar or add **/user** to the url.
90+
The first thing you will see is the listing of the existing users. You can add new ones by clicking the "**Add user**" button (above the table on the right). On the Add user page you will see the form that allows you to do this. All pages are generate using blade templates:
91+
92+
```
93+
<div class="form-group{{ $errors->has('name') ? ' has-danger' : '' }}">
94+
<label class="form-control-label" for="input-name">
95+
<i class="w3-xxlarge fa fa-user"></i>{{ __('Name') }}
96+
</label>
97+
<input type="text" name="name" id="input-name" class="form-control{{ $errors->has('name') ? ' is-invalid' : '' }}" placeholder="{{ __('Name') }}" value="{{ old('name') }}" required autofocus>
98+
99+
@include('alerts.feedback', ['field' => 'name'])
100+
</div>
101+
```
102+
103+
Also validation rules were added so you will know exactely what to enter in the form fields (see `App\Http\Requests\UserRequest`). Note that these validation rules also apply for the user edit option.
104+
105+
```
106+
public function rules()
107+
{
108+
return [
109+
'name' => [
110+
'required', 'min:3'
111+
],
112+
'email' => [
113+
'required', 'email', Rule::unique((new User)->getTable())->ignore($this->route()->user->id ?? null)
114+
],
115+
'password' => [
116+
$this->route()->user ? 'nullable' : 'required', 'confirmed', 'min:6'
117+
]
118+
];
119+
}
120+
```
121+
122+
Once you add more users, the list will get bigger and for every user you will have edit and delete options (access these options by clicking the three dotted menu that appears at the end of every line).
123+
124+
All the sample code for the user management can be found in `App\Http\Controllers\UserController`. See store method example bellow:
125+
126+
```
127+
public function store(UserRequest $request, User $model)
128+
{
129+
$model->create($request->merge(['password' => Hash::make($request->get('password'))])->all());
130+
131+
return redirect()->route('user.index')->withStatus(__('User successfully created.'));
132+
}
133+
```
134+
135+
## Change log
136+
137+
Please see the [changelog](changelog.md) for more information on what has changed recently.
138+
139+
## Credits
140+
141+
- [Creative Tim](https://creative-tim.com/)
142+
- [Updivision](https://updivision.com)
143+
144+
## License
145+
146+
[MIT License](https://github.com/laravel-frontend-presets/light-bootstrap/blob/master/license.md).
147+
148+
## Screen shots
149+
150+
![Light Bootstrap Login](screens/Login.png)
151+
152+
![Light Bootstrap Dashboard](screens/Dashboard.png)
153+
154+
![Light Bootstrap Users](screens/Users.png)
155+
156+
![Light Bootstrap Profile](screens/Profile.png)

resources/views/layouts/app.blade.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@
3434

3535
<body>
3636

37-
<div class="wrapper @guest wrapper-full-page @endguest">
37+
<div class="wrapper @if (!auth()->check() || request()->route()->getName() == "") wrapper-full-page @endif">
3838

39-
@auth
39+
@if (auth()->check() && request()->route()->getName() != "")
4040
@include('layouts.navbars.sidebar')
41-
@endauth
41+
@endif
4242

43-
<div class="@auth main-panel @endauth">
43+
<div class="@if (auth()->check() && request()->route()->getName() != "") main-panel @endif">
4444
@include('layouts.navbars.navbar')
4545
@yield('content')
4646
@include('layouts.footer.nav')
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
@auth
1+
@if (auth()->check() && request()->route()->getName() != null)
22
@include('layouts.navbars.navs.auth')
33
@else
44
@include('layouts.navbars.navs.guest')
5-
@endauth
5+
@endif

0 commit comments

Comments
 (0)