PHP code example of escolalms / courses

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

    

escolalms / courses example snippets


use Illuminate\Support\ServiceProvider;
use EscolaLms\Courses\Facades\Topic;


class CustomServiceProvider extends ServiceProvider
{

    //...

    public function register()
    {
        Topic::registerContentClass(TopicContentCustom::class);
        // or
        Topic::registerContentClasses([TopicContentCustom::class, TopicAnotherContentCustom::class]);

        // also register JSON Resource for a type
        Topic::registerResourceClasses(Audio::class, [
            'client' => ClientAudioResource::class,
            'admin' => AdminAudioResource::class,
            'export' => ExportAudioResource::class,
        ]);

    }
}

php artisan db:seed --class="\EscolaLms\Courses\Database\Seeders\CoursesSeeder"