Skip to content

Commit 513e735

Browse files
committed
improve readme and add license
1 parent 2e1cddd commit 513e735

File tree

3 files changed

+35
-20
lines changed

3 files changed

+35
-20
lines changed

CHANGELOG.md

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

LICENSE.md

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
1-
# The license
1+
The MIT License (MIT)
22

3-
Copyright (c) Steve Thomas <steve@codinglabs.com.au>
3+
Copyright (c) Coding Labs Pty Ltd <steve@codinglabs.com.au>
44

5-
...Add your license text here...
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

README.md

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,21 @@ Route::middleware('role:employee')->...
7777
Route::middleware('role:manager|admin')->...
7878
```
7979

80+
Or in the construct method in a controller:
81+
```php
82+
class ManagerDashboardController extends Controller
83+
{
84+
public function __construct()
85+
{
86+
$this->middleware('role:manager');
87+
}
88+
89+
...
90+
}
91+
```
92+
93+
If the middleware check fails, a 403 response will be returned.
94+
8095
### Check roles on a user
8196
Call hasRole on the user model:
8297
```php
@@ -119,19 +134,11 @@ Vue.mixin({
119134
<div v-if="hasRole('manager')">I am a manager</div>
120135
```
121136

122-
## Change log
123-
Please see the [changelog](changelog.md) for more information on what has changed recently.
124-
125-
## Testing
126-
``` bash
127-
$ composer test
128-
```
129-
130137
## Contributing
131138
Please see [contributing.md](contributing.md) for details and a todolist.
132139

133140
## Security
134-
If you discover any security related issues, create an Issue.
141+
If you discover any security related issues, create an issue on GitHub.
135142

136143
## Credits
137144
- [Steve Thomas](https://github.com/stevethomas)

0 commit comments

Comments
 (0)