-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
17caeb7
commit a4a3373
Showing
2 changed files
with
69 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,48 @@ | ||
# company-certification | ||
企业认证 | ||
|
||
>企业认证 | ||
## 1.安装 | ||
|
||
```shell script | ||
composer require wang-tech-commits/company-certification | ||
``` | ||
|
||
## 2.初始化 | ||
|
||
```shell script | ||
php artisan vendor:publish --provider="MrwangTc\CompanyCertification\ServiceProvider" | ||
|
||
php artisan migrate | ||
``` | ||
|
||
## 3.使用 | ||
|
||
### 1.调整用户模型 | ||
|
||
```php | ||
<?php | ||
|
||
use MrwangTc\CompanyCertification\Certification\Traits\UserHasCompanyCertification; | ||
|
||
class User { | ||
|
||
use UserHasCompanyCertification; | ||
} | ||
``` | ||
|
||
### 2.增加路由 | ||
|
||
```php | ||
<?php | ||
|
||
use MrwangTc\CompanyCertification\CompanyCertification; | ||
|
||
|
||
/** | ||
* $prefix string 路由前缀 | ||
* 当前方法推荐放置于需授权的路由作用域内 | ||
*/ | ||
CompanyCertification::routes('user'); | ||
|
||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
namespace MrwangTc\CompanyCertification; | ||
|
||
use Illuminate\Routing\Router; | ||
use Illuminate\Support\Facades\Route; | ||
|
||
class CompanyCertification | ||
{ | ||
public static function routes(string $prefix = '') | ||
{ | ||
Route::group([ | ||
'namespace' => '\MrwangTc\CompanyCertification\Certification\Controller', | ||
'prefix' => $prefix, | ||
], function (Router $router) { | ||
$router->get('companycertification', 'CompanyCertificationController@index'); | ||
$router->get('companycertification/create', 'CompanyCertificationController@index'); | ||
$router->post('companycertification', 'CompanyCertificationController@store'); | ||
$router->put('companycertification/{companycertification}', 'CompanyCertificationController@update'); | ||
}); | ||
} | ||
} |