PHP code example of mischasigtermans / laravel-ogkit
1. Go to this page and download the library: Download mischasigtermans/laravel-ogkit 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/ */
mischasigtermans / laravel-ogkit example snippets
use Ogkit\Ogkit;
class ArticleController extends Controller
{
public function show(Article $article, Ogkit $ogkit)
{
$ogkit->template('layered', [
'title' => $article->title,
'category' => $article->category->name,
'image' => $article->featured_image_url,
]);
return view('articles.show', compact('article'));
}
}
use Ogkit\Ogkit;
class ArticlePage extends Component
{
public function mount(Article $article, Ogkit $ogkit)
{
$ogkit->template('detailed', [
'title' => $article->title,
'readingTime' => $article->reading_time . ' min read',
'category' => $article->category->name,
'image' => $article->featured_image_url,
]);
}
}
$ogkit->template('layered', [
'title' => 'How to Build Great Products',
'category' => 'Engineering',
'image' => asset('images/hero.jpg'),
]);