Closed stotes closed 5 years ago
in your AppServiceProvider.php
use App\Http\Requests\ValidatePersonStore as LocalPersonStore;
use LaravelEnso\Companies\app\Http\Requests\ValidatePersonStore;
public function boot()
{
$this->bind(ValidatePersonStore::class, function() {
return new LocalPersonStore;
});
}
local ValidatePersonStore.php
use LaravelEnso\Companies\app\Http\Requests\ValidatePersonStore as EnsoPersonStore;
class ValidatePersonStore extends EnsoPersonStore
...
You should do the same for the Person
model and set at least the right fillable
property.
@gandesc please update the docs for people and company.
$this->bind(ValidatePersonStore::class, function() { return new LocalPersonStore; });
Thank you for the guidance.
It might be worth mentioning in the documentation to bind the ValidatePersonUpdate
class as well.
use LaravelEnso\People\app\Http\Requests\ValidatePersonStore;
use App\Http\Requests\ValidatePersonStoreRequest as LocalPersonStore;
use LaravelEnso\People\app\Http\Requests\ValidatePersonUpdate;
use App\Http\Requests\ValidatePersonUpdateRequest as LocalPersonUpdate;
class AppServiceProvider extends ServiceProvider
{
public function boot()
{
$this->app->bind(ValidatePersonStore::class, function () {
return new LocalPersonStore();
});
$this->app->bind(ValidatePersonUpdate::class, function () {
return new LocalPersonUpdate();
});
}
People no longer has an interface contract for implementing the bindings of the request. (https://github.com/laravel-enso/people/tree/9afd2df78e543c388bae95b57d3044471104a007/src/app/Contracts)
Documentation still advises to
Contracts have since been removed
What is the suggested best practice and would it be possible to update the documentation?