Giter Site home page Giter Site logo

code-challenge's Introduction

Coding Challenge

This site is a completion of a coding challenge.

Of note, the site displays a list of employees, their boss' name, and the distance from the CEO.

In addition to the main challenge:

  • The site uses DataTables to display the results
  • Lets users page through the results
  • Lets users sort the columns

Files of Note

  • app/Http/Controllers/ChallengeController.php
    • This file holds the bulk of the application. Within this file are two functions:
      • index() which gathers the employees to render, loops through them and determines the distance from the CEO by calling:
      • getDistance() traverses an associative array connecting employee to boss until the CEO is reached and returning the number of levels travelled.
  • app/Employee.php
    • This file extends the Laravel Eloquent class and wraps up the sql statement to get the employees in a simple, fluent format.
  • public/js/app.js
    • Created the DataTable table. The array of employees created in the ChallengeController is passed into javascript with a special Laravel class where this file passed uses it in the DataTable options array. I'm doing it this way as a blank screen on initial load is perferable to a screen that jumps about when the table renders.
  • resouces/views/index.blade.php
    • This is the html file that is rendered when accessing the page

code-challenge's People

Contributors

ethanf22 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.