w0bm.com v1.5z FULL.RETARD.BUILD.BUT.STILL.WORKS
This commit is contained in:
35
app/Models/Icon.php
Normal file
35
app/Models/Icon.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Icon extends Model
|
||||
{
|
||||
public $timestamps = false;
|
||||
|
||||
public function roles() {
|
||||
return $this->hasMany(Role::class);
|
||||
}
|
||||
|
||||
public function users() {
|
||||
return $this->hasMany(User::class);
|
||||
}
|
||||
|
||||
public function toJson($options = 0) {
|
||||
return parent::toJson($options);
|
||||
}
|
||||
|
||||
public function __toString() {
|
||||
switch ($this->icon_type) {
|
||||
case 'fa':
|
||||
return '<i class="fa fa-' . $this->icon . '"></i>';
|
||||
case 'img':
|
||||
case 'image':
|
||||
return '<img class="icon" src="https://s.w0bm.com/' . ltrim($this->icon, '/') . '" alt="' . $this->icon . '">';
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user