This is a laravel
component that integrates [Content protected].
Protected web content.
Mode open:
- Developer (and Crawler) can access tp shadow root.
Mode closed:
- Developer (and Crawler) can access tp shadow root.
composer require mr4-lc/content-protected
php artisan vendor:publish --tag=mr4-lc-content-protected --force
Example router:
$router->get('content-protected', 'HomeController@getContentProtected')->name('content-protected.get');
Example controller:
public function getContentProtected()
{
$id = request()->get('id');
return response("<span>This is protected content <u>$id</u></span>", 200);
}
Example usage
<form action="{{ route('content-protected.get') }}" method="GET" onsubmit="return false;">
<x-mr4-lc.content-protected id="1" />
<x-mr4-lc.content-protected id="2" mode="open"/>
<x-mr4-lc.content-protected id="3" className="customize" adoptedStyleSheets="span { color: red; border: 2px dotted black;}" />
</form>
Basic usage
<x-mr4-lc.content-protected id="1" />
=>
<div class="mr4-lc-content-protected 1 " data-content-id="1" data-mode="closed">
#shadow-root (closed)
<span>This is protected content <u>1</u></span>
</div>
Mode open
<x-mr4-lc.content-protected id="2" mode="open"/>
=>
<div class="mr4-lc-content-protected 2 " data-content-id="2" data-mode="open">
#shadow-root (open)
<span>This is protected content <u>2</u></span>
</div>
Customize CSS
<x-mr4-lc.content-protected id="3" className="customize" />
=>
<div class="mr4-lc-content-protected 2 customize" data-content-id="3" data-mode="closed">
#shadow-root (closed)
<span>This is protected content <u>3</u></span>
</div>
Licensed under The MIT License (MIT).