Monday, March 13, 2017

Laravel, how to save DomDocument to database?

I'm stuck with my project and i need your help! I'm trying to save domdocument variable to my database. I'm using Laravel 5.4

How do i save the following variable?

$title = $dom->getElementsByTagName('title');

My Controller:

TemporaryScan::create([

'title' => ??

]);

Temporary scan table:

Schema::create('temporary_scans', function (Blueprint $table) {
        $table->increments('id');
        $table->text('title');
        $table->timestamps();
    });

I'm not sure if using text() is the right option.

Thanks in advance.



via itvba

Advertisement