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');
}
}
?>