1. Go to this page and download the library: Download fuelviews/app-wrapper 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/ */
fuelviews / app-wrapper example snippets
use Fuelviews\SabHeroWrapper\Models\Page;
// Create a new page
$page = Page::create([
'title' => 'About Us',
'slug' => 'about',
'description' => 'Learn more about our company and mission.',
'feature_image' => 'path/to/image.jpg'
]);
// Add feature image via media library
$page->addMediaFromUrl('https://example.com/image.jpg')
->toMediaCollection('page_feature_image');
// The page automatically provides SEO data
$seoData = $page->getDynamicSEOData();
use Fuelviews\SabHeroWrapper\Facades\SabHeroWrapper;
// Check if a feature is enabled
if (SabHeroWrapper::isFeatureEnabled('navigation_enabled')) {
// Navigation is enabled
}
// Get all enabled features
$enabledFeatures = SabHeroWrapper::getEnabledFeatures();
// Get package version
$version = SabHeroWrapper::version();
// In your routes/web.php
Route::get('/', function () {
return view('home');
})->name('home');
// The view composer will automatically look for a Page with slug 'home'
// and make it available as $seoPage in your views