PHP code example of ssh521 / simple-posts
1. Go to this page and download the library: Download ssh521/simple-posts 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/ */
ssh521 / simple-posts example snippets
use Ssh521\SimplePosts\Http\Controllers\SimplePostController;
Route::prefix('posts')
->name('posts.')
->group(function () {
Route::get('/', [SimplePostController::class, 'index'])->name('index');
Route::get('/create', [SimplePostController::class, 'create'])->name('create');
Route::post('/', [SimplePostController::class, 'store'])->name('store');
Route::get('/{post}', [SimplePostController::class, 'show'])->name('show');
Route::get('/{post}/edit', [SimplePostController::class, 'edit'])->name('edit');
Route::put('/{post}', [SimplePostController::class, 'update'])->name('update');
Route::delete('/{post}', [SimplePostController::class, 'destroy'])->name('destroy');
});
bash
php artisan migrate
bash
php artisan vendor:publish --tag=simple-posts-routes
bash
php artisan vendor:publish --tag=simple-posts-config
bash
php artisan vendor:publish --tag=simple-posts-views
bash
php artisan vendor:publish --tag=simple-posts-migrations
bash
php artisan vendor:publish --tag=simple-posts-routes
Simple-Posts/
├── config/simple-posts.php # 설정 파일
├── database/migrations/ # 데이터베이스 마이그레이션
├── resources/views/posts/ # Blade 템플릿
├── src/
│ ├── Http/
│ │ ├── Controllers/SimplePostController.php
│ │ ├── Models/Post.php
│ │ ├── Requests/SimplePostRequest.php
│ │ └── routes/web.php
│ └── SimplePostsServiceProvider.php
└── composer.json