Internal and Public web service provider of the Department of Computer Engineering
For contributor onboarding and coding standards, see the Repository Guidelines.
You need to install WAMP or XAMP server and run it before following commands. Please make sure you already created a Database and a Database User Account.
// Install PHP dependencies
composer install
// Install Node dependencies (development mode, can use `npm` as well, but recommended to use `pnpm` here)
pnpm install
pnpm run dev// If you received mmap() error, use this command
php -d memory_limit=-1 /usr/local/bin/composer install
// Update PHP dependencies
composer update
// Prepare the database
php artisan migrateNews, Events, and Articles now track attribution via author_id (added in the 2026-02-07 migration). Run php artisan migrate after pulling the latest changes.
First you need to copy .env.example and save as .env in the root folder, and change the Admin and User credentials, Database configurations.
Next follow the below commands
// Prepare the public link for storage
php artisan storage:link
// Reset the database and seed the data
php artisan migrate:fresh --seed
// Prepare webhook for unit testing
git config --local core.hooksPath .githooks
// Serve PHP web server
php artisan serve
// Serve PHP web server, in a specific IP & port
php artisan serve --host=0.0.0.0 --port=8000
// To work with Vue components, you need to run this in parallel (can use `npm` as well, but recommended to use `pnpm` here)
pnpm run watch- Define tenants in
config/tenants.phpwithslug,name,url,description. - The
defaulttenant slug controls the content returned by v1 APIs.
Use the portal:backup command to export the MySQL database, zip assets, and upload artifacts to Google Drive with a Service Account.
php artisan portal:backupConfiguration is documented in docs/features/backups.md and config/google-services.php.
- Seed tenants from config with:
php artisan db:seed --class=Database\\Seeders\\TenantSeeder- News:
GET /api/news/v2/{tenant_slug} - Articles:
GET /api/articles/v2/{tenant_slug} - Events:
GET /api/events/v2/{tenant_slug} - For unknown tenant slugs, v2 returns
404 Tenant not found.
// Remove dev dependencies
composer install --optimize-autoloader --no-dev
php artisan config:cache
php artisan route:cache
php artisan view:cache
php artisan optimize:clear
php artisan config:clear
php artisan route:clear
php artisan view:clearphp artisan down --message="{Message}" --retry=60
php artisan up// Create Model, Controller and Database Seeder
php artisan make:model {name} --migration --controller --seed
// Create a Email
php artisan make:mail -m
// Commandline interface for Database Operations
php artisan tinker
// Run the unit tests
php artisan test
// Populate the DB with a specific Seeder class
php artisan db:seed --class=<path-to-the-seeder-class>
// Ex: php artisan db:seed --class=Database\\Seeders\\Roles\\AcademicRoleSeederCan be found under ./scripts. folder. In the production environment, scripts need to be run with sudo from the base directory to work correctly.
Ex:
sudo sh ./scripts/deploy-prod.sh| Verb | URI | Action | Route Name |
|---|---|---|---|
| GET | /photos/ | index | photos.index |
| GET | /photos/create | create | photos.create |
| GET | /photos/view/{photo} | show | photos.show |
| GET | /photos/edit/{photo} | edit | photos.edit |
| GET | /photos/delete/{photo} | delete | photos.delete |
| POST | /photos/ | store | photos.store |
| PUT | /photos/{photo} | update | photos.update |
| DELETE | /photos/{photo} | destroy | photos.destroy |
Thanks to all the contributors who have helped with this project!
https://portal.ce.pdn.ac.lk/contributors