Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
90 views
in Technique[技术] by (71.8m points)

Laravel 5 getparentsTree

Trying to get property 'title' of non-object (View: C:phplaravellp esourcesviewsadminproduct_edit.blade.php)

C:phplaravellpappHttpControllersAdminCategoryController inner title line error i think

public static function getParentsTree($category,$title)

{

    if ($category->parent_id == 0)

    {

        return $title;

    }

    $parent = Category::find($category->parent_id);

    ***$title = $parent->title. ' > ' . $title;***


    return CategoryController::getParentsTree($parent,$title);

}
question from:https://stackoverflow.com/questions/65648803/laravel-5-getparentstree

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

catagories table ss

database error. if you have already entered data in the category table in your database. If the product_id remains automatically assigned, it will be the value of product_id. The reason for the error here is that the product_id are confusing the database. I got rid of the error by setting the product_id in the table to 0.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...