Answers for "laravel list of models"

PHP
2

get all data eloquent laravel

Blog::all();

//example usage.
$posts = Blog::all();
Posted by: Guest on October-28-2020
0

none

<?php
// found link from https://stackoverflow.com/questions/34053585/how-do-i-get-a-list-of-all-models-in-laravel
// and then finally found on https://gist.github.com/mohammad425/231242958edb640601108bdea7bcf9ac
function getAllModels(): array
{
        $composer = json_decode(file_get_contents(base_path('composer.json')), true);
        $models = 
Posted by: Guest on January-01-1970

Browse Popular Code Answers by Language