In this recipe, we'll create a simple API to display some information from our database. To control who has access to the data, we allow users to create keys and use that key in their API request.
For this recipe, we need a standard installation of Laravel and a configured MySQL database.
To complete this recipe, we'll follow these given steps:
CREATE TABLE api ( id int(10) unsigned NOT NULL AUTO_INCREMENT, name varchar(255) DEFAULT NULL, api_key varchar(255) DEFAULT NULL, status tinyint(1) DEFAULT NULL, PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;