PHP code example of aw-studio / fjord-ui-kit

1. Go to this page and download the library: Download aw-studio/fjord-ui-kit 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/ */

    

aw-studio / fjord-ui-kit example snippets


<x-fj-image :image="$model->image"/>

<x-fj-image :image="$model->image" :lazy="false" />

namespace FjordApp\Config\Form\Navigations;

class MainNavigationConfig extends FormConfig
{
	public function show(CrudShow $page)
    {
        $page->card(function ($form) {
            $form->nav('main')->title('Main Navigation')->maxDepth(3);
        });
    }
}

use Fjord\Support\Facades\Form;

$nav = Form::load('navigations', 'main_navigation');

<x-fj-nav-list :list="$nav->main" layout="horizontal" dropdown/>

// lang/de/routes.php

return [
    'home' => 'startseite'
];

Route::trans('/__(routes.home)', 'HomeController@show')->name('home');

<a href="{{ __route('home') }}">
    ...
</a>

<a href="{{ Request::route()->translate('de') }}">Deutsch</a>

// ./routes/web.php
Route::trans('/{slug}', 'MyController@show')->translator('getSlug')->name('home');

// ./app/Http/Controllers/MyController.php

...

class MyController extends Controller
{
	...

	public function getSlug($locale, $slug)
	{
		$slug = Post::whereTranslation('slug', $slug)
			->first()
			->translate($locale)
			->slug;

		return ['slug' => $slug];
	}
}

<x-fj-localize />

<x-fj-localize>
	<x-slot name="en">
		English
	</x-slot>
	<x-slot name="de">
		Deutsch
	</x-slot>
</x-fj-localize>

$form->route('route_field')->collection('app')->title('Pick a route.');

@foreach($data->list as $item)
	<span class="child_is_active($item, 'route_field', 'is-active')">
		{{ $item->title }}
	</span>
@endforeach

@bot
	i'm a bot
@else
	i'm human
@endbot
shell
php artisan vendor:publish --provider="Fjord\Ui\FjordUiServiceProvider" --tag=views
shell
php artisan fjord:form --collection=navigations --form=main_navigation