PHP code example of softonic / rest-api-nested-resources
1. Go to this page and download the library: Download softonic/rest-api-nested-resources library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
softonic / rest-api-nested-resources example snippets
class UserCommentModel extends MultiKeyModel
{
/**
* Identifiers to be hashed and used in the real primary and foreign keys.
*/
protected static array $generatedIds = [
'id_user_comment' => [
'id_user',
'id_comment',
],
];
}
use App\Models\UserComment;
class UserCommentController extends Controller
{
public function show(UserComment $userComment)
{
...
}
}
use App\Models\UserComment;
class UserCommentController extends Controller
{
use SplitPutPatchVerbs;
public function modify(UserComment $userComment, Request $request)
{
...
}
public function replace(Request $request, string $id_user, string $id_comment)
{
...
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.