PHP code example of shazzoo / content-studio-laravel
1. Go to this page and download the library: Download shazzoo/content-studio-laravel 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/ */
shazzoo / content-studio-laravel example snippets
'tracking' => [
'script_url' => 'https://cdn.example.com/tracking.js',
],
'layout' => 'layouts.app',
use Shazzoo\ContentStudio\Http\Controllers\ArticleController;
Route::prefix('{locale}')->whereIn('locale', ['nl', 'en'])->group(function () {
Route::get('blog', [ArticleController::class, 'index'])->name('blog.index');
Route::get('blog/{slug}', [ArticleController::class, 'show'])->name('blog.show');
});
use Shazzoo\ContentStudio\ContentStudio;
// In AppServiceProvider::boot()
ContentStudio::resolveLocaleUsing(fn () => request()->route('locale') ?? app()->getLocale());
ContentStudio::resolveUrlUsing(fn (Article $article) => route('blog.show', [
'locale' => $article->locale,
'slug' => $article->slug,
]));
ContentStudio::resolveIndexUrlUsing(fn (string $locale) => route('blog.index', ['locale' => $locale]));
bash
php artisan storage:link
json
"post-update-cmd": [
"@php artisan vendor:publish --tag=laravel-assets --ansi --force"
]
bash
php artisan vendor:publish --tag=content-studio-assets --force
bash
php artisan content-studio:clear # asks for confirmation
php artisan content-studio:clear --force # deletes straight away
php artisan content-studio:clear --images # also deletes the downloaded images
bash
php artisan vendor:publish --tag=content-studio-config
bash
php artisan vendor:publish --tag=content-studio-views
php artisan vendor:publish --tag=content-studio-lang