Skip to content

Commit b7a2f36

Browse files
merge
2 parents 18ba1cc + 5f3bf22 commit b7a2f36

File tree

17 files changed

+610
-412
lines changed

17 files changed

+610
-412
lines changed

changelog.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,11 @@ All notable changes to `Light Bootstrap Dashboard` frontend preset for Laravel w
1111
## Version 1.0.1 - 2019-09-23
1212

1313
- Update to Laravel 6.x
14+
15+
## Version 1.0.2 - 2020-03-18
16+
17+
- Update to Laravel 7.x
18+
19+
## Version 1.0.3 - 2020-09-23
20+
21+
- Update to Laravel 8.x

composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"homepage": "https://github.com/creativetimofficial/light-bootstrap-dashboard-laravel",
66
"keywords": ["Laravel", "Preset", "Light Bootstrap"],
77
"require": {
8-
"laravel/framework": "^5.5 || ^6.0"
8+
"laravel/framework": "^8.0",
9+
"laravel/legacy-factories": "^1.0"
910
},
1011
"autoload": {
1112
"psr-4": {
@@ -19,4 +20,4 @@
1920
]
2021
}
2122
}
22-
}
23+
}

readme.md

Lines changed: 12 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
![Product Image](https://github.com/creativetimofficial/public-assets/raw/master/light-bootstrap-dashboard-laravel/intro.gif)
88

9-
Speed up your web development with the Bootstrap 4 Admin Dashboard built for Laravel Framework 5.5 and up.
9+
Speed up your web development with the Bootstrap 4 Admin Dashboard built for Laravel Framework 8.x and up.
1010

1111
## Note
1212

@@ -21,7 +21,7 @@ If you don't already have an Apache local environment with PHP and MySQL, use on
2121
- Mac: https://wpshout.com/quick-guides/how-to-install-mamp-on-your-mac/
2222

2323
Also, you will need to install Composer: https://getcomposer.org/doc/00-intro.md
24-
And Laravel: https://laravel.com/docs/6.x/installation
24+
And Laravel: https://laravel.com/docs/7.x/installation
2525

2626
## Installation
2727

@@ -30,11 +30,12 @@ After initializing a fresh instance of Laravel (and making all the necessary con
3030
### Via composer
3131

3232
1. `Cd` to your Laravel app
33-
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.
34-
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`
33+
2. Type in your terminal: `composer require laravel/ui` and `php artisan ui vue --auth`
34+
3. Install this preset via `composer require laravel-frontend-presets/light-bootstrap`. No need to register the service provider. Laravel 8.x can auto detect the package.
35+
4. Run `php artisan ui 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`
3536
(NOTE: If you run this command several times, be sure to clean up the duplicate Auth entries in routes/web.php)
36-
4. In your terminal run `composer dump-autoload`
37-
5. Run `php artisan migrate --seed` to create basic users table
37+
5. In your terminal run `composer dump-autoload`
38+
6. Run `php artisan migrate --seed` to create basic users table
3839

3940
### By using the archive
4041

@@ -44,17 +45,18 @@ After initializing a fresh instance of Laravel (and making all the necessary con
4445
4. Open `composer.json` file
4546
5. Add `"LaravelFrontendPresets\\LightBootstrapPreset\\": "presets/light-bootstrap/src"` to `autoload/psr-4` and to `autoload-dev/psr-4`
4647
6. Add `LaravelFrontendPresets\LightBootstrapPreset\LightBootstrapPresetServiceProvider::class` to `config/app.php` file
47-
7. In your terminal run `composer dump-autoload`
48-
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`
48+
7. Type in your terminal: `composer require laravel/ui` and `php artisan ui vue --auth`
49+
8. In your terminal run `composer dump-autoload`
50+
9. Run `php artisan ui 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`
4951
(NOTE: If you run this command several times, be sure to clean up the duplicate Auth entries in routes/web.php)
50-
9. Run `php artisan migrate --seed` to create basic users table
52+
10. Run `php artisan migrate --seed` to create basic users table
5153

5254

5355
## Usage
5456

5557
Register a user or login using **admin@lightbp.com** and **secret** and start testing the preset (make sure to run the migrations and seeders for these credentials to be available).
5658

57-
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.
59+
Besides the dashboard and the auth pages this preset also has 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.
5860

5961
### Dashboard
6062

@@ -87,54 +89,6 @@ public function rules()
8789
];
8890
}
8991
```
90-
91-
### User management
92-
93-
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.
94-
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:
95-
96-
```
97-
<div class="form-group{{ $errors->has('name') ? ' has-danger' : '' }}">
98-
<label class="form-control-label" for="input-name">
99-
<i class="w3-xxlarge fa fa-user"></i>{{ __('Name') }}
100-
</label>
101-
<input type="text" name="name" id="input-name" class="form-control{{ $errors->has('name') ? ' is-invalid' : '' }}" placeholder="{{ __('Name') }}" value="{{ old('name') }}" required autofocus>
102-
103-
@include('alerts.feedback', ['field' => 'name'])
104-
</div>
105-
```
106-
107-
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.
108-
109-
```
110-
public function rules()
111-
{
112-
return [
113-
'name' => [
114-
'required', 'min:3'
115-
],
116-
'email' => [
117-
'required', 'email', Rule::unique((new User)->getTable())->ignore($this->route()->user->id ?? null)
118-
],
119-
'password' => [
120-
$this->route()->user ? 'nullable' : 'required', 'confirmed', 'min:6'
121-
]
122-
];
123-
}
124-
```
125-
126-
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).
127-
128-
All the sample code for the user management can be found in `App\Http\Controllers\UserController`. See store method example bellow:
129-
130-
```
131-
public function store(UserRequest $request, User $model)
132-
{
133-
$model->create($request->merge(['password' => Hash::make($request->get('password'))])->all());
134-
135-
return redirect()->route('user.index')->withStatus(__('User successfully created.'));
136-
}
137-
```
13892
## Table of Contents
13993

14094
* [Versions](#versions)
@@ -387,8 +341,6 @@ The documentation for the Light Bootstrap Dashboard Laravel is hosted at our [we
387341
│   ├── profile
388342
│   │   └── edit.blade.php
389343
│   ├── users
390-
│   │   ├── create.blade.php
391-
│   │   ├── edit.blade.php
392344
│   │   └── index.blade.php
393345
│   └── welcome.blade.php
394346
├── routes
@@ -413,38 +365,6 @@ The documentation for the Light Bootstrap Dashboard Laravel is hosted at our [we
413365
│   │   │   └── bDASqge6ugwwnupCJQxc6UpeCzU5mWnlBf3OtHbV
414366
│   │   ├── testing
415367
│   │   └── views
416-
│   │   ├── 04b958597ac91af5b8ebb75038df5d900297b6a7.php
417-
│   │   ├── 05829f4c1315a44d2904e84933b90d416144f630.php
418-
│   │   ├── 05c5b9d007a38fc4b785152d465481de7a93bed6.php
419-
│   │   ├── 0634ddc2d2d29656d3f4576c6d7b623791e2518c.php
420-
│   │   ├── 24f1083e9b186b7f55cc8c6649c5dbdd3dacdc62.php
421-
│   │   ├── 27934ff5ea17b73d8fa6e99667900193091d90a1.php
422-
│   │   ├── 3165176f58ae96f4f02e42be6b4515eebfdfb36f.php
423-
│   │   ├── 57323755d2658f87f735b891a73af859f3b26e47.php
424-
│   │   ├── 59ef904b35dc7837736542c9700d1ee72a871dba.php
425-
│   │   ├── 5c19801a059c8b15432eed2cbbc1a15cb266275a.php
426-
│   │   ├── 5de1492ae4c3ed70b23edf4e796ae22e1e8a1714.php
427-
│   │   ├── 617582690557c899eb5cfe5c3358d722ae038c37.php
428-
│   │   ├── 63779ff629d693180563c0b4d1c4c0734b517c9c.php
429-
│   │   ├── 642c59cb17d565e1fd038dd4268ec2642d9a2ccf.php
430-
│   │   ├── 709415e6e1f3c7c40434b424285d28e7565ba8e1.php
431-
│   │   ├── 7446704d3fce78ba7e3fc792f8c9ffbbf5c71897.php
432-
│   │   ├── 7a7c0c219ee4d45946f89ad299f9445cdaaa53d8.php
433-
│   │   ├── 7d0fb617fee39e1a3352563d6ab5daeebf8c4bc6.php
434-
│   │   ├── 8faacd4a293449e932d4c5af9a503d69d45fcd0b.php
435-
│   │   ├── a4190e3cd4cb63dce221782d8d14f0385da2d90f.php
436-
│   │   ├── a72b165d948d61cf2e235be6154470a8937a3bfc.php
437-
│   │   ├── bc28b536048dacbd265d18e8f2cd044f55bd7cbd.php
438-
│   │   ├── bd791cb3de118fb816e39a0e7c83ab29633d81b4.php
439-
│   │   ├── cd6ad60026b669d0ebdbdfb8483dc28be06ecdce.php
440-
│   │   ├── d0bc6a520831ef96fb30a18c8be7139451677793.php
441-
│   │   ├── d495b8de2860ebdac0f385d83d6c9d6d76c09718.php
442-
│   │   ├── d52af56743543221251745c688e164f2e81259fe.php
443-
│   │   ├── d530924a1a223139a7890de97017614e8ce1247b.php
444-
│   │   ├── df19ac7c63550101893f8c4b5adbabe5fbe75b2f.php
445-
│   │   ├── e480cadcf735d470f8aee77b42d1b5f734adf1b0.php
446-
│   │   ├── e95e32fec19936a599650d431a2eccc2f77e7bfa.php
447-
│   │   └── f28fc2172870340ba966e4550a16b92964e9cd93.php
448368
│   └── logs
449369
│   ├── laravel-2019-08-07.log
450370
│   ├── laravel-2019-08-08.log

src/LightBootstrapPreset.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace LaravelFrontendPresets\LightBootstrapPreset;
44

55
use Illuminate\Filesystem\Filesystem;
6-
use Illuminate\Foundation\Console\Presets\Preset;
6+
use Laravel\Ui\Presets\Preset;
77

88
class LightBootstrapPreset extends Preset
99
{
@@ -104,7 +104,7 @@ protected static function updateAuthViews()
104104
// Add Auth routes in 'routes/web.php'
105105
file_put_contents(
106106
'./routes/web.php',
107-
"Auth::routes();\n\nRoute::get('/home', 'HomeController@index')->name('dashboard');\n\n",
107+
"Auth::routes();\n\nRoute::get('/home', 'App\Http\Controllers\HomeController@index')->name('dashboard');\n\n",
108108
FILE_APPEND
109109
);
110110

@@ -121,7 +121,7 @@ protected static function updateAuthViews()
121121
public static function addUserManagement()
122122
{
123123
// Add seeder, controllers, requests and rules
124-
static::copyDirectory('database/seeds', app_path('../database/seeds'));
124+
static::copyDirectory('database/seeds', app_path('../database/seeders'));
125125

126126
static::copyFile('app/Http/Controllers/UserController.php', app_path('Http/Controllers/UserController.php'));
127127
static::copyFile('app/Http/Controllers/ProfileController.php', app_path('Http/Controllers/ProfileController.php'));
@@ -131,7 +131,7 @@ public static function addUserManagement()
131131
// Add routes
132132
file_put_contents(
133133
'./routes/web.php',
134-
"Route::group(['middleware' => 'auth'], function () {\n\tRoute::resource('user', 'UserController', ['except' => ['show']]);\n\tRoute::get('profile', ['as' => 'profile.edit', 'uses' => 'ProfileController@edit']);\n\tRoute::patch('profile', ['as' => 'profile.update', 'uses' => 'ProfileController@update']);\n\tRoute::patch('profile/password', ['as' => 'profile.password', 'uses' => 'ProfileController@password']);\n});\n\n",
134+
"Route::group(['middleware' => 'auth'], function () {\n\tRoute::resource('user', 'App\Http\Controllers\UserController', ['except' => ['show']]);\n\tRoute::get('profile', ['as' => 'profile.edit', 'uses' => 'App\Http\Controllers\ProfileController@edit']);\n\tRoute::patch('profile', ['as' => 'profile.update', 'uses' => 'App\Http\Controllers\ProfileController@update']);\n\tRoute::patch('profile/password', ['as' => 'profile.password', 'uses' => 'App\Http\Controllers\ProfileController@password']);\n});\n\n",
135135
FILE_APPEND
136136
);
137137

@@ -153,7 +153,7 @@ public static function addPages()
153153
// Add routes
154154
file_put_contents(
155155
'./routes/web.php',
156-
"Route::group(['middleware' => 'auth'], function () {\n\tRoute::get('{page}', ['as' => 'page.index', 'uses' => 'PageController@index']);\n});\n\n",
156+
"Route::group(['middleware' => 'auth'], function () {\n\tRoute::get('{page}', ['as' => 'page.index', 'uses' => 'App\Http\Controllers\PageController@index']);\n});\n\n",
157157
FILE_APPEND
158158
);
159159

src/LightBootstrapPresetServiceProvider.php

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

55
use Illuminate\Support\ServiceProvider;
66
use Illuminate\Foundation\Console\PresetCommand;
7+
use Laravel\Ui\UiCommand; use Laravel\Ui\AuthCommand;
78

89
class LightBootstrapPresetServiceProvider extends ServiceProvider
910
{
@@ -14,7 +15,7 @@ class LightBootstrapPresetServiceProvider extends ServiceProvider
1415
*/
1516
public function boot()
1617
{
17-
PresetCommand::macro('light-bootstrap', function ($command) {
18+
UiCommand::macro('light-bootstrap', function ($command) {
1819
LightBootstrapPreset::install();
1920

2021
$command->info('Light Bootstrap scaffolding installed successfully.');

src/light-bootstrap-stubs/app/Http/Controllers/UserController.php

Lines changed: 2 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace App\Http\Controllers;
44

5-
use App\User;
5+
use App\Models\User;
66
use App\Http\Requests\UserRequest;
77
use Illuminate\Support\Facades\Hash;
88

@@ -11,76 +11,11 @@ class UserController extends Controller
1111
/**
1212
* Display a listing of the users
1313
*
14-
* @param \App\User $model
14+
* @param \App\Models\User $model
1515
* @return \Illuminate\View\View
1616
*/
1717
public function index(User $model)
1818
{
1919
return view('users.index', ['users' => $model->paginate(15)]);
2020
}
21-
22-
/**
23-
* Show the form for creating a new user
24-
*
25-
* @return \Illuminate\View\View
26-
*/
27-
public function create()
28-
{
29-
return view('users.create');
30-
}
31-
32-
/**
33-
* Store a newly created user in storage
34-
*
35-
* @param \App\Http\Requests\UserRequest $request
36-
* @param \App\User $model
37-
* @return \Illuminate\Http\RedirectResponse
38-
*/
39-
public function store(UserRequest $request, User $model)
40-
{
41-
$model->create($request->merge(['password' => Hash::make($request->get('password'))])->all());
42-
43-
return redirect()->route('user.index')->withStatus(__('User successfully created.'));
44-
}
45-
46-
/**
47-
* Show the form for editing the specified user
48-
*
49-
* @param \App\User $user
50-
* @return \Illuminate\View\View
51-
*/
52-
public function edit(User $user)
53-
{
54-
return view('users.edit', compact('user'));
55-
}
56-
57-
/**
58-
* Update the specified user in storage
59-
*
60-
* @param \App\Http\Requests\UserRequest $request
61-
* @param \App\User $user
62-
* @return \Illuminate\Http\RedirectResponse
63-
*/
64-
public function update(UserRequest $request, User $user)
65-
{
66-
$user->update(
67-
$request->merge(['password' => Hash::make($request->get('password'))])
68-
->except([$request->get('password') ? '' : 'password']
69-
));
70-
71-
return redirect()->route('user.index')->withStatus(__('User successfully updated.'));
72-
}
73-
74-
/**
75-
* Remove the specified user from storage
76-
*
77-
* @param \App\User $user
78-
* @return \Illuminate\Http\RedirectResponse
79-
*/
80-
public function destroy(User $user)
81-
{
82-
$user->delete();
83-
84-
return redirect()->route('user.index')->withStatus(__('User successfully deleted.'));
85-
}
8621
}

src/light-bootstrap-stubs/app/Http/Requests/ProfileRequest.php

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

33
namespace App\Http\Requests;
44

5-
use App\User;
5+
use App\Models\User;
66
use Illuminate\Validation\Rule;
77
use Illuminate\Foundation\Http\FormRequest;
88

src/light-bootstrap-stubs/app/Http/Requests/UserRequest.php

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

33
namespace App\Http\Requests;
44

5-
use App\User;
5+
use App\Models\User;
66
use Illuminate\Validation\Rule;
77
use Illuminate\Foundation\Http\FormRequest;
88

src/light-bootstrap-stubs/database/seeds/DatabaseSeeder.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
2+
namespace Database\Seeders;
23

4+
use Illuminate\Support\Facades\DB;
35
use Illuminate\Database\Seeder;
46

57
class DatabaseSeeder extends Seeder

src/light-bootstrap-stubs/database/seeds/UsersTableSeeder.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
2+
namespace Database\Seeders;
23

4+
use Illuminate\Support\Facades\DB;
35
use Illuminate\Database\Seeder;
46
use Illuminate\Support\Facades\Hash;
57

src/light-bootstrap-stubs/resources/views/alerts/migrations_check.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@if (!\Schema::hasTable((new \App\User)->getTable()))
1+
@if (!\Schema::hasTable((new \App\Models\User)->getTable()))
22
<div class="alert alert-danger fade show" role="alert">
33
{{ __('You did not run the migrations and seeders! The login information will not be available!') }}
44
</div>

src/light-bootstrap-stubs/resources/views/auth/verify.blade.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@
1515
@endif
1616

1717
{{ __('Before proceeding, please check your email for a verification link.') }}
18-
{{ __('If you did not receive the email') }}, <a href="{{ route('verification.resend') }}">{{ __('click here to request another') }}</a>.
18+
{{ __('If you did not receive the email') }},
19+
<form class="d-inline" method="POST" action="{{ route('verification.resend') }}">
20+
@csrf
21+
<button type="submit" class="btn btn-link p-0 m-0 align-baseline">{{ __('click here to request another') }}</button>.
22+
</form>
1923
</div>
2024
</div>
2125
</div>

0 commit comments

Comments
 (0)