PHP code example of calvient / puddleglum

1. Go to this page and download the library: Download calvient/puddleglum 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/ */

    

calvient / puddleglum example snippets


return [
   'output' => resource_path('ts/puddleglum.ts'),
];
 
class UserLogin extends FormRequest
{
	public function authorize()
	{
		return true;
	}

	public function rules()
	{
		return [
			'email' => '

#[GlumRequest(['name' => 'string', 'email' => 'string', 'password' => 'string'])]
public function register(Request $request) {
    $request->validate([
        'name' => 'mbers()
            ->symbols()
            ->uncompromised(),
    ]);
}

#[GlumResponse(['user' => 'User', 'message' => 'string'])]
public function show(User $user): User
{
    return response()->json([
        'user' => $user,
        'message' => 'Hello, world!',
    ]);
}
bash
php artisan vendor:publish --provider="Calvient\Puddleglum\PuddleglumServiceProvider" --tag="puddleglum-config"
bash
php artisan puddleglum:generate
bash
php artisan make:request StoreUser