PHP code example of uiibevy / flutzig
1. Go to this page and download the library: Download uiibevy/flutzig 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/ */
uiibevy / flutzig example snippets
Route::get('posts', fn (Request $request) => /* ... */)->name('posts.index');
Route::get('posts/{post}', fn (Post $post) => /* ... */)->name('posts.show');
Route::get('venues/{venue}/events/{event}', fn (Venue $venue, Event $event) => /* ... */)
->name('venues.events.show');
Route::get('venues/{venue}/events/{event}', fn (Venue $venue, Event $event) => /* ... */)
->name('venues.events.show');
Route::get('{locale}/posts/{post}', fn (Post $post) => /* ... */)->name('posts.show');
// app/Http/Middleware/SetLocale.php
URL::defaults(['locale' => $request->user()->locale ?? 'de']);
// app/Models/Post.php
class Post extends Model
{
public function getRouteKeyName()
{
return 'slug';
}
}
Route::get('blog/{post}', function (Post $post) {
return view('posts.show', ['post' => $post]);
})->name('posts.show');
Route::get('authors/{author}/photos/{photo:uuid}', fn (Author $author, Photo $photo) => /* ... */)
->name('authors.photos.show');
// config/flutzig.php
return [
'only' => ['home', 'posts.index', 'posts.show'],
];
// config/flutzig.php
return [
'except' => ['_debugbar.*', 'horizon.*', 'admin.*'],
];
// config/flutzig.php
return [
'groups' => [
'admin' => ['admin.*', 'users.*'],
'author' => ['posts.*'],
],
];
bash
php artisan flutzig:generate