Answers for "how set variable public in static method in laravel"

PHP
1

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;
    }
}
Posted by: Guest on April-10-2021
0

laravel public static variable

class Export extends Model {
    public static $itemsPerPage = 20;

	public function test() {
		static::$itemsPerPage;
    }
}
Posted by: Guest on November-16-2020

Code answers related to "how set variable public in static method in laravel"

Browse Popular Code Answers by Language