PHP code example of andreaselia / laravel-firefly

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

    

andreaselia / laravel-firefly example snippets




namespace App\Models;

use Firefly\Traits\FireflyUser;
use Illuminate\Notifications\Notifiable;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;

class User extends Authenticatable
{
    use HasFactory, Notifiable, FireflyUser;
}

'features' => [
    'watchers' => true,
    // ...
],

'features' => [
    // ...
    'wysiwyg' => [
        'enabled' => true,
        'theme' => 'snow', // More about themes at https://quilljs.com/docs/themes/
        'toolbar_options' => [ // Docs at https://quilljs.com/docs/modules/toolbar/
            ['bold', 'italic', 'underline', 'strike'],
            [['list' => 'ordered'], ['list'=> 'bullet']],
            ['clean'],
        ],
    ],
    // ...
],

'features' => [
    'correct_posts' => true,
    // ...
],

'features' => [
    'reactions' => [
        'enabled' => true,
        'convert' => true
     ]
    // ...
],



namespace App\Policies;

use Illuminate\Auth\Access\HandlesAuthorization;
use Firefly\Policies\GroupPolicy;

class MyGroupPolicy extends GroupPolicy
{
    // ...



use Firefly\Models\Group;

// ...

protected $policies = [
    Group::class => 'App\Policies\MyGroupPolicy',
];
bash
php artisan vendor:publish --provider="Firefly\FireflyServiceProvider"
bash
php artisan migrate