PluginProbe
پینوا | Pinova / trunk
پینوا | Pinova vtrunk
pinova / src / Models / Block.php

Block.php in پینوا | Pinova trunk, at src/Models/Block.php

47 lines 836 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Pinova\Models;
4
5 use Carbon\Carbon;
6 use Illuminate\Database\Eloquent\Model;
7
8 /**
9 * Class Blacklist
10 *
11 * @package Pinova\Models
12 *
13 * @property int $id
14 * @property string $identifier
15 * @property int $blocked_by
16 * @property string $blocked_by_label
17 * @property Carbon $blocked_until
18 *
19 * @method static Block create( array $attributes = [] )
20 */
21 class Block extends Model {
22
23 protected $table = 'pinova_blocks';
24
25 protected $fillable = [
26 'identifier',
27 'blocked_by',
28 'blocked_until',
29 ];
30
31 public $timestamps = false;
32
33 public $casts = [
34 'blocked_until' => 'datetime',
35 ];
36
37 public function getBlockedByLabelAttribute() {
38
39 if ( is_null( $this->blocked_by ) ) {
40 return 'سیست�
41 ی';
42 }
43
44 return get_userdata( $this->blocked_by )->display_name;
45 }
46 }
47