PHP code example of arrowsgm / amped-laravel
1. Go to this page and download the library: Download arrowsgm/amped-laravel 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/ */
arrowsgm / amped-laravel example snippets
...
use Arrowsgm\Amped\Facades\Amped;
...
class PostController extends Controller
{
...
public function show(Post $post)
{
...
$amp_content = Amped::convert($post->content);
...
}
...
}
bash
php artisan vendor:publish --tag=amped-config
blade
<a
href="{{ route('post.show', $prev_post->slug) }}/amp{!! Amped::isDevParam() !!}"
class="links links-prev">{{ $prev_post->name }}</a>