Araw
2 weeks ago
248
10
Laravel

TEMPORARY Table in laravel

Posted 2 weeks ago by Araw

This is My controller function

    public function temporary_check()
{
    
    

    DB::table('temp_data')->insert(['sender_id'=>2,'receiver_id'=>3,'message'=>'message temp check']);

    $data = DB::table('temp_data')->get();

    Schema::drop('temp_data');

    return $data;
}


when I call this function i got an Error

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'shoppingsite.temp_data' doesn't exist (SQL: insert into `temp_data` (`sender_id`, `receiver_id`, `message`) values (2, 3, message temp check))

Note That this is Temp Table

Please sign in or create an account to participate in this conversation.