Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Marco response #51

Open
donutloop opened this issue Jun 19, 2020 · 0 comments
Open

Marco response #51

donutloop opened this issue Jun 19, 2020 · 0 comments

Comments

@donutloop
Copy link
Owner

donutloop commented Jun 19, 2020

It might be good to create Marco (response and request)

Ref: https://laravel.com/docs/7.x/responses#response-macros


<?php

namespace App\Providers;

use Illuminate\Support\Facades\Response;
use Illuminate\Support\ServiceProvider;

class ResponseMacroServiceProvider extends ServiceProvider
{
    /**
     * Register the application's response macros.
     *
     * @return void
     */
    public function boot()
    {
        Response::macro('caps', function ($value) {
            return Response::make(strtoupper($value));
        });
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant