Coder Social home page Coder Social logo

laravel-developer-assessment's Introduction

Assessment for Laravel Developer


This assessment is designed to test an examinee’s knowledge of PHP Design principles and its implementations on Laravel framework.

Assessment Point System: The assessment total is 60 points with additional 12 bonus points. Passing grade is 40. See breakdown below for more detail.

Points Bonus Total
60 12 72

Asessment Duration: Examinee is given 1 day to complete the assessment. On a separate spreadsheet, please log the time spent per functionality (start time and end time). For any questions regarding the exam please send inquiry to [email protected] or HR.

Output: Examinee is expected to send an email with attachment to their output files (preferably a zip file). Alternatively, examinee can attach a link to their GitHub Repository, Google Drive, Dropbox, or any other storage service to download the output if the file is too large to be attached on email, or for other reason.




Goals
  • Implement Laravel’s default login feature
  • Develop User CRUD functionalities

Prerequisites

Base the user migration file in the following table:

mysql> show columns from users;
+-------------------+-----------------+------+-----+---------+----------------+
| Field             | Type            | Null | Key | Default | Extra          |
+-------------------+-----------------+------+-----+---------+----------------+
| id                | bigint unsigned | NO   | PRI | NULL    | auto_increment |
| prefixname        | varchar(255)    | YES  |     | NULL    |                |
| firstname         | varchar(255)    | NO   |     | NULL    |                |
| middlename        | varchar(255)    | YES  |     | NULL    |                |
| lastname          | varchar(255)    | NO   |     | NULL    |                |
| suffixname        | varchar(255)    | YES  |     | NULL    |                |
| username          | varchar(255)    | NO   | UNI | NULL    |                |
| email             | varchar(255)    | NO   | UNI | NULL    |                |
| password          | text            | NO   |     | NULL    |                |
| photo             | text            | YES  |     | NULL    |                |
| type              | varchar(255)    | YES  | MUL | user    |                |
| remember_token    | varchar(100)    | YES  |     | NULL    |                |
| email_verified_at | timestamp       | YES  |     | NULL    |                |
| created_at        | timestamp       | YES  |     | NULL    |                |
| updated_at        | timestamp       | YES  |     | NULL    |                |
| deleted_at        | timestamp       | YES  |     | NULL    |                |
+-------------------+-----------------+------+-----+---------+----------------+

Instructions
  1. Start a project in Laravel 7 or higher
  2. Implement the default login feature using the laravel/ui package.
  3. Add a page to list all users (users.index) in a table.
  4. Add a page to display a single user (users.show).
  5. Add a page to display the form to create a new user (users.create).
  6. Add a page to edit a user (users.edit / users.update).
  7. Add a button to delete a user (users.destroy).
  8. Add a page to list all soft deleted users (users.trashed).
  9. Add a button to restore a soft deleted user (users.restore).
  10. Add a button to permanently delete a soft deleted user (users.delete).

✎ Notes
  • All users routes must implement the auth middleware.
  • The value for prefixname should only be one in [Mr, Mrs, Ms].
  • Use enctype=multipart/form-data attribute on the forms to enable uploading of user photo.

★ Bonus
  • +5 points - Write and register a route macro for soft deletes, which can be used as:

     Route::softDeletes('users', 'UserController');

    which contains the following route collection:

     Route::get('users/trashed', 'UserController@trashed')->name('users.trashed');
     Route::patch('users/{user}/restore', 'UserController@restore')->name('users.restore');
     Route::delete('users/{user}/delete', 'UserController@delete')->name('users.delete');
  • +2 points - Implement a model accessor called getAvatarAttribute which can be used as:

     $user = User::find(1);
     $user->avatar;
    which returns the photo or a default image
     /**
      * Retrieve the default photo from storage.
      * Supply a base64 png image if the `photo` column is null.
      *
      * @return string
      */
     public function getAvatarAttribute(): string
     {
     	// Code goes brrrr.
     }
  • +2 points - Implement a model accessor called getFullnameAttribute which can be used as:

     $user = User::find(1);
     $user->fullname; // E.g. Juan P. dela Cruz
    which returns the first, middle initial, and last name of the user
     /**
      * Retrieve the user's full name in the format:
      *  [firstname][ mi?][ lastname]
      * Where:
      *  [ mi?] is the optional middle initial.
      *
      * @return string
      */
     public function getFullnameAttribute(): string
     {
     	// Code goes brrrrr.
     }
  • +2 points - Implement a model accessor called getMiddleinitialAttribute which can be used as:

     $user = User::find(1);
     $user->middleinitial; // E.g. "delos Santos" -> "D."
  • +1 point - Style the pages using a preferred framework (e.g. bootstrap, vuetify, etc.).




🍀 Good luck!

laravel-developer-assessment's People

Contributors

duasosandy avatar moduor 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.