PHP code example of alexstack / laravel-cms

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

    

alexstack / laravel-cms example snippets


// Make sure you already have laravel installed and configured the database in the .env
// Go to your laravel project folder and install it via composer
// Initialize the CMS (You can set up database table prefix and locale here)

composer 1 )


// Step 1: Install Laravel to folder cms
composer create-project laravel/laravel cms && cd cms && composer 

// Note: it will ask for database settings if you did not change the default .env file
// Note: it will automatically run a web server on port 9321 for your project

// Step 3: Now, you can access your cms backend via http://127.0.0.1:9321/cmsadmin/
// Default admin username: [email protected]  password: admin321


// Uninstall the CMS
php artisan laravelcms --action=uninstall


// Laravel 6.x & Laravel >= 7 & Laravel >= 8
composer make:auth && php artisan migrate

# Change homepage_route to /  in config/laravel-cms.php
'homepage_route'    => env('LARAVEL_CMS_HOMEPAGE_ROUTE', '/'),

# Remove the existing / route in the routes/web.php

// Route::get('/', function () {
//     return view('welcome');
// });

'page_route_prefix' => env('LARAVEL_CMS_PAGE_PREFIX', '/Article-'),

'admin_route'       => env('LARAVEL_CMS_BACKEND_ROUTE', '/admin2019'),

php artisan laravelcms --action=clear

@if ( isset($file_data->main_image) )
    <img src="{{$helper->imageUrl($file_data->main_image, '1000') }}" class="img-fluid" />

    <img src="{{$helper->imageUrl($file_data->main_image, '500') }}" class="img-fluid" />

    <img src="{{$helper->imageUrl($file_data->main_image, 'w', '150') }}" class="img-fluid" />

    <img src="{{$helper->imageUrl($file_data->main_image, '100', '100') }}" class="img-fluid" />

    <img src="{{$helper->imageUrl($file_data->main_image, 'original', 'original') }}" class="img-fluid" />

@endif


<link rel="stylesheet" href="{{ $helper->assetUrl('css/main.css') }}">
...
<script src="{{ $helper->assetUrl('js/bottom.js') }}"></script>

    'template' => [
        'frontend_dir'      => 'frontend',
        'backend_dir'       => 'backend',
        'backend_language'  => 'en',
        'frontend_language' => 'en',
    ]

    'slug_format'   => 'from_title',
    'slug_suffix'   => '.html',
    'slug_separate' => '-',

composer 

DB_CONNECTION=pgsql
DB_HOST=topsy.db.elephantsql.com
DB_PORT=5432
DB_DATABASE=oktetra
DB_USERNAME=oktetra
DB_PASSWORD=the-postgresql-password

    AWS_ACCESS_KEY_ID=
    AWS_SECRET_ACCESS_KEY=
    AWS_DEFAULT_REGION=
    AWS_BUCKET=
    FILESYSTEM_DRIVER=s3
    AWS_URL=
    

// Step 1: Install Laravel to folder cms
composer create-project laravel/laravel cmsjet && cd cmsjet && composer stall CMS in silent mode
composer ravelcms --action=clear

// Step 5: Now, you can access your cms backend via http://127.0.0.1:9321/cmsadmin/
// Default admin username: [email protected]  password: admin321


    web: vendor/bin/heroku-php-apache2 public/