classes/Controllers/Base.php
protected function successMessage($input = '', $verb = 'saved')
    {
        // Figure out the title and wrap it in quotes
        $title = $input;
        if (is_a($input, '\Bkwld\Decoy\Models\Base')) {
            $title = $input->getAdminTitleAttribute();
        }

        if ($title && is_string($title)) {
            $title =  '"'.$title.'"';
        }

        // Render the message
        $message = __('decoy::base.success_message', ['model' => Str::singular($this->title), 'title' => $title, 'verb' => __("decoy::base.verb.$verb")]);

        // Add extra messaging for copies
        if ($verb == 'duplicated') {
            $url = preg_replace('#/duplicate#', '/edit', Request::url());
            $message .= __('decoy::base.success_duplicated', ['url' => $url]);
        }

        // Add extra messaging if the creation was begun from the localize UI
        if ($verb == 'duplicated' && is_a($input, '\Bkwld\Decoy\Models\Base') && !empty($input->locale)) {
            $message .= __('decoy::base.success_localized', ['locale' => config('decoy.site.locales')[$input->locale]]);
        }

        // Return message
        return $message;
    }
protected function successMessage($input = '', $verb = 'saved')
    {
        // Figure out the title and wrap it in quotes
        $title = $input;
        if (is_a($input, '\Bkwld\Decoy\Models\Base')) {
            $title = $input->getAdminTitleAttribute();
        }

        if ($title && is_string($title)) {
            $title =  '"'.$title.'"';
        }

        // Render the message
        $message = __('decoy::base.success_message', ['model' => Str::singular($this->title), 'title' => $title, 'verb' => __("decoy::base.verb.$verb")]);

        // Add extra messaging for copies
        if ($verb == 'duplicated') {
            $url = preg_replace('#/duplicate#', '/edit', Request::url());
            $message .= __('decoy::base.success_duplicated', ['url' => $url]);
        }

        // Add extra messaging if the creation was begun from the localize UI
        if ($verb == 'duplicated' && is_a($input, '\Bkwld\Decoy\Models\Base') && !empty($input->locale)) {
            $message .= __('decoy::base.success_localized', ['locale' => config('decoy.site.locales')[$input->locale]]);
        }

        // Return message
        return $message;
    }
protected function successMessage ( $ input = '' , $ verb = 'saved' ) { // Figure out the title and wrap it in quotes $ title = $ input ; if ( is_a ( $ input , '\Bkwld\Decoy\Models\Base' ) ) { $ title = $ input -> getAdminTitleAttribute ( ) ; } if ( $ title && is_string ( $ title ) ) { $ title = '"' . $ title . '"' ; } // Render the message $ message = __ ( 'decoy::base.success_message' , [ 'model' => Str :: singular ( $ this -> title ) , 'title' => $ title , 'verb' => __ ( "decoy::base.verb.$verb" ) ] ) ; // Add extra messaging for copies if ( $ verb == 'duplicated' ) { $ url = preg_replace ( '#/duplicate#' , '/edit' , Request :: url ( ) ) ; $ message .= __ ( 'decoy::base.success_duplicated' , [ 'url' => $ url ] ) ; } // Add extra messaging if the creation was begun from the localize UI if ( $ verb == 'duplicated' && is_a ( $ input , '\Bkwld\Decoy\Models\Base' ) && ! empty ( $ input -> locale ) ) { $ message .= __ ( 'decoy::base.success_localized' , [ 'locale' => config ( 'decoy.site.locales' ) [ $ input -> locale ] ] ) ; } // Return message return $ message ; }
Creates a success message for CRUD commands

@param  Bkwld\Decoy\Model\Base|string $title The model instance that is
being worked on  or a string
containing the title
@param  string                        $verb  Default: 'saved'. Past tense CRUD verb (created, saved, etc)
@return string                        The CRUD success message string
Creates a success message for CRUD commands