Getting started using the Laravel Starter
prismic.io makes it easy to get started on a new Laravel project by providing a specific Laravel Starter project. First you need to define, edit, and publish your content in a prismic.io content repository. Then you can query and fetch content from your API. Finally, integrate the content into your website templates.
This page walks you through getting up and running using the Laravel Starter project.
Create a content repository
A content repository is where you can define, edit, and publish your website content.
Download the Laravel Starter
The Laravel Starter project allows you to query and retrieve content from your prismic.io content repository and integrate it into your website template. It's the easiest way to get started with a new Laravel project.
If you are not starting a brand new project, then check out our Integrating with an existing project page. Otherwise, use the link below to download the Laravel Starter.
Unzip the downloaded project files into the desired location for your new project.
Configure your project
Replace the repository URL in your prismic.io configuration file (located at config/prismic.php) with your repository’s API endpoint:
// In config/prismic.php 'url' => 'https://your-repo-name.prismic.io/api/v2',
Fire up a terminal (command prompt or similar on Windows), point it to your project location and run the following commands!
First you’ll need to install the dependencies for the project. Run the following command:
Next you need to make a copy of the .env.example file and rename it to .env inside your Laravel project root:
cp .env.example .env
Then run the following command to generate your app key:
php artisan key:generate
Now you can launch your local server:
php artisan serve
You can now open your browser to http://localhost:8000, where you will find a tutorial page. This page contains information helpful to getting started. You will learn how to query the API and start building pages for your new site.
And your prismic.io journey begins!
Now you're all set to start building your new website with the prismic.io content management system. Here are the next steps you need to take.
Define your Custom Types
First you will need to model your pages, blog posts, articles, etc. into different Custom Types. Refer to our documentation to learn more about constructing your Custom Types using our easy drag and drop builder.
Query your documents
After you have created and published some documents in your content repository, you will be able to query your API and retrieve the content. We provide explanations and plenty of examples of queries in the documentation. Start by learning more on the How to Query the API page.
Integrate content into your templates
The final step will be to integrate your content into the website templates. Check out the templating documentation to learn how to integrate each content field type.