tinker parsed my error T_PAAMAYIM_NEKUDOTAYIM

I'm trying to insert data using tinker compact method

here is my tinker snippet

$post = App\Post::create(['post_title' => 'Laravel Is generate some code!' , 'post_body' => 'Laravel 5.1 Have strong and clean method to type a code using OOP and MVC techneiq' , 'post_author_id' => '1', 'post_date' => Carbon\Carbon::now()->toDateString(), 'post_time' => Carbon\Carbon::now()->toTimeString(), 'publish_date'=> Carbon\Carbon()::tomorrow()->toDateString(), 'publish_time' => '12:30:00']);

Here my Post Model

class Post extends Model

    protected $fillable = [


I got this error

....PHP Parse error: Syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM, expecting ']' on line 1

any solution (:

thomastkim replied 3 years ago Solution

It's probably this line of code:


It should be:

shez1983 replied 3 years ago

also if you really split this into three new lines.. then the error would have showed on line 3 somewhat narrowing the problem area

Sign in to participate in this thread!

We'd like to thank these amazing companies for supporting us