mr4-lc / content-protected
Laravel content protected
Installs: 2
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Language:JavaScript
Requires
- php: >=7.0.0
Requires (Dev)
- phpunit/phpunit: >=6.0
README
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.
Screenshot
Installation
composer require mr4-lc/content-protected php artisan vendor:publish --tag=mr4-lc-content-protected --force
Configuration
Usage
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>
License
Licensed under The MIT License (MIT).