0

How I can use toogle for insert data( 0 1) to database? I couldn't find this question's answer from Google in two days.

Toggle::make('is_active')

I write code as above but it doesn't work. It works as button but not change data on database.

Ryan M
  • 18,333
  • 31
  • 67
  • 74
VurgunG
  • 1
  • 2
  • You'll want to post a lot more info to get proper help. Some questions to answer offhand: - are you able to save any data to the database? - show the code you're using to post the request to the backend - show the code you're using to accept the request on the backend and write to the database – lps Dec 22 '22 at 02:04
  • Please provide enough code so others can better understand or reproduce the problem. – Community Dec 22 '22 at 02:06

1 Answers1

0

I found the answer. Just need to add 'is_active' to $fillable in Model:

    protected $fillable = [
  
      'is_active',

];
Anton Menshov
  • 2,266
  • 14
  • 34
  • 55
VurgunG
  • 1
  • 2