FavoriteLoadingAdd to favorites

Required Laravel includes

use Illuminate\Support\Facades\DB;
use Illuminate\Http\Request;

Select Query

class MySpecialController extends Controller
{
    public function rawQueryFunctionNameSelect(Request $request){
        $rawQuery= DB::select(
            DB::raw(
                'SELECT * FROM table_name'
            )
        );
        return $rawQuery;
    }
}

Update Query

class MySpecialController extends Controller
{
    public function rawQueryFunctionNameUpdate(Request $request){
        DB::table('table_name')->where('id',$request->id)->update(
            array(
                'field'=>$request->field,
                'content'=>$request->content,
            )
        );
    }
}

Pin It on Pinterest

Share This