PHP code example of flobbos / laravel-cm

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

    

flobbos / laravel-cm example snippets


Schema::table('newsletter_templates', function(Blueprint $table){
    $table->string('layout')->nullable();
});

use App\Http\Controllers\NewsletterTemplateController;

CMRoutes::load(NewsletterTemplateController::class);

Route::put('newsletter-template/generate-template/{id}', [NewsletterTemplateController::class, 'generateTemplate'])->name('newsletter-templates.generate-template');
Route::put('newsletter-template/update-template/{id}', [NewsletterTemplateController::class, 'updateTemplate'])->name('newsletter-templates.update-template');
Route::get('templates/{id}/send-preview', [NewsletterTemplateController::class, 'sendPreview'])->name('newsletter-templates.send-preview');
Route::resource('newsletter-templates', NewsletterTemplateController::class)

@

@

'client_api_key' => 'your secret key'

'client_id' => 'your client ID'

'default_list_id' => 'your default list ID'

'base_uri' => 'https://api.createsend.com/api/v3.2/'

'storage_path' => 'xls'

'sync_removal_threshold' => 0.2

'url_path'=>'laravel-cm'

'format' => 'json'

'confirmation_emails' => '[email protected],[email protected]',

'subscribe_success' => 'http://example.com/success'

'unsubscribe_success' => 'http://example.com/unsubscribe_success'

'from_email' => '[email protected]'

'reply_to' => '[email protected]'

'layout_file' => 'admin'

'layout_path' => 'laravel-cm/layouts'

'template_location' => 'storage' // storage|resource

'template_storage_path' => 'app/laravel-cm/templates'

'template_path' => 'laravel-cm/templates'

'max_test_emails' => 5

'test_email' => '[email protected]'

'test_subject' => 'Campaign Preview'

'api_token' => 'your-bearer-token',

//bootstrap or tailwind
'css_framework' => 'tailwind',

/resources
    /defaults
        /base
            base.blade.php
            base.scss

php artisan laravel-cm:controller NewsletterController --route=admin.newsletter-template --views=laravel-cm.templates

php artisan laravel-cm:views /view/path --route=laravel-cm.templates

php artisan laravel-cm:layout name-of-layout

$summary = $subscribers->syncImport($request);

$summary['removed'];      // how many subscribers were unsubscribed
$summary['candidates'];   // the email addresses that were unsubscribed
$summary['active_total']; // active subscribers on the list before the sync
$summary['imported'];     // the API response body from the import itself
bash
php artisan laravel-cm:install --deployment
bash
php artisan laravel-cm:install
bash
php artisan vendor:publish --tag=laravel-cm-config
bash
php artisan laravel-cm:controller NewsletterTemplateController --route=
bash
php artisan migrate
bash
php artisan laravel-cm:install --deployment