PHP code example of petecoop / laravel-actions-lighthouse
1. Go to this page and download the library: Download petecoop/laravel-actions-lighthouse 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/ */
petecoop / laravel-actions-lighthouse example snippets
use Petecoop\LaravelActionsLighthouse\AsGraphQL;
class SomeAction
{
use AsAction, AsGraphQL;
}
class UpdateUserName
{
use AsAction, AsGraphQL;
public function handle(string $id, string $name)
{
//...
}
}
class SomeAction
{
use AsAction, AsGraphQL;
public function handle(int $userId, string $name)
{
//...
}
public function asGraphQL($_, $args)
{
return $this->handle($args['id'], $args['name']);
}
}
class UpdateUserName
{
use AsAction, AsGraphQL;
public function handle(string $id, string $name)
{
//...
}
public function rules(): array
{
return [
'name' => ['
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.