<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
henrotaym / laravel-trustup-messaging-io example snippets
use App\Models\YourModel;
use Illuminate\Support\ServiceProvider;
use Illuminate\Database\Eloquent\Relations\Relation;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*
* @return void
*/
public function register()
{
Relation::enforceMorphMap([
'your-model' => YourModel::class,
]);
}
}
use Henrotaym\LaravelTrustupMessagingIo\Contracts\Models\MessagingIoModelContract;
use Henrotaym\LaravelTrustupMessagingIo\Models\Traits\IsMessagingIoModel;
use Illuminate\Database\Eloquent\Model;
class MyModel extends Model implements MessagingIoModelContract
{
use IsMessagingIoModel;
}
use Henrotaym\LaravelTrustupMessagingIo\Http\Resources\MessagingIoModel;
use Illuminate\Http\Request;
class MyResource extends MessagingIoModel
{
protected function getAttributes(Request $request): array
{
// Define your attributes here.
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.