PHP code example of golded-dev / laravel-ftn-database

1. Go to this page and download the library: Download golded-dev/laravel-ftn-database 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/ */

    

golded-dev / laravel-ftn-database example snippets


'load_migrations' => false,

return [
    'load_migrations' => true,

    'models' => [
        'area' => Golded\Ftn\Database\Models\Area::class,
        'message' => Golded\Ftn\Database\Models\Message::class,
    ],
];

'models' => [
    'area' => App\Models\Area::class,
    'message' => App\Models\Message::class,
],

use Golded\Ftn\Database\Models\Area;
use Golded\Ftn\Database\Models\Message;

$area = Area::create([
    'code' => 'TEST',
    'name' => 'Test Area',
    'source_type' => 'jam',
]);

Message::create([
    'area_id' => $area->id,
    'source_type' => 'jam',
    'source_uid' => 'jam:offset:256',
    'body_text' => 'Hello',
]);

namespace App\Models;

use Golded\Ftn\Database\Models\Message as BaseMessage;

class Message extends BaseMessage
{
    protected $fillable = [
        'area_id',
        'msgno',
        'source_type',
        'source_uid',
        'body_text',
        'is_read',
        'is_marked',
        'is_bookmarked',
        'thread_key',
    ];
}
bash
php artisan vendor:publish --tag=ftn-database-migrations
bash
php artisan vendor:publish --tag=ftn-database-config