Answers for "static data for laravel"

PHP
2

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
1

static function model laravel

public static function isOpen($week)
{
    return (new static)::where('week', $week)->first();
}
Posted by: Guest on February-13-2021

Code answers related to "static data for laravel"

Browse Popular Code Answers by Language