PHP code example of timedoor / blog

1. Go to this page and download the library: Download timedoor/blog 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/ */

    

timedoor / blog example snippets


$ php artisan blog:install
$ php artisan vendor:publish --tag=blog
$ php artisan storage:link

// app/config/filesystems.php

'disks' => [
	...
	'public_upload' => [
		'driver' => 'local',
		'root' => public_path() . '/upload',
		'url' => '/upload'
	]
]

// composer.json
"autoload-dev": {
	...
	"files": [
		"app/Helpers/blog.php"
	]
},

$ php artisan migrate
$ php artisan db:seed --class=MultilanguageSettingTableSeeder

// app/Providers/AppServiceProvider.php

use Illuminate\Support\Facades\Config;

public function boot()
{
	...
	$multilanguages  =  getMultilanguageSetting();
	
	Config::set('translatable.locales', $multilanguages->pluck('locale')->toArray());
	Config::set('laravellocalization.supportedLocales', $multilanguages->pluck('detail', 'locale')->toArray());
}

Route::prefix('api/v1')
	->middleware(['api', 'localize.api'])
	->namespace($this->namespace)
	->group(base_path('routes/blog-api.php'));

Route::prefix('admin-blog')
	->name('admin-blog.')
	->middleware('web')
	->namespace($this->namespace)
	->group(base_path('routes/blog-admin.php'));