I'm Jérémy, a french software engineer, enthusiastic developer & eternal learner.
- Twitter: @jdecool
- Mastodon: @[email protected]
- Bluesky: jdecool.bsky.social
- LinkedIn: /jdecool
- My personal website: FR or EN
PHP client for Clockify.me API https://clockify.me/developers-api
License: MIT License
I'm Jérémy, a french software engineer, enthusiastic developer & eternal learner.
The composer.json file lists
php-http/client-implementation which does not seem to be used and does not exist.
I am trying to build a Laravel App that communicates with Clockify. I figured out looking at the documentation how the get works and I've been able to see all the workspaces, projects and tasks already created but I am struggling trying to create a task for a project from my Laravel App.
This is the store method
public function store() {
$builder = new ClientBuilder();
$client = $builder->createClientV1(config('clockify.clockify_api_key'));
$request = new Task\TaskRequest('',\request('name'),'','','');
$task = new Task\Task($builder->createClientV1(config('clockify.clockify_api_key')));
$task->create(\request('workspace'),\request('project'),$request);
dd($task);
}
This is the form
<form action="{{route('tasks.store',['workspace'=>request('workspace'),'project'=>request('project')])}}" method="POST">
<div class="form-group">
<input class="form-control" type="text" name="name" placeholder="Task Name">
</div>
<div class="form-group">
<button class="btn btn-primary" type="submit">Create</button>
</div>
</form>
$user = $apiFactory->userApi();
$timesApi = $apiFactory->timeEntryApi();
$search = [
'project-required' => false,
'task-required' => false,
];
$timeItems = $timesApi->find($_ENV['C_SPACE_ID'], $user->current()->id(), $search);
Crete next url:
/time-entriesproject-required=0&task-required=0
If I don't use projects, tags or tasks in Clockify, the TimeEntryDto is not working, it gives must the following error :
JDecool\Clockify\Model\TimeEntryDtoImpl::__construct(): Argument #6 ($tagIds) must be of type array, null given
In order to make it works, I've done the following changes :
public function __construct(
bool $billable,
string $description,
string $id,
bool $isLocked,
$projectId,
$tagIds=[],
$taskId,
TimeIntervalDto $timeInterval,
string $userId,
string $workspaceId
) {
...
}
was trying to do a PR draft but can't find the option?
anyways, would you be willing to bump your php-http/client-common to ^2.0. i'd love to use your package for my Alfred-Time Workflow, but there's a conflict related to the php-http/client-common version. i use the latest one while you use an old one.
if you're ok with bumping up your dependency, then i'll do a PR.
thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.