0
<?php

namespace Mastering\Blowhorn\Model;

use \Magento\Framework\Model\AbstractModel;

class Blowhornmodel extends AbstractModel
{
    public function _construct()
    {
    $this->_init('Mastering\Blowhorn\Model\ResourceModel\Blowhornmodel');
    }
}
1
  • Is Magento running in developer mode? What happens after you've run composer install or composer update? Is the file in vendor/magento/... etc.? Linux machine? Jul 12 at 12:15
0

Replace use \Magento\Framework\Model\AbstractModel with use Magento\Framework\Model\AbstractModel . I am suggesting to remove slash.
Edited: - You can see in this picture the class file is present and its not 404. enter image description here

4
  • I tried that, but it is showing the same error.
    – Saket
    Jul 12 at 5:54
  • How and Where you getting this error - during setup:upgrade ? and may you please post the full error or may be error log. I need some more information to debug it. Jul 12 at 7:24
  • I am getting this error when i am running this particular file.
    – Saket
    Jul 13 at 6:11
  • C:\xampp\htdocs\magento\app\code\Mastering\Sample\Model\News.php Fatal error: Uncaught Error: Class 'Magento\Framework\Model\AbstractModel' not found in C:\xampp\htdocs\magento\app\code\Mastering\Sample\Model\News.php:7 Stack trace: #0 {main} thrown in C:\xampp\htdocs\magento\app\code\Mastering\Sample\Model\News.php on line 7 PHP Fatal error: Uncaught Error: Class 'Magento\Framework\Model\AbstractModel' not found in C:\xampp\htdocs\magento\app\code\Mastering\Sample\Model\News.php:7 Stack trace: #0 {main} thrown in C:\xampp\htdocs\magento\app\code\Mastering\Sample\Model\News.php
    – Saket
    Jul 13 at 6:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.