Files
UNIT3D-Community-Edition/app/Models/Page.php
T
HDVinnie 9a735ba293 Apply fixes from StyleCI
[ci skip] [skip ci]
2019-06-12 18:49:32 +00:00

51 lines
1.7 KiB
PHP
Executable File

<?php
/**
* NOTICE OF LICENSE.
*
* UNIT3D is open-sourced software licensed under the GNU General Public License v3.0
* The details is bundled with this project in the file LICENSE.txt.
*
* @project UNIT3D
*
* @license https://www.gnu.org/licenses/agpl-3.0.en.html/ GNU Affero General Public License v3.0
* @author HDVinnie
*/
namespace App\Models;
use App\Helpers\Bbcode;
use Illuminate\Database\Eloquent\Model;
/**
* @property int $id
* @property string|null $name
* @property string|null $slug
* @property string|null $content
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Page newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Page newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Page query()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Page whereContent($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Page whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Page whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Page whereName($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Page whereSlug($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Page whereUpdatedAt($value)
* @mixin \Eloquent
*/
class Page extends Model
{
/**
* Parse Content And Return Valid HTML.
*
* @return string Parsed BBCODE To HTML
*/
public function getContentHtml()
{
$bbcode = new Bbcode();
return $bbcode->parse($this->content, true);
}
}