- Minimum php7.4
- sqlite driver -
sudo apt install php7.4-sqlite
- Other regular requirements to run Laravel 8.x
To setup the project please follow the steps below
git clone https://github.com/mahmudkuet11/square1-blog.git
cp .env.example .env
cp .env.example .env.dusk.local
File: .env
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=square1_blog
DB_USERNAME=root
DB_PASSWORD=root
CACHE_DRIVER=redis
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
ADMIN_USER_PASSWORD="admin"
Cache driver should be
redis
and redis should have been installed on host machine
composer install --prefer-dist
php artisan key:generate
php artisan migrate
# To create the designated admin user
php artisan db:seed --class=InitialDataSeeder
# (Optional) If you want to seed some dummy data
php artisan db:seed
php artisan serve
Now visit http://localhost:8000 to view the application
To import blog posts from the another blogging platform add the following CRON entry. This will automatically import new posts every 15 minutes.
* * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1
Or just to test the functionality quickly you can run the following artisan command. The command will simulate the exact functionality
php artisan blog:import
Please make sure you have the sqlite
driver is installed on your machine. Because the testing process uses sqlite as in memory database
php artisan test
Chrome and chrome-driver should have been installed on your machine. To install the proper version of chrome-driver run the following command
php artisan dusk:chrome-driver --detect
chmod -R 0755 vendor/laravel/dusk/bin/
Make sure you have copied the .env.dusk.local
file mentioned in step 2. Also create another database and update the database related env variables to run the dusk tests.
File: .env.dusk.local
APP_URL=http://localhost:8000
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=square1_blog_test
DB_USERNAME=root
DB_PASSWORD=root
To run the tests
php artisan dusk
Here are the badges of Github Actions