PHP code example of yasser-elgammal / pure-text
1. Go to this page and download the library: Download yasser-elgammal/pure-text library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
yasser-elgammal / pure-text example snippets
use YasserElgammal\PureText\Traits\PureTextFilterable;
class Post extends Model
{
use PureTextFilterable;
protected $filterable = ['title', 'content'];
}
$post = new Post();
$post->title = "This is a badword example";
$post->content = "Some more text with badword";
$post->save();
echo $post->title; // Outputs: This is a ***
bash
php artisan vendor:publish --provider="YasserElgammal\PureText\PureTextServiceProvider"