HomeFeatured[PT 1] Creating a mini LMS (learning management system) in Laravel

[PT 1] Creating a mini LMS (learning management system) in Laravel

laravel

[PT 1] Creating a mini LMS (learning management system) in Laravel

Welcome back dudes, its time for another show again, you know i have always been a fan of raw PHP without frameworks, but when i tested the working power of laravel, i was really swept off my feet (sorry if my grammar is a little bit bad), Ok now back to what we need to discuss here, actually this was meant to be a long post, but for the purpose of simplicity, i’ll be shortening the tutorial.

SELECTED JUST FOR YOU
Choosing a content management system

A Learning management system is actually a website where one can register and Login and also have the time to access the courses taught on the website, and after which he or she logs off, and comes back again anytime the spirit leads. Now in this our learning management system, we are just going to keep it so simple by creating just simple files, actually this tutorial is an insight into how laravel works.

SELECTED JUST FOR YOU
PHP Request methods

Am not going to write the tests function for this codes, neither am i going to develop a full LMS here, am developing something very simple, now i think i have ranted enough, let’s get to work.

 

Installing Laravel and its Dependencies

Post Contents

SELECTED JUST FOR YOU
Why You Should Only Focus on Positive Instagram Comments & Not the Negative

Now if you are actually here for learning how to build an LMS , i supposed you should already have Laravel installed in your computer system, if not (although am not here to teach that, sorry buddy) just get to download composer and download composer, now i choose composer because its pretty easy to download laravel this way (or should i say its because that’s how i downloaded mine).

SELECTED JUST FOR YOU
How to use file Zilla

Now once you have composer on your system, navigate to the directory which you want your laravel project to be and on your command prompt use the codes below.

 

c:\users\metro\desktop> composer prefer --dist laravel/laravel {name_of_your_app}

Now once you’re done, laravel should be imstalled, and you’ll see the folder/directory where you’ll be creating your laravel application, now we’re set to go, but remember, we need users to register and Login and perform some basic user functions.

SELECTED JUST FOR YOU
Facebook like emoji rating using Jquery

 

User Registration and Login in Laravel

Now we have Laravel set up, and we need our users to register and Login, and also request for password recovery if the user forgets the password, now in laravel to create these function it uses a command which would create the User model file, and also several other files inside the  HTTP >  CONTROLLERS > AUTH folder as specified in the image below.

so on your command prompt use the command:

php artisan make:auth

This should create the needed files for your user registration , login etc. functions, now what next ? you can navigate to your local website  by using the command on your command prompt:

php artisan serve
This should display a message which should be 
laravel development server started : <http://127.0.0.1:8000>

Now remember we created the authentication files using our PHP auth command, laravel automatically creates an auth folder and Model that renders all the neede pages for basic user registration and login (sorry for that long sentence, what i mean is that all those files are created automatically). Now to see all those files for login and registration, navigate to the following urls (uniform resource locator).

127.0.0.1:8000/login
127.0.0.1:8000/register

This should render the pages for you to see the wonders of laravel.

SELECTED JUST FOR YOU
WordPress 4.8 Update: An Update with You in Mind

[Migrations] Creating Database and Tables in Laravel

So you almost wanted to register without a database when you checked the login page, and you were visited with an error, wow am sorry for that, nevertheless let’s get to work, creating databases and tables in laravel simply means creating migrations.

Now what do we need, we need a database named miniLMS and three tables named courses table, and the courseuser table and the users table, actually the users table has been created for us when we first ran the auth command, so we are left with creating a database and two tables..

SELECTED JUST FOR YOU
PHP Request methods

In the next post, i would explain how to do that. cheers.

Samuel Jim

Am a Software developer with a 3 year professional experience in several technologies not limited to PHP PYTHON and JavaScript, furthermore when am not coding or writing tech articles, you'll find me watching movies.

View all posts

Add comment

Your email address will not be published. Required fields are marked *