1. Go to this page and download the library: Download hacp0012/quest 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/ */
hacp0012 / quest example snippets
class PhoneHandler
{
#[QuestSpaw(ref: 'r84d2S1tM')]
function getCodes(): array
{
//...
}
}
#[QuestSpaw(ref: 'my quest flag ID', filePocket: 'guidPicture')]
function yogaStage(int $moon, int $sunRise, UploadedFile $guidPicture = null): int
{
# $guidPicture --> Illuminate\Http\UploadedFile
return $moon + $sunRise;
}
# In your route file
use Hacp0012\Quest\Quest;
Route::get(uri: '/', action: fn() => view('home')); // Exemple ...
$routes = [
Forest::class,
# Or specifie a directory:
// 'app/demo',
];
# Or it can be only the class name.
$routes = Forest::class; // Or directory.
Quest::spawn(uri: 'quest', routes: $routes)->name('my.quest');
# Or
Quest::spaw(uri: 'my/forest', [Forest::class, 'RrOWXRfKOjauvSpc7y']);
// For direct call.
// Note method name, this is `spaw`.
// In your class
class Forest
{
#[QuestSpaw(ref:'NAhLlRZW3g3Fbh30dZ')]
function tree(string $color): int
{
return $this->fruits();
}
function fruits(): int
{
return 18;
}
#[QuestSpaw(ref: 'RrOWXRfKOjauvSpc7y', method: QuestSpawMethod::GET, jsonResponse: false)]
function displayAnApples(int $count): View
{
//...
}
}
// Or from your view blad file:
route('my.quest', ['quest_ref' => 'RrOWXRfKOjauvSpc7y', 'count' => 9]);
# It's simple when you have given a name to your route. `->name('quest')`.