用於在Laravel文檔的Authorization
服務的部分指出了一些例子,如:Laravel 5授權服務中存儲的能力在哪裏?
// Models
if ($request->user()->can('update-post', $post)) {
// Update Post...
}
// Views
@can('update-post', $post)
<a href="/post/{{ $post->id }}/edit">Edit Post</a>
@endcan
但是,沒有提及任何形式的migration
和schema
。
abilities
如何以及在哪裏存儲?
'能力'在[服務提供者](https://laravel.com/docs/5.2/authorization#defining-abilities)和/或[策略類](https://laravel.com)中定義/docs/5.2/authorization#policies)。這些功能的邏輯取決於您的要求。 – Fiete
我的答案是否有意義,或者你想要更多的澄清任何事情? –