Skip to content

Latest commit

 

History

History
63 lines (45 loc) · 1.28 KB

README.md

File metadata and controls

63 lines (45 loc) · 1.28 KB

Noscrape Laravel (Example)

Try it out

$ docker run -d -p 8181:8181 noscrape/laravel-example:latest

# on arm machines you may have to run (but a bit slow)
$ docker run -d --platform=amd64 -p 8181:8181 noscrape/laravel-example:latest

open http://localhost:8181/test

Installation

Add the following lines to your composer.json

"repositories": [
    {
        "url": "https://github.com/noscrape/noscrape-php.git",
        "type": "git"
    }
],

ATTENTION! noscrape-php is not yet released but coming soon. 😉

How it works

@see web.php

Route::get('/test', function () {
    $noscrape = new Noscrape(public_path("font/ubuntu.ttf"));

    return view('welcome', [
        'title' => $noscrape->obfuscate("Welcome to Noscrape"),
        'description' => $noscrape->obfuscate("This is text is obfuscated."),
        'font' => $noscrape->render()
    ]);
});

@see welcome.blade.php

<style>
    @font-face {
        font-family: 'noscrape-obfuscated';
        src: url("data:font/truetype;charset=utf-8;base64,{{ $font }}");
    }
    
    .obfuscated {
        font-family: "noscrape-obfuscated";
    }
</style>
...

<h1 class="obfuscated">{{ $title }}</h1>