Skip to content

han48/mr4-lc.content-protected

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Content protected editor extension for laravel-admin

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

Screenshot 2023-11-16 at 18 32 03

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).