laravel-workflow-timesheet maintained by kingga
Description
The laravel interface for kingga/workflow, this includes models which will store this information in the database and then add it back into the structures.
Author
Last update
2019/07/30 03:18
(dev-master)
License
Downloads
7
Laravel Workflow Timesheet
This is a package for Laravel which extends the base library kingga/workflow-timesheet. This package can be used to store the parsed file into the database and then converted back into an object from the database.
Installation
- Run the command
composer require kingga/laravel-workflow-timesheet - Add the
Kingga\LaravelWorkflowTimesheet\WorkflowTimesheetServiceProviderservice provider to theconfig/app.phpfile. - Run the command
php artisan migrate
Usage
Storing
use Kingga\WorkflowTimesheet\Parser;
use Kingga\LaravelWorkflowTimesheet\WorkflowWeek;
$parser = new Parser;
$week = $parser->parse(storage_path('timesheets/Time-Sheet.csv'));
// NOTE: The user must be logged in as this is assigned per user.
WorkflowWeek::create($week);
Retrieving
use Kingga\LaravelWorkflowTimesheet\WorkflowWeek;
dd(WorkflowWeek::first()->toObject());