Create a folder named RedBeanPHP4 in vendor directory and extract download zip file above and copy the rb.php into slim/vendor/RedBeanPHP4 – see Screenshot #2.
Include the rb.php in slim/vendor/autoloader.php
Then, add MySQL connection settings.
Let’s start it!
Create a index.php in slim directory and add the following:
Basically what’s in this index.php is to add new user and view a user details.
You may need to create new database, then new table named users. I used the following fields – id, name, email, created and modified
Next, when the database and tables created, you may run http://localhost/slim/users/add/Nasrul Hazimfirstname.lastname@example.org and you may want to add more records. Suppose each time new user created, you will be redirected to the view user info page – http://localhost/slim/users/view/1 and see the next screenshot – I only var_dump the user details and you want to add some nice view or probably pass a JSON encoding.