PHP code example of collective-thinking / laravel-seed
1. Go to this page and download the library: Download collective-thinking/laravel-seed 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/ */
collective-thinking / laravel-seed example snippets
class InsertPostCategories
{
public function up()
{
//
}
public function down()
{
//
}
}
use App\PostCategory;
class InsertPostCategories
{
public function up()
{
PostCategory::insert([
[
"id" => 1,
],
]);
}
public function down()
{
PostCategory::destroy([
1,
]);
}
}