0

Try to save student in database but when i call save() method, it gives error.

I have checked this question and try all the answers but no one works. FatalErrorException in Inflector.php line 265: syntax error, unexpected ':', expecting ';' or '{'

FatalErrorException in Inflector.php line 265:

I have php version: 7.2.7 and composer version 1.6.3

    <?php

      namespace App\Http\Controllers;

      use Illuminate\Foundation\Bus\DispatchesJobs;
      use Illuminate\Routing\Controller as BaseController;
      use Illuminate\Foundation\Validation\ValidatesRequests;
      use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
      use App\Student;



        class HelloController extends Controller {

            public function index() {

                 $student = new Student;

                 $student->sname = "Maulik";
                 $student->standerd = 10;

                 $student->save();



        return view('hello')->with('data', 'test');
    }

}

?>

enter image description here

tereško
  • 58,060
  • 25
  • 98
  • 150
Samir Mangroliya
  • 39,918
  • 16
  • 117
  • 134
  • 1
    [Related](https://stackoverflow.com/questions/48380892/fatalerrorexception-in-inflector-php-line-265-syntax-error-unexpected-exp)? – FirstOne Aug 07 '18 at 13:01
  • I don't see Inflector.php line 265 anywhere. The error clearly isn't in your snippet. – Machavity Aug 07 '18 at 13:03
  • Show full controller code please ! The error is rather syntactic! – Goms Aug 07 '18 at 13:03
  • @FirstOne I went ahead and hammered this, since the error message and environment match up. If the OP adds more details about how this is different we can always reopen. – Machavity Aug 07 '18 at 13:13
  • those who are closing the question please put solution , i have tried the answers of all duplicate question. – Samir Mangroliya Aug 07 '18 at 13:15
  • @SamirMangroliya show the full code of your controller. It is just by analyzing your code in entirety that we will know where the problem is. The code you've shown so far is perfectly perfect! If you need help, show full code of your controller – Goms Aug 07 '18 at 13:16
  • 1
    @SamirMangroliya The error is in Doctrine, not Laravel. What version of Doctrine did Composer load? – Machavity Aug 07 '18 at 13:19
  • "doctrine/inflector": "1.1.0" – Samir Mangroliya Aug 07 '18 at 13:26

0 Answers0