Skip to content

Commit f7d58c2

Browse files
Merge pull request #8 from creativetimofficial/master
Upadate readme
2 parents cc738b7 + 5916d59 commit f7d58c2

File tree

7 files changed

+418
-322
lines changed

7 files changed

+418
-322
lines changed

.vscode/settings.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"workbench.colorCustomizations": {
3+
"activityBar.background": "#57151F",
4+
"titleBar.activeBackground": "#7A1D2B",
5+
"titleBar.activeForeground": "#FEFBFB"
6+
}
7+
}

readme.md

Lines changed: 1 addition & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ After initializing a fresh instance of Laravel (and making all the necessary con
5454

5555
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).
5656

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.
57+
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.
5858

5959
### Dashboard
6060

@@ -87,57 +87,6 @@ public function rules()
8787
];
8888
}
8989
```
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="row">
98-
<label class="col-sm-2 col-form-label">{{ __('Name') }}</label>
99-
<div class="col-sm-7">
100-
<div class="form-group{{ $errors->has('name') ? ' has-danger' : '' }}">
101-
<input class="form-control{{ $errors->has('name') ? ' is-invalid' : '' }}" name="name" id="input-name" type="text" placeholder="{{ __('Name') }}" value="{{ old('name') }}" required="true" aria-required="true"/>
102-
@if ($errors->has('name'))
103-
<span id="name-error" class="error text-danger" for="input-name">{{ $errors->first('name') }}</span>
104-
@endif
105-
</div>
106-
</div>
107-
</div>
108-
```
109-
110-
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.
111-
112-
```
113-
public function rules()
114-
{
115-
return [
116-
'name' => [
117-
'required', 'min:3'
118-
],
119-
'email' => [
120-
'required', 'email', Rule::unique((new User)->getTable())->ignore($this->route()->user->id ?? null)
121-
],
122-
'password' => [
123-
$this->route()->user ? 'nullable' : 'required', 'confirmed', 'min:6'
124-
]
125-
];
126-
}
127-
```
128-
129-
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).
130-
131-
All the sample code for the user management can be found in `App\Http\Controllers\UserController`. See store method example bellow:
132-
133-
```
134-
public function store(UserRequest $request, User $model)
135-
{
136-
$model->create($request->merge(['password' => Hash::make($request->get('password'))])->all());
137-
138-
return redirect()->route('user.index')->withStatus(__('User successfully created.'));
139-
}
140-
```
14190
## Table of Contents
14291

14392
* [Versions](#versions)
@@ -318,8 +267,6 @@ The documentation for the Paper Dashboard Laravel is hosted at our [website](htt
318267
├── profile
319268
│   └── edit.blade.php
320269
├── users
321-
│   ├── create.blade.php
322-
│   ├── edit.blade.php
323270
│   └── index.blade.php
324271
└── welcome.blade.php
325272
```

src/paper-dashboard-stubs/app/Http/Controllers/UserController.php

Lines changed: 0 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -18,70 +18,4 @@ 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-
$hasPassword = $request->get('password') ? 1 : 0;
67-
$user->update(
68-
$request->merge(['password' => Hash::make($request->get('password'))])
69-
->except([$hasPassword ? '' : 'password']
70-
));
71-
72-
return redirect()->route('user.index')->withStatus(__('User successfully updated.'));
73-
}
74-
75-
/**
76-
* Remove the specified user from storage
77-
*
78-
* @param \App\User $user
79-
* @return \Illuminate\Http\RedirectResponse
80-
*/
81-
public function destroy(User $user)
82-
{
83-
$user->delete();
84-
85-
return redirect()->route('user.index')->withStatus(__('User successfully deleted.'));
86-
}
8721
}

src/paper-dashboard-stubs/resources/views/pages/upgrade.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
</tr>
4242
<tr>
4343
<td>Users management</td>
44-
<td class="text-center"><i class="fa fa-check text-success"></i></td>
44+
<td class="text-center"><i class="fa fa-times text-danger"></i></td>
4545
<td class="text-center"><i class="fa fa-check text-success"></i></td>
4646
</tr>
4747
<tr>

src/paper-dashboard-stubs/resources/views/users/create.blade.php

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

src/paper-dashboard-stubs/resources/views/users/edit.blade.php

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

0 commit comments

Comments
 (0)