PHP code example of aozen / prism2torchlight
1. Go to this page and download the library: Download aozen/prism2torchlight 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/ */
aozen / prism2torchlight example snippets
use Aozen\Prism2Torchlight\TorchlightCast;
class YourModel extends Model
{
protected $casts = [
'text' => TorchlightCast::class,
];
}
$text = '<pre class="language-php"><code>echo "Hello, Laravel!";</code></pre>';
$convertedText = Prism2Torchlight\Prism2Torchlight::convertToTorchlight($text);
echo $convertedText;