5-Minute Setup

Setup Guide

From a ZIP file to a fully running news portal with 30 articles, 17 users, and 80 tags — in under 5 minutes. Choose your operating system below.

Windows Setup

1

Install a Local PHP Environment

You need PHP 8.2, MySQL 8, and Composer. The easiest way is Laragon — one installer, everything included.

🦅
Laragon

PHP 8.2 + MySQL + Composer in one click

Recommended
🦈
XAMPP

Classic choice, use PHP 8.2 version

Popular
🎩
Laravel Herd

Official Laravel local environment

Laravel Official

After installing Laragon, click Start All from the Laragon tray icon before proceeding.

2

Place the Project Files

Unzip the downloaded newsportal.zip and place the newsportal folder into your web root:

EnvironmentWeb Root Path
LaragonC:\laragon\www\newsportal\
XAMPPC:\xampp\htdocs\newsportal\
WAMPC:\wamp64\www\newsportal\
3

Run the Setup Script

Open your environment's terminal (right-click the Laragon tray icon → Terminal), navigate to the project folder and run:

cd C:\laragon\www\newsportal
setup.bat

The script will prompt you for database credentials and do everything automatically:

  • Creates the news_portal database
  • Runs composer install
  • Generates the app key
  • Runs all migrations
  • Seeds 30 articles, 17 users, 80 tags
4

Start the Development Server

After setup, the script asks if you want to start the server. Press Y or run manually:

php artisan serve
   INFO  Server running on http://127.0.0.1:8000

With Laragon you can also access the site via http://newsportal.test without running artisan serve — Laragon creates virtual hosts automatically.

You're Live!

Default Login Credentials
Frontend URLhttp://localhost:8000
Admin Panelhttp://localhost:8000/admin
Emailadmin@example.com
Passwordpassword

Change the admin password immediately after first login in any non-local environment.

Linux / macOS Setup

1

Install PHP 8.2 and MySQL

Ubuntu / Debian:

# Add PHP 8.2 repository
sudo add-apt-repository ppa:ondrej/php -y
sudo apt update

# Install PHP and required extensions
sudo apt install php8.2 php8.2-cli php8.2-mysql php8.2-mbstring \
  php8.2-xml php8.2-gd php8.2-zip php8.2-bcmath php8.2-curl -y

# Install MySQL
sudo apt install mysql-server -y
sudo mysql_secure_installation

macOS (Homebrew):

# Install PHP and MySQL
brew install php mysql composer
brew services start mysql
2

Install Composer

curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
composer --version
3

Extract and Run Setup

# Extract the zip
unzip newsportal.zip -d /var/www/
cd /var/www/newsportal

# Run the one-command setup
chmod +x setup.sh
./setup.sh

Follow the prompts to enter your database credentials. The script handles the rest.

4

Start Server

php artisan serve --host=0.0.0.0 --port=8000

For a production server with Nginx, see Server Configuration in the docs.

Done!

Default Login Credentials
Frontend URLhttp://localhost:8000
Admin Panelhttp://localhost:8000/admin
Emailadmin@example.com
Passwordpassword

Shared Hosting / cPanel Setup

Your host must support PHP 8.2+ and MySQL 8.0+ and allow SSH access for Composer. Most modern cPanel hosts do. Check with your provider if unsure.

1

Set PHP Version to 8.2

In cPanel → MultiPHP Manager or PHP Selector, set PHP to 8.2 and ensure these extensions are enabled: pdo_mysql, mbstring, xml, gd, zip, bcmath, curl.

2

Create MySQL Database

In cPanel → MySQL Databases:

  1. Create a new database, e.g. mysite_newsportal
  2. Create a database user with a strong password
  3. Add the user to the database with All Privileges
3

Upload and Extract Files

Upload newsportal.zip via cPanel File Manager to your document root (public_html/ or a subdirectory), then extract it.

The Laravel public/ folder should be your web root. You may need to point your domain to newsportal/public/ in cPanel → Domains.

4

Configure .env via SSH

# SSH into your server, then:
cd /home/username/public_html/newsportal

cp .env.example .env
nano .env  # fill in DB credentials

Set DB_DATABASE, DB_USERNAME, DB_PASSWORD to your cPanel database details.

5

Run Composer and Artisan

composer install --no-dev --optimize-autoloader
php artisan key:generate
php artisan migrate --seed
php artisan config:cache
php artisan route:cache
6

Set Directory Permissions

chmod -R 755 storage bootstrap/cache public/uploads
chown -R www-data:www-data storage bootstrap/cache

Live!

Visit your domain. Admin at yourdomain.com/admin — login with admin@example.com / password. Change your password immediately.

Configure AI Features (Optional)

1

Get Your OpenAI API Key

Visit platform.openai.com/api-keys and create a new API key. The recommended model is gpt-4o-mini — it's fast and very cost-effective.

2

Enter Key in Admin Panel

Go to Admin → Settings → AI, paste your API key, select the model, then flip Enable AI Features ON.

Toggle each AI feature individually: Summary, Tags, SEO, Related Articles. You can enable only what you need.

3

Process Existing Articles

# Enrich all seeded articles with AI
php artisan news:process-ai

Processing 30 articles...
████████████████████ 30/30
✅  Done! 30 articles enriched.

Configure Email / SMTP (Optional)

Go to Admin → Settings → Email, toggle Use Custom SMTP ON, and enter your details. Here are quick configs for popular providers:

Gmail
Host:       smtp.gmail.com
Port:       587
Encryption: TLS
Username:   you@gmail.com
Password:   App Password (not your Gmail password)

Generate a Gmail App Password at: myaccount.google.com/apppasswords

Mailtrap (Testing)
Host:       sandbox.smtp.mailtrap.io
Port:       2525
Encryption: TLS
Username:   your mailtrap username
Password:   your mailtrap password
Mailgun
Host:       smtp.mailgun.org
Port:       587
Encryption: TLS
Username:   postmaster@yourdomain.com
Password:   your mailgun SMTP password

Useful Artisan Commands

# View full site statistics
php artisan news:stats

# Run AI on all unprocessed articles
php artisan news:process-ai

# Re-process a specific article by ID
php artisan news:reprocess-ai 5

# Send newsletter to all confirmed subscribers
php artisan news:send-newsletter "Weekly Digest"

# Preview newsletter without sending
php artisan news:send-newsletter "Weekly Digest" --preview

# Publish all scheduled articles
php artisan news:publish-scheduled

# Delete all spam comments
php artisan news:clear-spam

# Clear all caches (run after changing .env)
php artisan config:clear
php artisan cache:clear
php artisan view:clear

# Reset the database and reseed (dev only!)
php artisan migrate:fresh --seed

Common Problems

Syntax error, unexpected token "=" in Blade
Pagination looks broken / no styling
SQLSTATE: Access denied for user
Frontend has horizontal scrollbar
Logo uploaded but not showing on frontend
🎉

Your News Portal is Ready!

You have a fully-functioning AI-powered news portal. Now head to Admin and start creating your first real article.

Seeded User Accounts
RoleEmail
Adminadmin@example.com
Editorjames.editor@example.com
Authoralex.author@example.com
Readeremma@example.com
All passwords: password
Requirements Checklist
  • PHP 8.2+ with pdo_mysql, mbstring, gd, zip
  • Composer 2.x
  • MySQL 8.0+ (or MariaDB 10.4+)
  • OpenAI API Key (optional, for AI)
  • SMTP credentials (optional, for email)
Need Help?

Our support team is happy to help with setup and configuration issues.

Contact Support