Answers for "use laravel model function in controller"

PHP
5

create model with controller laravel

php artisan make:controller CustomersController --model=Customer
Posted by: Guest on January-01-2021
0

function inside model laravel

class Order extends Model {
    public static function myMethod() {
        return static::query()->where(...)->get(); // example
    }
}

(new Order())->myMethod();
Order::myMethod();
Posted by: Guest on November-12-2021

Code answers related to "use laravel model function in controller"

Browse Popular Code Answers by Language