A Laravel 10 project with React.js frontend integrated inside the resources/js folder.
- PHP >= 8.2
- Composer
- Node.js & npm
- MySQL (or any preferred database)
- Webserver (XAMPP / Laragon / Laravel Sail / Docker, etc.)
git clone https://github.com/Afrid1719/CRM.git
cd CRMcomposer installcp .env.example .env
php artisan key:generatenpm install
npm run devphp artisan migrate(Optional) Seed the database with sample data for development:
php artisan db:seedThis command populates your database using the seeders in the database/seeders directory. You can customize or add your own seeders as needed for testing and development.
php artisan storage:linkThis command creates a symbolic link from public/storage to storage/app/public, allowing public access to user-uploaded files.
php artisan serveYou can now access the application at http://localhost:8000.
Below is an overview of the main folder structure:
CRM/
├── app/ # Contains the core application code
├── bootstrap/ # Contains the application bootstrap files
├── config/ # Configuration files for the application
├── database/ # Database migrations, factories, and seeders
├── public/ # Publicly accessible files (e.g., index.php, assets)
├── resources/ # Views, language files, and frontend assets
│ ├── js/ # React.js frontend code
│ ├── views/ # Blade templates
├── routes/ # Application route definitions
├── storage/ # Logs, cache, and compiled files
├── tests/ # Automated tests
├── vendor/ # Composer dependencies
├── .env.example # Example environment configuration file
├── artisan # Artisan CLI entry point
├── composer.json # Composer dependencies configuration
├── composer.lock # Composer dependencies lock file
├── jsconfig.json # JavaScript configuration for ESLint and Prettier
├── package-lock.json # npm dependencies lock file
├── package.json # Node.js dependencies configuration
├── phpunit.xml # PHPUnit configuration for testing
├── postcss.config.js # PostCSS configuration for CSS processing
├── README.md # Project documentation
├── tailwind.config.js # Tailwind CSS configuration
└── vite.config.js # Vite configuration for asset bundling
This project includes a scheduled job to automatically delete unused files from storage. The job is defined as a Laravel command and registered in the app/Console/Kernel.php file using Laravel's scheduler.
How it works:
- The job scans for files marked as soft deleted.
- It runs at a specified interval (e.g., daily) as configured in the scheduler.
- You can customize the logic and schedule as needed.
To enable job scheduling:
- Ensure your server's cron is set up to run Laravel's scheduler:
* * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1
- Edit the job logic in
app/Console/Commands/DeleteUnusedFiles.phpas required. - In your development environment, you can run the scheduler manually with:
This will keep the scheduler running and execute scheduled tasks in real time.
php artisan schedule:work
For more details, refer to the Laravel Task Scheduling documentation.