tanmay_das

Experience

10,730

0 Best Reply Awards

  • Member Since 7 Months Ago
  • 88 Lessons Completed
  • 1 Favorite

20th September, 2017

tanmay_das left a reply on How Can I Return A Single Data Value For Each Input • 4 weeks ago

Shouldn't the updateCart() method be inside the methods:{} property?

18th September, 2017

tanmay_das started a new conversation Generating Action Url In A Form Relative To The Root Url • 1 month ago

I have a resourceful route,

Route::resource('posts','PostController');

I am creating a Post from this route: http://localhost:3000/posts/create, where I have a form:

<form action="{{ route('posts.store', false) }}" method="POST">
        @include('dashboard.partials.postsform')
</form>

This submits the form to this URL: http://localhost:3000/posts/posts But I want this to be submitted to be this URL: http://localhost:3000/posts

I could hard-code it in the action attribute like http://localhost:3000/posts but what if my application has a different base URL than localhost?

17th September, 2017

tanmay_das started a new conversation Suggest Me Some Tools/strategies For Brainstorming The Application Before Jumping Into The Code • 1 month ago

Up to this point I have been making small/medium size applications. I'd do all the brainstorming in my head and I'd make my design decisions in the middle of the development. But as I am moving towards larger applications I can't do this in my head anymore. I need to have my entire project plan laid out right in front of my eyes. If you are a one-man team, I am sure at some point of your career many of you have faced the similar situation. How do you handle the 'pre-production' phase of your project? What steps do you follow? What tools do you use for visualization? I need some suggestions...

10th September, 2017

tanmay_das left a reply on Foreign Key Constraints On Polymorphic Relationship • 1 month ago

Okay, after googling a bit, I realized why it is not possible to apply foreign key on polymorphic relations. I came across this laracasts discussion

https://www.laracasts.com/discuss/channels/eloquent/polymorphic-relations-on-delete/replies/353658

and decided to be explicit on the controller's destroy() method. Any alternative solution will be greatly appreciated.

tanmay_das started a new conversation Foreign Key Constraints On Polymorphic Relationship • 1 month ago

https://laravel.com/docs/5.5/eloquent-relationships#polymorphic-relations

In this official example of polymorphic relations, the following table structure has been used:

posts
    id - integer
    title - string
    body - text

videos
    id - integer
    title - string
    url - string

comments
    id - integer
    body - text
    commentable_id - integer
    commentable_type - string

How do I set commentable_id as a foreign key in such a way, so that when a post or a video is deleted, all comments associated with it will also be deleted?

The example shown here : https://laravel.com/docs/5.5/migrations#foreign-key-constraints

makes use of the on() method by passing a single table name, users. What if I wanted to apply this on two tables, posts and videos?

$table->foreign('user_id')
      ->references('id')->on('users')
      ->onDelete('cascade');

8th September, 2017

tanmay_das started a new conversation When To Use A Repository • 1 month ago

In many of the laracasts episodes I see Jeffrey use repositories, UserRepository, PostRepository etc. But the tasks that are performed there can also be performed on the Model itself. When should I use a Repository? Can someone please give me an example of a good use case of a Repository?

4th September, 2017

tanmay_das left a reply on V-for In Options Not Working... • 1 month ago

Any update to this thread?

tanmay_das left a reply on How To Use A Vue Property Within Blade Directives • 1 month ago

<script>
    window.num: {{$num}};
</script>

Where does this $num variable come from? If I had a $num variable, couldn't I use that within the for loop in the first place, like this:

@for ($i = 1; $i <= count($myModel->first()->myCustomMethod($num)); $i++)
                <option value="{{ $i }}">{{ $i }}</option>
@endfor 

num is a dynamic JS variable, its value changes according to the user input. So the statement window.num: {{$num}}; won't do the job here since this statement has to be re-evaluated for the new value of num

tanmay_das left a reply on How To Use A Vue Property Within Blade Directives • 1 month ago

Looks like an ajax call is required in this case

tanmay_das left a reply on How To Use A Vue Property Within Blade Directives • 1 month ago

@topvillas That won't work :P Because num is bound to an input as a v-model

tanmay_das left a reply on How To Use A Vue Property Within Blade Directives • 1 month ago

@topvillas Is there any non-AJAX solution for situations like this?

tanmay_das started a new conversation How To Use A Vue Property Within Blade Directives • 1 month ago

I have a vue prop say

{
    num: ''
}

Now I would like to use that property inside a blade for directive:

@for ($i = 1; $i <= count($myModel->first()->myCustomMethod(@{{ num }})); $i++)
                <option value="{{ $i }}">{{ $i }}</option>
@endfor 

But it throws Parse Error. How do I use the vue prop? Also num is a string, how can I convert it into integer before passing it as an argument to myCustomMethod()?

tanmay_das left a reply on Conditional Form Validation • 1 month ago

@bashy Thanks, I'll look into it :)

tanmay_das left a reply on Conditional Form Validation • 1 month ago

@bashy I get your point. But I am not showing both of the fields to the user.

And in @JackJones' defense, it's okay to return an error when neither of them are filled out. I mean given my set of required_without rules, isn't that a natural consequence? Remember, at least one of them has to be filled. So the validation passes when at least one or both of them are filled.

I can only confirm the case of only one being filled. Because there is no way for me (or any normal user) to pass both values from the form. When I select pages, the category selectbox disappears from the DOM and when I select categories the page selectbox disappears from the DOM. I know some people can be sneaky and create another select input from the DevTools and pass both of them but right now instead of learning how to extend the validator, I am putting my money on the least likelihood of people being deceitful.

3rd September, 2017

tanmay_das left a reply on Conditional Form Validation • 1 month ago

@JackJones It's working!

Here are my updated rules:

'title' => 'required|min:3',
'page_id' => 'required_without:category_id',
'category_id' => 'required_without:page_id'

tanmay_das left a reply on Conditional Form Validation • 1 month ago

I have set my rules like this:

'title' => 'required|min:3',
'page_id' => 'required_without:category_id',
'category_id' => 'required_without:page_id'

But still when I select one of the two options, I get the following two errors, at the same time:

The page id field is required when category id is not present.
The category id field is required when page id is not present.

tanmay_das left a reply on Conditional Form Validation • 1 month ago

@bashy Thanks for the reply. But I don't have a good grasp of service providers and service containers yet.

I wish I could sidestep this by modifying the schema. I also have a feeling that this could be solved by tricking the user with the form. It's just that I can't figure it out...

tanmay_das started a new conversation Conditional Form Validation • 1 month ago

I have a menus table that has the following fields:

Schema::create('menus', function (Blueprint $table) {
            $table->increments('id');
            $table->string('title');
            $table->integer('page_id')->unsigned()->nullable();
            $table->integer('category_id')->unsigned()->nullable();
            $table->timestamps();
});

The condition is that the page_id and the category_id both cannot be filled simultaneously. Only one of them can be filled and the other has to be null.

In my view I let the user decide which one (s)he'd like to choose. I display a selectbox containing two items: Pages and Categories. If he chooses Pages, then another selectbox appears containing the list of pages and vice versa. Here is an example: https://imgur.com/a/EFkzF

[Much like the idea of a wordpress menu]

Here are my validation rules:

'title' => 'required|min:3',
'page_id' => 'nullable',
'category_id' => 'nullable'

And here is my $fillable array:

protected $fillable = ['title','page_id','category_id'];

In my validation rules, I cannot set page_id or category_id to required because technically only one of them is going to be required and that will be determined by the action taken by the user. It's like the Schrödinger's cat where I cannot know the state of the cat unless I open the box.

And I cannot even set them nullable, because then the form will pass the validation without page_id and category_id

How do I tackle this? Is my table design okay for situations like this? Am I following the correct strategy?

1st September, 2017

tanmay_das started a new conversation Parent-child Communication In VueJS • 1 month ago

I have two Vue components. The parent-component:

Vue.component('parent-component',{
        methods: {
            test: function(){
             alert('Option Selected');
            }
        },
        template: `
            <div><slot></slot></div>
        `
});

And the animals component:

Vue.component('animals',{
        data: function(){
            return {
                selected: ''
            }
        },
        template: `
            <select @change="selectionChanged" v-model="selected">
                <slot></slot>
            </select>
        `,
        methods: {
            selectionChanged: function(){
                this.$emit('optionselected', this.selected);
            }
        }
 });

And here is my HTML:

<div id="app">
        <parent-component @optionselected="test()">
            <animals>
                <option>Aardvark</option>
                <option>Bear</option>
                <option>Cat</option>
            </animals>
        </parent-component>
 </div>

I am trying to get the selected option from child component (animals) to the parent component (parent-component). I am emitting the optionselected event from the child, but it looks like the parent component is not responding to that event, I mean the method test() is not being called at all. What am I doing wrong here?

Here is the JSFiddle Demo: https://jsfiddle.net/Lhr50k9w/

27th August, 2017

tanmay_das left a reply on Displaying Stored Images On Shared Hosting • 1 month ago

@helpmyworld Yes I had. If my memory serves me correctly, this is what I had to do in order to display the images:

  1. In my filesystems.php file, I had changed the storage path of the local driver from 'root' => storage_path('app') to: 'root' => '/home3/tanmay/public_html/mydomain.com/storage/app'.

  2. Then I referred to the images like this: <img src="{{ asset('storage/app/public' . str_replace('public','',$image->imgsrc)) }}" alt="{{ $ad->name }}" class="img-responsive img-thumbnail" height="200" width="200">

  3. storage/app/public/ directory is where I used to store the images

22nd August, 2017

tanmay_das started a new conversation Is It Possible To Create A FormRequest Along With The Model Using Php Artisan Make:model? • 1 month ago

Usually, for a resource, I create the model, migration and resourceful controller all at once using php artisan make:model MyModel -mcr

Now I realized for a large application, rather than applying rules directly in the controllers method, I should separate them from the controller and keep a dedicated FormRequest class for each of the resources. But php arisan help make:model doesn't show any option for doing such a thing at the same time. So I have to run php artisan make:request MyRequest separately every time. Could you share some tips so that I could save some time and extra keystrokes?

7th August, 2017

tanmay_das left a reply on Laravel-mix - BrowserSync Throwing An Error At Event.js:160 • 2 months ago

Strange but if I prefix the commands with sudo, then it works

tanmay_das left a reply on Laravel-mix - BrowserSync Throwing An Error At Event.js:160 • 2 months ago

Here is a screenshot of my /tmp directory: http://imgur.com/a/jqFjP

I can see a lot of npm-* folders in there... most of them are empty...

tanmay_das left a reply on Laravel-mix - BrowserSync Throwing An Error At Event.js:160 • 2 months ago

@36864 Thanks for your reply. But how can my /tmp directory be full? I installed the OS last night. If the directory is full, how is it that when I create a new laravel project and run the same mix.js file (I mean with browserSync() call), the npm commands run flawlessly? If a new project can pull in the browserSync() dependencies, why should an old project fail?

tanmay_das left a reply on Laravel-mix - BrowserSync Throwing An Error At Event.js:160 • 2 months ago

Question updated...

tanmay_das started a new conversation Laravel-mix - BrowserSync Throwing An Error At Event.js:160 • 2 months ago

Not sure if the problem is related to laravel-mix, but I am having problem with Browsersync package. Here is my mix.js:


mix.js('resources/assets/js/app.js', 'public/js')
   .browserSync({proxy: 'localhost:8000'})
   .sass('resources/assets/sass/app.scss', 'public/css');

When I run npm run watch-poll ( watch doesn't pick up the changes, hence the watch-poll) I get the following error on the console:


[Browsersync] Watching files...
events.js:160
      throw er; // Unhandled 'error' event
      ^

Error: watch resources/views/auth/passwords ENOSPC
    at exports._errnoException (util.js:1020:11)
    at FSWatcher.start (fs.js:1443:19)
    at Object.fs.watch (fs.js:1470:11)
    at createFsWatchInstance (/home/tanmay/LVProjects/learningdemo/node_modules/chokidar/lib/nodefs-handler.js:37:15)
    at setFsWatchListener (/home/tanmay/LVProjects/learningdemo/node_modules/chokidar/lib/nodefs-handler.js:80:15)
    at FSWatcher.NodeFsHandler._watchWithNodeFs (/home/tanmay/LVProjects/learningdemo/node_modules/chokidar/lib/nodefs-handler.js:228:14)
    at FSWatcher.NodeFsHandler._handleDir (/home/tanmay/LVProjects/learningdemo/node_modules/chokidar/lib/nodefs-handler.js:407:19)
    at FSWatcher.<anonymous> (/home/tanmay/LVProjects/learningdemo/node_modules/chokidar/lib/nodefs-handler.js:455:19)
    at FSWatcher.<anonymous> (/home/tanmay/LVProjects/learningdemo/node_modules/chokidar/lib/nodefs-handler.js:460:16)
    at FSReqWrap.oncomplete (fs.js:123:15)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ watch: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js "--watch-poll"`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @ watch script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/tanmay/.npm/_logs/2017-08-07T07_02_31_677Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ watch-poll: `npm run watch -- --watch-poll`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @ watch-poll script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/tanmay/.npm/_logs/2017-08-07T07_02_31_725Z-debug.log

I am on: Ubuntu 16.04.3 (Not a VM) Using: Nodejs v6.11.2, NPM v5.3.0

13th June, 2017

tanmay_das started a new conversation Changing The Value Of 'this' Withing A Vue Method • 4 months ago

I want to simulate a notification that would disappear after 3 seconds. But within the setTimout() method, this is referring to the window object. How do I explicitly tell vue that this should refer to app, not window?

HTML:

<div id="root">
    <h1 v-show="isVisible">A new notification</h1>
</div>

VUE:

var app = new Vue({
        el: '#root',
        data: {
            isVisible: true
        },
        mounted: function(){
            setTimeout(function(){
                app.isVisible = false;
            }, 3000);
            // console.log(this.isVisible);
        }
});

This Works. But this does not:

var app = new Vue({
        el: '#root',
        data: {
            isVisible: true
        },
        mounted: function(){
            setTimeout().call(app, function(){
                this.isVisible = false;
            }, 3000); // Am I calling it the right way?!?
        }
});

27th May, 2017

tanmay_das left a reply on Computed Property Within A Vue.component() • 4 months ago

This fixes the problem: template: '<div v-bind:class="setClass"><slot></slot></div>'

tanmay_das left a reply on Computed Property Within A Vue.component() • 4 months ago

@jimmck The classes aren't being applied. In fact, I don't think the function setClass() is being invoked at all! I tried to execute console.log('If you can see me, setClass func is being called'); inside the setClass() method. Nothing showed up in the console :(

tanmay_das started a new conversation Computed Property Within A Vue.component() • 4 months ago

Hi, I am learning Vue.js 2.0. I want to create a custom component like this: <bs-container fluid="true"></bs-container> and I would like Vue.component() to take care of the bootstrap 3 container classes behind the scenes based on the boolean value passed in the fluid props, because <bs-container fluid="true"></bs-container> looks much cleaner than div class="container-fluid></div>. This is my attempt so far, but it's not working:

HTML:

<div id="app" >
    <bs-container fluid="false">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
    tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
    quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
    consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
    cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
    proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</bs-container>
</div>

VueJS:

Vue.component('bs-container',{
    props: ['fluid'],
    template: '<div class="setClass"><slot></slot></div>',
    computed: {
        setClass: function() {
            if (this.fluid == true) { //Am I accessing fluid properly!?!
                return 'container-fluid';
            } else{
                return 'container';
            }
        }
    }
});

new Vue({
    el: '#app'
})

How can I achieve this?

27th April, 2017

tanmay_das left a reply on Checking Password Hash To Update Password • 5 months ago

@Screenbeetle Thanks, it works: password_verify($request->oldpassword, $seller->password)

tanmay_das left a reply on Checking Password Hash To Update Password • 5 months ago

@Screenbeetle Thanks for letting me know. How should I do it then? :)

tanmay_das started a new conversation Checking Password Hash To Update Password • 5 months ago

I have a controller action like this:

public function passwordUpdate(\App\Seller $seller, Request $request){
            dd($request->oldpassword);
        if(bcrypt($request->oldpassword) == $seller->password){
            $seller->password = bcrypt($request->newpassword);
            $seller->save();
        }
        return redirect()->back();
}

The if condition here never gets executed, because the hashes for $seller-password and bcrypt($request->oldpassword) are never the same. How do I check if the $request->oldpassword really is the currently set password?

tanmay_das left a reply on Accessing Property From An Array Of Records • 5 months ago

@fahad Thanks a lot, that nested foreach loop crossed my mind but I was so depressed that I ignored it earlier. On an unrelated note, it's really good to see an user from my country here in Laravel :) :)

tanmay_das left a reply on Accessing Property From An Array Of Records • 5 months ago

@YewNork Here is the dd() output:

array:1 [▼
  0 => Collection {#255 ▼
    #items: array:1 [▼
      0 => Seller {#262 ▼
        #fillable: array:6 [▶]
        #hidden: array:2 [▶]
        #connection: null
        #table: null
        #primaryKey: "id"
        #keyType: "int"
        +incrementing: true
        #with: []
        #perPage: 15
        +exists: true
        +wasRecentlyCreated: false
        #attributes: array:12 [▼
          "id" => 1
          "name" => "Tanmay Das"
          "email" => "[email protected]"
          "password" => "$2y$10$3nFssVs5N3L5JD0kk2wLU.mYmLQlja6DdztHcPcyhcCqRMouiL7zu"
          "address" => "North Kattali, Chittagong"
          "phone_no" => "01759759461"
          "isbanned" => "0"
          "propic" => "public/sellerpropic/aUTiUQodEmpBqGs6DaidAG0TAidzEgilKORQ4kDo.jpeg"
          "remember_token" => null
          "created_at" => "2017-04-27 14:43:31"
          "updated_at" => "2017-04-27 14:43:31"
          "deleted_at" => null
        ]
        #original: array:12 [▼
          "id" => 1
          "name" => "Tanmay Das"
          "email" => "[email protected]"
          "password" => "$2y$10$3nFssVs5N3L5JD0kk2wLU.mYmLQlja6DdztHcPcyhcCqRMouiL7zu"
          "address" => "North Kattali, Chittagong"
          "phone_no" => "01759759461"
          "isbanned" => "0"
          "propic" => "public/sellerpropic/aUTiUQodEmpBqGs6DaidAG0TAidzEgilKORQ4kDo.jpeg"
          "remember_token" => null
          "created_at" => "2017-04-27 14:43:31"
          "updated_at" => "2017-04-27 14:43:31"
          "deleted_at" => null
        ]
        #casts: []
        #dates: []
        #dateFormat: null
        #appends: []
        #events: []
        #observables: []
        #relations: []
        #touches: []
        +timestamps: true
        #visible: []
        #guarded: array:1 [▶]
        #rememberTokenName: "remember_token"
      }
    ]
  }
]

tanmay_das left a reply on Accessing Property From An Array Of Records • 5 months ago

Here it is @fahad :

<div class="list-group">
                        @foreach($sellers as $seller)
                            
                                    <a href="#" class="list-group-item">From: {{ $seller->email }}</a>
                  
                        @endforeach
</div>

tanmay_das started a new conversation Accessing Property From An Array Of Records • 5 months ago

I have a route defined like this:

Route::get('/buyer_home', function(){
    $senders = \App\Message::where(['to' => \Auth::guard('web_buyer')->user()->username])->distinct()->get(['from']);
    $sellers = array();
    foreach ($senders as $sender) {
        $sellers[] = \App\Seller::where('email', $sender->from)->get();
    }
      return view('buyer.home', compact('sellers', 'senders'));
});

I am in a situation where I need to access the columns/properties of the sellers table/model in my view to establish a condition like this: @if(sender->from == seller->email). But I am getting Property [email] does not exist on this collection instance. error message when I try to access the email property of each of the sellers result within a @foreach loop. All I am intending to do is pass the list of the sellers to the view, and only those sellers who have the email that matches email returned from $sender->from. How do I tackle this?

23rd April, 2017

tanmay_das left a reply on Displaying Stored Images On Shared Hosting • 5 months ago

@Snapey How do I upload them in the public directory? Currently when I call the store method, I call it this way: ->store('public/myfolder1'); and that uploads the file to storage/app/public/myfolder1 in this folder.

My document root is: /public_html/mydomain.com/ what would be the passed argument for the store() method, if I wanted to store an image, say on /public_html/mydomain.com/imgs/myfolder1 ?

tanmay_das left a reply on Displaying Stored Images On Shared Hosting • 5 months ago

But people keep telling about all this 'Conventions' and 'Best Practices' where they suggest not to put them in public folder?

tanmay_das left a reply on Displaying Stored Images On Shared Hosting • 5 months ago

On local environment I would run php artisan storage:link to create a symlink, but I cannot run it on server due to the hosting plan limitation. Any other way to create the symlink? I have the SSH access though.

tanmay_das started a new conversation Displaying Stored Images On Shared Hosting • 5 months ago

I have successfully deployed my first laravel application on a live server. Everything looks great except the fact that I am unable to display the images that are being uploaded to the storage/app/public/myfolder1 folder.

Here is my folder hierarchy on HostGator:

/myproject_src/ : Here are all the laravel source files (except the public folder) /public_html/mydomain.com/ : Here goes all my contents of the public directory

I am storing the file path into the database in the following manner:

public/myfolder1/FxEj1V1neYrc7CVUYjlcYZCUf4YnC84Z3cwaMjVX.png

What should I do in order to display the images properly in a img tag:

<img src="{{ how to point to the uploaded image here }}">

21st April, 2017

tanmay_das left a reply on Inserting Checkbox Value Into Database • 5 months ago

->create(['isnegotiable' => request()->has('isnegotiable')])

it doesn't work because laravel treats the given value as a column, not the `isnegotiable' that we are trying to pass.

Throws this error: Column not found: 1054 Unknown column '1' in 'field list'

tanmay_das left a reply on Inserting Checkbox Value Into Database • 5 months ago

@EventFellows The problem is I am allowing user to leave the checkbox unselected which means when the form is submitted, $request object will not create any isnegotiable property, so dd($request->all()) probably will not output the isnegotiable variable. Hence, I am compelled to add it manually to the $request object.

Another solution could be using javascript to check if the checkbox is 'unselected' and if so, maybe I could append a value to the $request object through a hidden input. But that's just too much work I guess...

tanmay_das left a reply on Inserting Checkbox Value Into Database • 5 months ago

Doing it this way right now:

if(request()->has('isnegotiable') === false){
        $request->request->add(['isnegotiable' => false]);
}

//and create() method goes like this:

Item::create(['value1', 'value2', 'isnegotiable', 'anothervalue']);

but I am looking forward to a nicer solution:

tanmay_das left a reply on Inserting Checkbox Value Into Database • 5 months ago

Nope, that generated yet another error because laravel now treats the value, which is '1' as an entire column: Column not found: 1054 Unknown column '1' in 'field list'

tanmay_das left a reply on Inserting Checkbox Value Into Database • 5 months ago

@edoc Looks like I have to wrap it with quotes like this: create(['isnegotiable' => request()->has('isnegotiable')])? because I am getting this error: Use of undefined constant isnegotiable - assumed 'isnegotiable'

tanmay_das left a reply on Inserting Checkbox Value Into Database • 5 months ago

How can I solve the issue other than programmatically checking if $request->isnegotiable == null (in case the user did not select the checkbox) and then manually setting $request->isnegotiable = true in my controller?

tanmay_das started a new conversation Inserting Checkbox Value Into Database • 5 months ago

In my view I have a checkbox like this:

<input type="checkbox" name="isnegotiable" value="1"> Negotiable

And in my migration file I am setting the default value of this field to 0:

$table->boolean('isnegotiable')->default(false);

My intention is to set this value to 1 only when the user selects the checkbox. But it turns out, even if the user selects the checkbox, isnegotiable column gets filled with 0, not 1.

Because I cannot pass the isnegotiable as the argument of create(request()) method as it throws isnegotiable column cannot be null error. What should I do?

Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.