Ai
4 Star 1 Fork 0

Gitee 极速下载/tipask

Create your Gitee Account
Explore and code with more than 13.5 million developers,Free private repositories !:)
Sign up
文件
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/sdfsky/tipask
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
Clone or Download
ArticlePolicy.php 732 Bytes
Copy Edit Raw Blame History
sdfsky authored 2019-10-15 16:10 +08:00 . add v3.5 featrue
<?php
/**
* Created by PhpStorm.
* User: sdf_sky
* Date: 2018/5/9
* Time: 下午6:41
*/
namespace App\Policies;
use App\Models\Article;
use App\Models\User;
use App\Policies\Traits\AdminTrait;
class ArticlePolicy
{
use AdminTrait;
public function create(User $user, Article $article){
return $article->user_id == $user->id;
}
public function update(User $user,Article $article){
return $article->user_id == $user->id;
}
public function updateInTime(User $user,Article $article){
if( Setting()->get('edit_article_timeout') && $article->created_at->diffInMinutes() > Setting()->get('edit_article_timeout') ){
return false;
}
return true;
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/mirrors/tipask.git
git@gitee.com:mirrors/tipask.git
mirrors
tipask
tipask
master

Search