Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

how set variable public in static method in laravel

class ContentController extends BaseController {

    public static $text = null;

    public static function getContent($description)
    {
        $content = Content::where('description', $description)->first();
        return static::$text = $content->text;
    }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #set #variable #public #static #method #laravel
ADD COMMENT
Topic
Name
6+1 =