Getting Started with the Laravel Blog Starter Kit
Unlike most packages, this kit is not installed through Composer, instead you use the repository as a template to build your own blog. If you know your way around Laravel, you can follow the Quick Start Guide, otherwise you can skip to the full tutorial.
Quick Start#
Requirements#
The kit uses Laravel 9 which requires PHP >= 8.0.
Installation#
1git clone https://github.com/caendesilva/laravel-blogkit.git2cd laravel-blogkit3composer install4npm install && npm run dev
Configuration#
1cp .env.example .env && nano .env # Configure your database2php artisan migrate3php artisan key:generate4php artisan storage:link5 6php artisan admin:create # Create your admin user
Tutorial#
Prerequisites#
The kit uses Laravel 9 which requires PHP >= 8.0. This is a quick start guide that assumes you are familiar with the basics of Laravel and Git, and it will not go into detail on how to set up your development environment. It will also not cover deploying to production.
This guide was created using Windows Terminal (PowerShell) and VSCode on a Windows 10 workstation, but you should be able to follow along on macOS and Linux as well.
The guide uses the v1.0.0 release.
Cloning the repository#
Start by navigating to a folder, such as your Documents folder, and clone the repository.
1# Clone from the release branch (recommended)2git clone -b release https://github.com/caendesilva/laravel-blogkit.git blog-guide3 4# Or the master5git clone https://github.com/caendesilva/laravel-blogkit.git
Now we can start the setup
1# Enter the directory2cd blog-guide3 4# Install composer dependencies5composer install6 7# Install node modules and compile assets8npm install9npm run dev
Now is a good time to configure your environment and database. I recommend using MySQL, but that is just a personal preference. If you are on Windows, you can use XAMPP to set it up.
1# You can base your .env file on the provided example using:2cp .env.example .env
Once you have configured your database it's time to run the migrations.
1# You can base your .env file on the provided example using:2php artisan migrate3 4# You also need to generate your app key using:5php artisan key:generate6 7# And link your storage folder using:8php artisan storage:link
Next, we want to create our Admin user with the built-in artisan command which guides you through the process
1# Run the command and follow the on-screen instructions2php artisan admin:create
Now we are ready to serve!
1# Start the development server with2php artisan serve
Now you can visit http://localhost:8000/ in your browser.
You should now see a blank app page!
Creating your first post#
Your blog is not very fun at the moment. It needs content! Navigate to the login page at http://localhost:8000/login and enter the login details you created for the admin user.
Next, go to the "Create post" page at http://localhost:8000/posts/create and start writing your post!
Hit save, and marvel at your beautiful blog post!
What's next?#
While this app is fully functional and has a lot of customizable features it (in my humble opinion) shines as a starting point for your blog. Since this is just a template, you don't need to worry about keeping compatibility with future releases. The code is yours. Modify away! And please send me a link to what you make, I'd love to see it!
You should also take a look at the blog config file in config/blog.php as it has a ton of settings you can use to customize things fast. You can also check out the dedicated blog post I made about the configuration and customization possibilities.
Conclusion#
That's all for this post! I hope you learned something. Please let me know your thoughts in the comments, and Tweet your creations to me at @caendesilva!