Skip to content

Instantly share code, notes, and snippets.

View prodeveloper's full-sized avatar

Jacob Chencha prodeveloper

View GitHub Profile
@prodeveloper
prodeveloper / using_data_frontend.md
Created June 13, 2016 17:43
How to use the student data in the frontend

##Step 1:

Ensure we have some records on your Student class that you can use. Ensure mysql is running.

Run mysql-ctl cli. This starts the mysql database which normally closes if your Cloud 9 account if offline for a while.

##Step 2:

@prodeveloper
prodeveloper / using_forms.md
Created June 20, 2016 08:02
Shows how to use form to populate student data instead of adding it directly via tinker

In this exercise we are going to create a way to add students using a form.

##Step 1

Create a new file called new_student.blade.php in your views folder. That is where you will store your form.

Type in the html code on the form

@prodeveloper
prodeveloper / introduction_bootstrap.md
Last active July 12, 2016 08:37
An introduction to using bootstrap within the students project

Bootstrap is a easy to use frontend framework that enables you to quickly style your applications.

We will be using bootstrap in all our projects going forward.

##Step 1

Lets start by getting the CDN code from their site. http://getbootstrap.com/getting-started/.

Copy the CDN code

So far we have been able to successfully create and list all records. In this lesson we will be looking at how we can edit the records that we previously created.

##Step 1

As usual the first step is always to create and test the route.

Route::get('/students/{id}/edit',function($id){
     return "Editing the student with id " . $id;
});
@prodeveloper
prodeveloper / introducing_laravel_controllers.md
Created September 11, 2016 09:27
Introduction to using implicit controllers in laravel

In the past classes we have been doing all of our routes via the route.php file.

This tactic however does not scale well when you are building a production level application.

Controllers help you organize your routes into meaningful chunks. In addition to better organization, you can now work with the routes as a collective.

To illustrate we will move student routes to a controller called StudentController

##Step 1

@prodeveloper
prodeveloper / new_students.php
Created September 18, 2016 06:36
Creating new student records using faker
$student = new App\Student();$student->name = $faker->name ; $student->email = $faker->email ; $student->course=$faker->word; $student->save();
@prodeveloper
prodeveloper / laravel_pagination.md
Created September 18, 2016 06:54
Pagination using laravel

Once you have your app in production. Data is guaranteed to start flowing in. As such you can no longer show all the information from a particular table at once.

Laravel provides an out of the box solution for pagination.

##Step 1:

Ensure you have enough student records so that they can be paginated. That is have at least 20 records in your students database.

You can do this by adding records using your form.

@prodeveloper
prodeveloper / migrating_laravel.md
Last active October 30, 2016 16:08
Migrating laravel installation from 5.2 to 5.3

Laravel at the moment is at version 5.3. In class we have been using Laravel 5.2.

This is a major upgrade:

  1. Laravel 5.3 has a host of upgrades to its basic services
  2. Structure of its various constructs has changed
  3. It uses PHP 5.6 or 7 as opposed to

##Step 1

@prodeveloper
prodeveloper / api_integration.md
Last active October 25, 2016 07:01
Basics of working with APIs

##What is an API

In previous classes, we have been using forms and tables to input and display data respectively.

This works well for pure web applications. When we want to open up our application for integration, then we need an API (Application Programming Interface).

An API allows programmatic access to your application. This means that integrations such as:

  • Mobile application
@prodeveloper
prodeveloper / api_challenge.md
Last active October 30, 2016 16:37
Integration exercise for simple blog post

We have looked at how to create an API. In this challenge we shall be looking at how to consume one.

Based on the test data here

https://jsonplaceholder.typicode.com/posts

Create a system that displays this information in a table.

Notes: