Skip to content

Commit 857f889

Browse files
committed
2 parents 5948260 + 09bc437 commit 857f889

File tree

3 files changed

+50
-43
lines changed

3 files changed

+50
-43
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Changelog
22

3-
All notable changes to `:package_name` will be documented in this file.
3+
All notable changes to `access-tree` will be documented in this file.

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) :vendor_name <author@domain.com>
3+
Copyright (c) access-tree <olaiwolaakeem@gmail.com>
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 48 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,81 @@
1-
# :package_description
1+
# This package is to all access and permission rights in any laravel project
22

3-
[![Latest Version on Packagist](https://img.shields.io/packagist/v/:vendor_slug/:package_slug.svg?style=flat-square)](https://packagist.org/packages/:vendor_slug/:package_slug)
4-
[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/:vendor_slug/:package_slug/run-tests.yml?branch=main&label=tests&style=flat-square)](https://github.com/:vendor_slug/:package_slug/actions?query=workflow%3Arun-tests+branch%3Amain)
5-
[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/:vendor_slug/:package_slug/fix-php-code-style-issues.yml?branch=main&label=code%20style&style=flat-square)](https://github.com/:vendor_slug/:package_slug/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain)
6-
[![Total Downloads](https://img.shields.io/packagist/dt/:vendor_slug/:package_slug.svg?style=flat-square)](https://packagist.org/packages/:vendor_slug/:package_slug)
7-
<!--delete-->
8-
---
9-
This repo can be used to scaffold a Laravel package. Follow these steps to get started:
3+
This package is to all access and permission rights in any laravel project
104

11-
1. Press the "Use this template" button at the top of this repo to create a new repo with the contents of this skeleton.
12-
2. Run "php ./configure.php" to run a script that will replace all placeholders throughout all the files.
13-
3. Have fun creating your package.
14-
4. If you need help creating a package, consider picking up our <a href="https://laravelpackage.training">Laravel Package Training</a> video course.
15-
---
16-
<!--/delete-->
17-
This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.
18-
19-
## Support us
20-
21-
[<img src="https://github-ads.s3.eu-central-1.amazonaws.com/:package_name.jpg?t=1" width="419px" />](https://spatie.be/github-ad-click/:package_name)
22-
23-
We invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us).
24-
25-
We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on [our contact page](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards).
265

276
## Installation
287

298
You can install the package via composer:
309

3110
```bash
32-
composer require :vendor_slug/:package_slug
11+
composer require obrainwave/access-tree
3312
```
3413

3514
You can publish and run the migrations with:
3615

3716
```bash
38-
php artisan vendor:publish --tag=":package_slug-migrations"
17+
php artisan vendor:publish --tag=":access-tree-migrations"
3918
php artisan migrate
4019
```
4120

4221
You can publish the config file with:
4322

4423
```bash
45-
php artisan vendor:publish --tag=":package_slug-config"
24+
php artisan vendor:publish --tag="access-tree-config"
4625
```
4726

48-
This is the contents of the published config file:
27+
## Usage
4928

29+
Create a Permission
5030
```php
51-
return [
52-
];
31+
$data = [
32+
'name' => 'Add User',
33+
'status' => 1 or 0
34+
];
35+
$create = createAccess($data, 'permission');
36+
echo $create;
5337
```
5438

55-
Optionally, you can publish the views using
56-
57-
```bash
58-
php artisan vendor:publish --tag=":package_slug-views"
39+
Update a Permission
40+
```php
41+
$data = [
42+
'data_id' => permission id from Obrainwave\AccessTree\Models\Permission // 3,
43+
'name' => 'Add User',
44+
'status' => 1 or 0
45+
];
46+
$update = updateAccess($data, 'permission');
47+
echo $update;
5948
```
6049

61-
## Usage
62-
50+
Create Roles
6351
```php
64-
$variable = new VendorName\Skeleton();
65-
echo $variable->echoPhrase('Hello, VendorName!');
52+
$data = [
53+
'name' => 'Admin',
54+
'status' => 1 or 0
55+
];
56+
$permission_ids = array of permission ids from Obrainwave\AccessTree\Models\Permission // array(1, 5, 4);
57+
$create = createAccess($data, 'role', $permission_ids);
58+
echo $create;
6659
```
6760

68-
## Testing
61+
Update Roles
62+
```php
63+
$data = [
64+
'data_id' => role id // 5,
65+
'name' => 'Admin Staff',
66+
'status' => 1 or 0
67+
];
68+
$permission_ids = array of permission ids from Obrainwave\AccessTree\Models\Permission // array(10, 6, 3);
69+
$update = updateAccess($data, 'role', $permission_ids);
70+
echo $update;
71+
```
6972

70-
```bash
71-
composer test
73+
Create User Role
74+
```php
75+
$roles = array of roles from Obrainwave\AccessTree\Models\Role // array(2, 5);
76+
$user_id = id of a user from App\Models\User // 1;
77+
$user_role = createUserRole($roles, $user_id);
78+
echo $user_role;
7279
```
7380

7481
## Changelog
@@ -85,7 +92,7 @@ Please review [our security policy](../../security/policy) on how to report secu
8592

8693
## Credits
8794

88-
- [:author_name](https://github.com/:author_username)
95+
- [Olaiwola Akeem Salau](https://github.com/Obrainwave)
8996
- [All Contributors](../../contributors)
9097

9198
## License

0 commit comments

Comments
 (0)