PHP code example of onix-systems-php / hyperf-inertia

1. Go to this page and download the library: Download onix-systems-php/hyperf-inertia 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/ */

    

onix-systems-php / hyperf-inertia example snippets

 ./bin/hyperf.php inertia:init 
 
  'http' => [
        \App\Common\Middleware\HandleInertiaMiddleware::class,
    ],
  

    #[GetMapping(path: '/test-feedback')]
    public function test(RequestInterface $request)
    {
        return inertia('Test', [
            'title' => 'Feedback form',
            'formTitle' => "What's on your mind?"
        ])->toResponse($request);
    }

    #[PostMapping('/test-feedback')]
    public function testFeedback(RequestInterface $request)
    {
        $rules = [
            'fullname' => 'onFactory->make($request->all(), $rules);
        $validator->validate();

        return redirect_with('test-feedback', [
            'alert' => [
                'message' => 'Feedback was successfully sent',
                'type' => 'success',
            ],
        ]);
    }
 composer 
 php ./bin/hyperf.php vendor:publish  onix-systems-php/hyperf-inertia
./bin/hyperf.php inertia:init
 php ./bin/hyperf.php inertia:start-ssr