Git Product home page Git Product logo

laravel-tasks's Introduction

Laravel daily Tasks

A non-trivial task app written in laravel 8

Features:

  • Users get banned for 2 minutes if they tamper with task ids in url. (implemented by laravel-temp-tag and laravel-heyman package)
  • Banned users are allowed to see the task list but can not manage them.
  • No user can have to than 10 daily tasks.
  • It logs any validation errors, banning or tampering with url parameters for admin to review.
  • Only one task can be at doing state
  • Task lists get cached
  • The time of the day at which the task state has changed is shown on the list.

This is a sample usage of my laravel-temp-tag package. When you mark a daily-task as done, failed, skipped, etc and they will be automatically rollback to the default (not started) state at the end of the day. (without using any cron job)

Super easy setup, can be done in 5 minutes or less.

Quick Project Setup

  1. Run sudo git clone https://github.com/imanghafoori1/laravel-tasks.git laravel-tasks
  2. From the projects root run cp .env.example .env
  3. Configure your .env (optional since an sqlite database is provided)
  4. Run sudo composer update from the projects root folder
  5. From the projects root folder run php artisan task:install to migrate, seed and generate key

You can login with:

email: [email protected]     pass: secret
email: [email protected]    pass: secret

Laravel-Tasks URL's (routes)

  • /home
  • /tasks
  • /tasks/create
  • /tasks/{id}/edit

image

Long Story Short:

We Tag the tasks as 'complete' until the end of the day:

$expireAt = Carbon::now()->endOfDay();   // 23:59:59 of today
tempTags($task)->tagIt('state', $expireAt, ['value' => 'done']);

We remove the tag from the task when the user marks it as in-complete:

tempTags($task)->unTag('state');

We fetch the 'complete' and 'incomplete' tasks like this:

Task::hasActiveTempTags('state', ['value' => 'done'])->get();           // tasks with "complete" tag.
Task::hasNotActiveTempTags('state', ['value' => 'not_started'])->get(); // tasks with no tag are incomplete ones.

And that is all ! Super simple


Laravel Temp Tag:

https://github.com/imanghafoori1/laravel-temp-tag

laravel-tasks's People

Contributors

imanghafoori1 avatar

Stargazers

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