The Tonka PHP Framework Inertia.js Adapter allows you to seamlessly integrate Inertia.js with the Tonka PHP Framework. This adapter enables you to build modern single-page applications (SPAs) while leveraging server-side rendering and routing.
- Easy Integration: Quickly set up Inertia.js with Tonka.
- Automatic Responses: Handle Inertia responses directly from your controllers.
- Supports Multiple Frameworks: Works with Vue.js, React, and Svelte.
- Navigation Handling: Simplified link handling and navigation management.
- Error Handling: Built-in support for error pages and validation messages.
You can install the Tonka Inertia.js Adapter via Composer:
composer require inertia/tonka-adapterMake sure to install the Inertia.js client-side adapter for your chosen framework:
npm install @inertiajs/inertia @inertiajs/inertia-vueCreate a Controller to handle Inertia responses:
use Inertia\Inertia;
Route::get('/dashboard', function () {
return Inertia::render('Dashboard', [
'user' => auth()->user(),
'notifications' => Notification::recent(),
]);
});<template>
<div>
<h1>{{ message }}</h1>
</div>
</template>
<script>
export default {
props: {
message: String
}
}
</script>Contributions are welcome! Please open an issue or submit a pull request.
- Fork the repository.
- Create your feature branch: git checkout -b feature/my-new-feature
- Commit your changes: git commit -m 'Add some feature'
- Push to the branch: git push origin feature/my-new-feature
- Open a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.