PHPackages                             acacha/tasks - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. acacha/tasks

ActiveProject

acacha/tasks
============

The Laravel Framework.

00PHP

Since Feb 13Pushed 7y ago3 watchersCompare

[ Source](https://github.com/acacha/Tasks)[ Packagist](https://packagist.org/packages/acacha/tasks)[ RSS](/packages/acacha-tasks/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

CORS
====

[](#cors)

localhost/:1 Failed to load : No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '' is therefore not allowed access.

Resources:

-

Laravel
=======

[](#laravel)

Testing
-------

[](#testing)

### HTTP

[](#http)

-
-

Relacions
---------

[](#relacions)

Una bona forma aprendre com funciones es via TDD i Wishfull programming

Recursos:

-

Eloquent
========

[](#eloquent)

CRUD (CREATE RETRIVE UPDATE DELETE)

'''Recursos'''

-

LIST
----

[](#list)

Mètodes:

- Task::all() -&gt; Resultat una col·lecció
- Task::where('completed', true)-&gt;orderBy('name', 'desc')-&gt;take(10)-&gt;get();
- Fresh: $freshFlight = $flight-&gt;fresh();

Recursos

-

Collections
-----------

[](#collections)

Laravel collections:

SHOW
----

[](#show)

```
$flight = App\Flight::find(1);
$flights = App\Flight::find([1, 2, 3]);
$flight = App\Flight::where('active', 1)->first();
$model = App\Flight::findOrFail(1);

```

Create
------

[](#create)

INSERTS:

```
$flight = new Flight;

        $flight->name = $request->name;

        $flight->save();

```

### Mass assignement

[](#mass-assignement)

OCO: Camp fillable:

```
protected $fillable = ['name'];

```

```
$flight = App\Flight::create(['name' => 'Flight 10']);

```

Update
------

[](#update)

```
$flight = App\Flight::find(1);

$flight->name = 'New Flight Name';

$flight->save();

```

Delete
------

[](#delete)

```
$flight = App\Flight::find(1);

$flight->delete();

```

API CRUD (JSON) vs HTML CRUD
----------------------------

[](#api-crud-json-vs-html-crud)

CRITERI: Mirar de no xocar amb el controlador ja existen NO API -&gt; Espai de noms Api (carpeta)

```
app/Http/Controlloers/Api

```

ApiResources controller:

```
 Route::apiResource('photos', 'API\PhotoController');

```

```
php artisan make:controller API/PhotoController --api

```

NO CALEN ELS METODES create i edit (no hi ha formularis PHP/HTML)

RUTES CRUD
----------

[](#rutes-crud)

- CRUD (Cru en anglès)
- BREAD (Pà en anglès):
- BROWSE READ EDIT ADD DELETE

Vídeo recomanat:

RUTES:

- GET /projects (index)
- GET /projects/create (create) -&gt; Formulari creació
- GET /projects/1 (show)
- POST /projects (store)
- GET /projects1/edit (edit)
- PATCH /projects/1 (update)
- DELETE /projects/1 (destroy)

Ajudes de Laravel ():

```
 Route:resource('/projects')

```

o

```
Route::resources([
    'photos' => 'PhotoController',
    'posts' => 'PostController'
]);

```

Controladors:

-

Quan les coses siguin més complicades/més reals (no sempre farem només CRUD) seguirem els criteris de Cruddy By Design:

- Exemple més complicat: canviar l'estat d'una tasca de completa a no completa o viceversa

Tècniques:

- Give nested resources a dedicated controller
- Treat properties edited independently as separate resources
- Treat pivot models as their own resource
- Think of different states as different resources

Recursos:

-
- Github:

Route Model Binding
-------------------

[](#route-model-binding)

Verb URI Action Route Name GET /photos index photos.index GET /photos/create create photos.create POST /photos store photos.store GET /photos/{photo} show photos.show GET /photos/{photo}/edit edit photos.edit PUT/PATCH /photos/{photo} update photos.update DELETE /photos/{photo} destroy photos.destroy

Vue
===

[](#vue)

vue-tasks
---------

[](#vue-tasks)

Guia de treball
---------------

[](#guia-de-treball)

-
- Patro MVVM: [https://www.packtpub.com/mapt/book/web\_development/9781786469946/2/ch02lvl1sec18/mvvm-architectural-pattern](https://www.packtpub.com/mapt/book/web_development/9781786469946/2/ch02lvl1sec18/mvvm-architectural-pattern)
- Basic data binding:
- V-MODEL: How it works, equivalent to: v-model="varName" is equivalent to :value="varName" @input="e =&gt; varName = e.target.value".

does the same thing as:

&lt;input v-bind:value="searchText" v-on:input="searchText = $event.target.value"

>

-
- Lazy (mètode onchange en comptes de output):
- Customize:
    -
- Customizing:

Vue.component('base-checkbox', { model: { prop: 'checked', event: 'change' }, props: { checked: Boolean }, template: ``})

VUE DEV-TOOLS
=============

[](#vue-dev-tools)

Lists
=====

[](#lists)

-
- Directiva v-for
- Sistema plantilla Vue moustaches
- Operacions amb arrays: -- push/pop/shift/unshift/splice/sort/reverse -- Funció filter/ foreach i altres operadors amb arrays

V-IF i V-SHOW
-------------

[](#v-if-i-v-show)

Mostrar tasques completades i no completades

RANGES:

 {{ n }}

CRUD
====

[](#crud)

-

EDIT MODE
---------

[](#edit-mode)

Laracast video test utils:

Computed Properties
===================

[](#computed-properties)

- IMPORTANT: sempre són calculs realitzats a partir de dades de vue (data). No fer sobre elements no monitoritzats per vue o constants
- A vegades es pot fer el que es fa amb un computed amb un mètode
- Exemple filtre de tasques: filteredTasks -&gt; tasques completes o tsques incompletes
-

COMPONENTS PROPS
================

[](#components-props)

Comunicació amb components/API/CONTRACTE

Comunicació pares fills:

-
- Patrons més complicats de comunicació: Bus i Store (Vuex)
- Props validation
- Vue hooks: created/mounted

VUE EVENTS
==========

[](#vue-events)

- dos tipus events: predefinits (click, dblclick, change, input) i a mida (custom)
-
- CUSTOM EVENTS a components:

SLOTS
=====

[](#slots)

TODO

Axios
=====

[](#axios)

- Comunicació amb la API
- Javascript Promises
- Programació asíncrona i Javascript

\--&gt;

tasks\_javascript
=================

[](#tasks_javascript)

- Carpeta: tasks:javascript
- tailwind CSS

Troubleshooting. Resol·lució de problemes
=========================================

[](#troubleshooting-resollució-de-problemes)

CORS. Failed to load URL: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin ... is therefore not allowed access.
---------------------------------------------------------------------------------------------------------------------------------------------------

[](#cors-failed-to-load-url-no-access-control-allow-origin-header-is-present-on-the-requested-resource-origin--is-therefore-not-allowed-access)

IMPORTANT: CORS no caldrà quan l'aplicació client/frontend i la backend/server siguin al mateix domini

Cal instal·lar la llibreria de Laravel:

```
$ composer require barryvdh/laravel-cors

```

I afegir Middleware:

```
protected $middleware = [
    // ...
    \Barryvdh\Cors\HandleCors::class,
];

```

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/c2d6b3764878ff9fcb0b42e2f6e3a6680b8ea9f7ea4f73028559df7d60f1be78?d=identicon)[acacha](/maintainers/acacha)

---

Top Contributors

[![acacha](https://avatars.githubusercontent.com/u/4015406?v=4)](https://github.com/acacha "acacha (278 commits)")

### Embed Badge

![Health badge](/badges/acacha-tasks/health.svg)

```
[![Health](https://phpackages.com/badges/acacha-tasks/health.svg)](https://phpackages.com/packages/acacha-tasks)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
