1. Go to this page and download the library: Download bisual/laravel-shortcuts 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/ */
bisual / laravel-shortcuts example snippets
return [
];
public static $storeRequestClass = StorePostRequest::class;
public static $updateRequestClass = UpdatePostRequest::class;
namespace App\Mcp\Cruds;
use App\Models\CompanyProduct;
use App\Repositories\CompanyProductRepository;
use Bisual\LaravelShortcuts\Mcp\CrudMcpResource;
use Illuminate\Contracts\Auth\Authenticatable;
final class CompanyProductCrudMcp extends CrudMcpResource
{
public static string $model = CompanyProduct::class;
public static string $repository = CompanyProductRepository::class;
public static ?array $only = ['index', 'show']; // which tools to register
public static array $abilities = [
'index' => 'index', // Policy uses index instead of viewAny
];
public static function prepareIndexParams(array &$params, Authenticatable $user): void
{
// e.g. force a scope
}
}
use App\Mcp\Cruds\CompanyProductCrudMcp;
use App\Mcp\Cruds\ProductTaskCrudMcp;
use Bisual\LaravelShortcuts\Mcp\CrudMcpResource;
use Laravel\Mcp\Server;
final class BisualServer extends Server
{
protected function boot(): void
{
$this->tools = [
...CrudMcpResource::toolsFrom([
CompanyProductCrudMcp::class,
ProductTaskCrudMcp::class,
]),
];
}
}
final class CompanyProductCrudMcp extends CrudMcpResource
{
public static ?array $mcp_with = [
'company',
'company_product_phases',
'company_product_phases..company_product_phase_boards',
'company_product_phases..company_product_phase_boards..company_product_phase_board_cols',
];
public static ?array $mcp_scopes = ['isActive'];
public static ?array $mcp_filterable = ['id', 'title', 'code', 'company_id'];
public static int $mcp_relation_depth = 1;
}
use Bisual\LaravelShortcuts\Mcp\AuthenticatedMcpTool;
use Illuminate\Contracts\Auth\Authenticatable;
use Illuminate\Contracts\JsonSchema\JsonSchema;
use Laravel\Mcp\Request;
use Laravel\Mcp\Response;
final class CompanyChatSearchTool extends AuthenticatedMcpTool
{
protected ?int $rateLimitMaxAttempts = 30;
protected function rules(): array
{
return ['company_product_id' => ' return [
'company_product_id' => $schema->integer()->