True-Compliance Test
- Add more tests to Properties
- Add more tests to Notes
- Add more tests to Certificates
- On Form validations use prepare for validation method to convert to correct dates formats
- Handle errors in case models are not found and throw more descriptive exception
git clone https://github.com/aleronal/true-compliance.git
cd true-compliance
# create .env file and generate the application key
cp .env.example .env
php artisan key:generate
composer install
php artisan migrate
php artisan db:seed --class=SqlFileSeeder
Then launch the server:
php artisan serve
The Laravel project is now up and running! Access it at http://localhost:8000.
To run tests, run the following command
php artisan test
SELECT * FROM properties
WHERE (SELECT COUNT(*) FROM certificates WHERE certificates.property_id = properties.id) > 5;
#Eloquent
$properties = Property::withCount('certificates')
->having('certificates_count', '>', 5)
->get();